You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/workflow.md
+35-31Lines changed: 35 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -465,7 +465,7 @@ results/
465
465
Target names cannot begin or end with a slash (`/`).
466
466
:::
467
467
468
-
By default, all files emitted by a published channel will be published into the specified directory. If a channel emits list values, each file in the list (including nested lists) will be published. For example:
468
+
By default, all files emitted by a published channel will be published into the specified directory. Lists and maps are recursively scanned for nested files. For example:
469
469
470
470
```nextflow
471
471
workflow {
@@ -503,12 +503,12 @@ workflow {
503
503
}
504
504
505
505
output {
506
-
'foo' {
506
+
foo {
507
507
enabled params.save_foo
508
508
path 'intermediates/foo'
509
509
}
510
510
511
-
'bar' {
511
+
bar {
512
512
mode 'copy'
513
513
}
514
514
}
@@ -523,7 +523,7 @@ This output block has the following effect:
523
523
See [Reference](#reference) for all available directives in the output block.
524
524
525
525
:::{tip}
526
-
The output block is only needed if you want to customize the behavior of specific targets. If you are satisfied with the default behavior and don't need to customize anything, the output block can be omitted.
526
+
The output block can be omitted if you are satisfied with the default behavior. However, as a best practice, you should declare each output in the output block, even if you don't need to customize the publish path or create any index files.
527
527
:::
528
528
529
529
### Dynamic publish path
@@ -533,15 +533,17 @@ The `path` directive in a target block can also be a closure which defines a cus
@@ -552,19 +554,15 @@ The closure can even define a different path for each individual file by returni
552
554
553
555
```nextflow
554
556
output {
555
-
'fastq' {
556
-
path { meta, fastq_1, fastq_2 ->
557
-
{ file -> "fastq/${meta.id}/${file.baseName}" }
557
+
samples {
558
+
path { sample ->
559
+
{ filename -> "fastq/${sample.id}/${filename}" }
558
560
}
559
561
}
560
562
}
561
563
```
562
564
563
-
The inner closure will be applied to each file in the channel value, in this case `fastq_1` and `fastq_2`.
564
-
565
-
:::{tip}
566
-
A mapping closure should usually have only one parameter. However, if the incoming values are tuples, the closure can specify a parameter for each tuple element for more convenient access, also known as "destructuring" or "unpacking".
567
-
:::
565
+
The inner closure will be applied to each file in the channel value, in this case `sample.fastq_1` and `sample.fastq_2`.
0 commit comments