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/cache-and-resume.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,8 +113,8 @@ While Nextflow tries to make it easy to write safe concurrent code, it is still
113
113
Consider the following example:
114
114
115
115
```nextflow
116
-
Channel.of(1,2,3) | map { v -> X=v; X+=2 } | view { v -> "ch1 = $v" }
117
-
Channel.of(1,2,3) | map { v -> X=v; X*=2 } | view { v -> "ch2 = $v" }
116
+
channel.of(1,2,3) | map { v -> X=v; X+=2 } | view { v -> "ch1 = $v" }
117
+
channel.of(1,2,3) | map { v -> X=v; X*=2 } | view { v -> "ch2 = $v" }
118
118
```
119
119
120
120
The problem here is that `X` is declared in each `map` closure without the `def` keyword (or other type qualifier). Using the `def` keyword makes the variable local to the enclosing scope; omitting the `def` keyword makes the variable global to the entire script.
@@ -125,10 +125,10 @@ The solution is to not use a global variable where a local variable is enough (o
125
125
126
126
```nextflow
127
127
// local variable
128
-
Channel.of(1,2,3) | map { v -> def X=v; X+=2 } | view { v -> "ch1 = $v" }
128
+
channel.of(1,2,3) | map { v -> def X=v; X+=2 } | view { v -> "ch1 = $v" }
129
129
130
130
// no variable
131
-
Channel.of(1,2,3) | map { v -> v * 2 } | view { v -> "ch2 = $v" }
131
+
channel.of(1,2,3) | map { v -> v * 2 } | view { v -> "ch2 = $v" }
132
132
```
133
133
134
134
(cache-nondeterministic-inputs)=
@@ -139,8 +139,8 @@ Sometimes a process needs to merge inputs from different sources. Consider the f
Copy file name to clipboardExpand all lines: docs/migrations/25-04.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,10 @@ The third preview of workflow outputs introduces the following breaking changes
37
37
38
38
See {ref}`workflow-output-def` to learn more about the workflow output definition.
39
39
40
+
<h3>Topic channels (out of preview)</h3>
41
+
42
+
{ref}`Topic channels <channel-topic>`, introduced in Nextflow 24.04 as a preview feature, have been brought out of preview, which means that they can be used without the `nextflow.preview.topic` feature flag.
43
+
40
44
<h3>Data lineage</h3>
41
45
42
46
This release introduces built-in provenance tracking, also known as *data lineage*. When `lineage.enabled` is set to `true` in your configuration, Nextflow will record every workflow run, task execution, output file, and the links between them.
Copy file name to clipboardExpand all lines: docs/migrations/dsl1.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,6 +152,7 @@ DSL2 scripts cannot exceed 64 KB in size. Split large DSL1 scripts into modules
152
152
153
153
<h3>Channels</h3>
154
154
155
+
- Channel factories should be accessed through the `channel` namespace instead of the `Channel` type, although they can still be accessed through either method.
155
156
- Channel method `bind` has been deprecated in DSL2.
156
157
- Channel method `<<` has been deprecated in DSL2.
157
158
- Channel factory `create` has been deprecated in DSL2.
@@ -455,7 +455,7 @@ In this example, each file received by the process is staged with the name `quer
455
455
This feature allows you to execute the process command multiple times without worrying about the file names changing. In other words, Nextflow helps you write pipeline tasks that are self-contained and decoupled from the execution environment. As a best practice, you should avoid referencing files in your process script other than those defined in your input block.
456
456
:::
457
457
458
-
Channel factories like `Channel.fromPath` produce file objects, but a `path` input can also accept a string literal path. The string value should be an absolute path, i.e. it must be prefixed with a `/` character or a supported URI protocol (`file://`, `http://`, `s3://`, etc), and it cannot contain special characters (`\n`, etc).
458
+
Channel factories like `channel.fromPath` produce file objects, but a `path` input can also accept a string literal path. The string value should be an absolute path, i.e. it must be prefixed with a `/` character or a supported URI protocol (`file://`, `http://`, `s3://`, etc), and it cannot contain special characters (`\n`, etc).
459
459
460
460
```nextflow
461
461
process foo {
@@ -501,7 +501,7 @@ process blastThemAll {
501
501
}
502
502
503
503
workflow {
504
-
def fasta = Channel.fromPath( "/some/path/*.fa" ).buffer(size: 3)
504
+
def fasta = channel.fromPath( "/some/path/*.fa" ).buffer(size: 3)
505
505
blastThemAll(fasta)
506
506
}
507
507
```
@@ -543,7 +543,7 @@ process blastThemAll {
543
543
}
544
544
545
545
workflow {
546
-
def fasta = Channel.fromPath( "/some/path/*.fa" ).buffer(size: 3)
546
+
def fasta = channel.fromPath( "/some/path/*.fa" ).buffer(size: 3)
@@ -776,7 +776,7 @@ The process `foo` is executed two times because the `x` channel emits only two v
776
776
2 and b
777
777
```
778
778
779
-
A different semantic is applied when using a {ref}`value channel <channel-type-value>`. This kind of channel is created by the {ref}`Channel.value <channel-value>` factory method or implicitly when a process is invoked with an argument that is not a channel. By definition, a value channel is bound to a single value and it can be read an unlimited number of times without consuming its content. Therefore, when mixing a value channel with one or more (queue) channels, it does not affect the process termination because the underlying value is applied repeatedly.
779
+
A different semantic is applied when using a {ref}`value channel <channel-type-value>`. This kind of channel is created by the {ref}`channel.value <channel-value>` factory method or implicitly when a process is invoked with an argument that is not a channel. By definition, a value channel is bound to a single value and it can be read an unlimited number of times without consuming its content. Therefore, when mixing a value channel with one or more (queue) channels, it does not affect the process termination because the underlying value is applied repeatedly.
780
780
781
781
To better understand this behavior, compare the previous example with the following one:
@@ -375,16 +375,16 @@ The following code snippet shows an example for using the `Channel.fromSRA` fact
375
375
The `interval` method emits an incrementing index (starting from zero) at a periodic interval. For example:
376
376
377
377
```nextflow
378
-
Channel.interval('1s').view()
378
+
channel.interval('1s').view()
379
379
```
380
380
381
381
The above snippet will emit 0, 1, 2, and so on, every second, forever. You can use an operator such as {ref}`operator-take` or {ref}`operator-until` to close the channel based on a stopping condition.
382
382
383
-
An optional closure can be used to transform the index. Additionally, returning `Channel.STOP` will close the channel. For example:
383
+
An optional closure can be used to transform the index. Additionally, returning `channel.STOP` will close the channel. For example:
384
384
385
385
```nextflow
386
-
ch = Channel.interval('1s') { i ->
387
-
i == 10 ? Channel.STOP : i
386
+
ch = channel.interval('1s') { i ->
387
+
i == 10 ? channel.STOP : i
388
388
}
389
389
ch.view()
390
390
```
@@ -444,7 +444,7 @@ See also: [channel.fromList](#fromlist) factory method.
444
444
:::
445
445
446
446
:::{note}
447
-
This feature requires the `nextflow.preview.topic` feature flag to be enabled.
447
+
In versions of Nextflow prior to 25.04, this feature requires the `nextflow.preview.topic` feature flag to be enabled.
448
448
:::
449
449
450
450
A *topic channel* is a queue channel that can receive values from many source channels *implicitly* based on a matching *topic name*.
0 commit comments