Skip to content

Commit 3453af8

Browse files
committed
Merge branch 'master' into data-lineage-simplify-fragment
Signed-off-by: Ben Sherman <[email protected]>
2 parents ffe7e36 + f99bcd3 commit 3453af8

File tree

131 files changed

+278
-278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+278
-278
lines changed

docs/cache-and-resume.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ While Nextflow tries to make it easy to write safe concurrent code, it is still
113113
Consider the following example:
114114

115115
```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" }
118118
```
119119

120120
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
125125

126126
```nextflow
127127
// 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" }
129129
130130
// 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" }
132132
```
133133

134134
(cache-nondeterministic-inputs)=
@@ -139,8 +139,8 @@ Sometimes a process needs to merge inputs from different sources. Consider the f
139139

140140
```nextflow
141141
workflow {
142-
ch_foo = Channel.of( ['1', '1.foo'], ['2', '2.foo'] )
143-
ch_bar = Channel.of( ['2', '2.bar'], ['1', '1.bar'] )
142+
ch_foo = channel.of( ['1', '1.foo'], ['2', '2.foo'] )
143+
ch_bar = channel.of( ['2', '2.bar'], ['1', '1.bar'] )
144144
gather(ch_foo, ch_bar)
145145
}
146146
@@ -162,8 +162,8 @@ The solution is to explicitly join the two channels before the process invocatio
162162

163163
```nextflow
164164
workflow {
165-
ch_foo = Channel.of( ['1', '1.foo'], ['2', '2.foo'] )
166-
ch_bar = Channel.of( ['2', '2.bar'], ['1', '1.bar'] )
165+
ch_foo = channel.of( ['1', '1.foo'], ['2', '2.foo'] )
166+
ch_bar = channel.of( ['2', '2.bar'], ['1', '1.bar'] )
167167
gather(ch_foo.join(ch_bar))
168168
}
169169

docs/channel.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,12 @@ See also: {ref}`process-multiple-input-channels`.
6666

6767
Channel factories are functions that can create channels.
6868

69-
For example, the `Channel.of()` factory can be used to create a channel from an arbitrary list of arguments:
69+
For example, the `channel.of()` factory can be used to create a channel from an arbitrary list of arguments:
7070

7171
```nextflow
72-
Channel.of(1, 2, 3).view()
72+
channel.of(1, 2, 3).view()
7373
```
7474

75-
:::{versionadded} 20.07.0
76-
`channel` was introduced as an alias of `Channel`, allowing factory methods to be specified as `channel.of()` or `Channel.of()`, and so on.
77-
:::
78-
7975
See {ref}`channel-factory` for the full list of channel factories.
8076

8177
## Operators

docs/flux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Here is an example pipeline that we will use:
3838

3939
```nextflow
4040
workflow {
41-
breakfast = Channel.of '🥞️', '🥑️', '🥧️', '🍵️', '🍞️'
41+
breakfast = channel.of '🥞️', '🥑️', '🥧️', '🍵️', '🍞️'
4242
haveMeal(breakfast)
4343
}
4444

docs/migrations/25-04.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ The third preview of workflow outputs introduces the following breaking changes
3737

3838
See {ref}`workflow-output-def` to learn more about the workflow output definition.
3939

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+
4044
<h3>Data lineage</h3>
4145

4246
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.

docs/migrations/dsl1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ DSL2 scripts cannot exceed 64 KB in size. Split large DSL1 scripts into modules
152152

153153
<h3>Channels</h3>
154154

155+
- Channel factories should be accessed through the `channel` namespace instead of the `Channel` type, although they can still be accessed through either method.
155156
- Channel method `bind` has been deprecated in DSL2.
156157
- Channel method `<<` has been deprecated in DSL2.
157158
- Channel factory `create` has been deprecated in DSL2.

docs/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ process extractTopHits {
5555
}
5656
5757
workflow {
58-
def query_ch = Channel.fromPath(params.query)
58+
def query_ch = channel.fromPath(params.query)
5959
blastSearch(query_ch, params.db)
6060
extractTopHits(blastSearch.out, params.db).view()
6161
}

docs/process.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ process templateExample {
171171
}
172172
173173
workflow {
174-
Channel.of('this', 'that') | templateExample
174+
channel.of('this', 'that') | templateExample
175175
}
176176
```
177177

@@ -228,7 +228,7 @@ process myTask {
228228
}
229229
230230
workflow {
231-
Channel.of('Hello', 'Hola', 'Bonjour') | myTask
231+
channel.of('Hello', 'Hola', 'Bonjour') | myTask
232232
}
233233
```
234234

@@ -258,7 +258,7 @@ process simpleSum {
258258
}
259259
260260
workflow {
261-
Channel.of('a', 'b', 'c') | simpleSum
261+
channel.of('a', 'b', 'c') | simpleSum
262262
}
263263
```
264264

@@ -352,7 +352,7 @@ process basicExample {
352352
}
353353
354354
workflow {
355-
def num = Channel.of(1,2,3)
355+
def num = channel.of(1,2,3)
356356
basicExample(num)
357357
}
358358
```
@@ -384,7 +384,7 @@ process basicExample {
384384
}
385385
386386
workflow {
387-
Channel.of(1,2,3) | basicExample
387+
channel.of(1,2,3) | basicExample
388388
}
389389
```
390390
:::
@@ -407,7 +407,7 @@ process blastThemAll {
407407
}
408408
409409
workflow {
410-
def proteins = Channel.fromPath( '/some/path/*.fa' )
410+
def proteins = channel.fromPath( '/some/path/*.fa' )
411411
blastThemAll(proteins)
412412
}
413413
```
@@ -444,7 +444,7 @@ process blastThemAll {
444444
}
445445
446446
workflow {
447-
def proteins = Channel.fromPath( '/some/path/*.fa' )
447+
def proteins = channel.fromPath( '/some/path/*.fa' )
448448
blastThemAll(proteins)
449449
}
450450
```
@@ -455,7 +455,7 @@ In this example, each file received by the process is staged with the name `quer
455455
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.
456456
:::
457457

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).
459459

460460
```nextflow
461461
process foo {
@@ -501,7 +501,7 @@ process blastThemAll {
501501
}
502502
503503
workflow {
504-
def fasta = Channel.fromPath( "/some/path/*.fa" ).buffer(size: 3)
504+
def fasta = channel.fromPath( "/some/path/*.fa" ).buffer(size: 3)
505505
blastThemAll(fasta)
506506
}
507507
```
@@ -543,7 +543,7 @@ process blastThemAll {
543543
}
544544
545545
workflow {
546-
def fasta = Channel.fromPath( "/some/path/*.fa" ).buffer(size: 3)
546+
def fasta = channel.fromPath( "/some/path/*.fa" ).buffer(size: 3)
547547
blastThemAll(fasta)
548548
}
549549
```
@@ -609,7 +609,7 @@ process printEnv {
609609
}
610610
611611
workflow {
612-
Channel.of('hello', 'hola', 'bonjour', 'ciao') | printEnv
612+
channel.of('hello', 'hola', 'bonjour', 'ciao') | printEnv
613613
}
614614
```
615615

@@ -636,7 +636,7 @@ process printAll {
636636
}
637637
638638
workflow {
639-
Channel.of('hello', 'hola', 'bonjour', 'ciao')
639+
channel.of('hello', 'hola', 'bonjour', 'ciao')
640640
| map { v -> v + '\n' }
641641
| printAll
642642
}
@@ -670,7 +670,7 @@ process tupleExample {
670670
}
671671
672672
workflow {
673-
Channel.of( [1, 'alpha.txt'], [2, 'beta.txt'], [3, 'delta.txt'] ) | tupleExample
673+
channel.of( [1, 'alpha.txt'], [2, 'beta.txt'], [3, 'delta.txt'] ) | tupleExample
674674
}
675675
```
676676

@@ -695,7 +695,7 @@ process alignSequences {
695695
}
696696
697697
workflow {
698-
sequences = Channel.fromPath('*.fa')
698+
sequences = channel.fromPath('*.fa')
699699
methods = ['regular', 'espresso', 'psicoffee']
700700
701701
alignSequences(sequences, methods)
@@ -720,7 +720,7 @@ process alignSequences {
720720
}
721721
722722
workflow {
723-
sequences = Channel.fromPath('*.fa')
723+
sequences = channel.fromPath('*.fa')
724724
methods = ['regular', 'espresso']
725725
libraries = [ file('PQ001.lib'), file('PQ002.lib'), file('PQ003.lib') ]
726726
@@ -763,8 +763,8 @@ process foo {
763763
}
764764
765765
workflow {
766-
x = Channel.of(1, 2)
767-
y = Channel.of('a', 'b', 'c')
766+
x = channel.of(1, 2)
767+
y = channel.of('a', 'b', 'c')
768768
foo(x, y)
769769
}
770770
```
@@ -776,7 +776,7 @@ The process `foo` is executed two times because the `x` channel emits only two v
776776
2 and b
777777
```
778778

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.
780780

781781
To better understand this behavior, compare the previous example with the following one:
782782

@@ -793,8 +793,8 @@ process bar {
793793
}
794794
795795
workflow {
796-
x = Channel.value(1)
797-
y = Channel.of('a', 'b', 'c')
796+
x = channel.value(1)
797+
y = channel.of('a', 'b', 'c')
798798
foo(x, y)
799799
}
800800
```
@@ -887,7 +887,7 @@ process foo {
887887
}
888888
889889
workflow {
890-
ch_dummy = Channel.fromPath('*').first()
890+
ch_dummy = channel.fromPath('*').first()
891891
(ch_var, ch_str, ch_exp) = foo(ch_dummy)
892892
893893
ch_var.view { var -> "ch_var: $var" }
@@ -1074,8 +1074,8 @@ process blast {
10741074
}
10751075
10761076
workflow {
1077-
ch_species = Channel.of('human', 'cow', 'horse')
1078-
ch_query = Channel.fromPath('*.fa')
1077+
ch_species = channel.of('human', 'cow', 'horse')
1078+
ch_query = channel.fromPath('*.fa')
10791079
10801080
blast(ch_species, ch_query)
10811081
}

docs/reference/channel.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ Available retry policy properties:
362362
| `maxAttempts` | Max attempts when retrying failed SRA requests. | `3` |
363363
| `maxDelay` | Max delay when retrying failed SRA requests. | `30s` |
364364

365-
The following code snippet shows an example for using the `Channel.fromSRA` factory method with a custom `retryPolicy`.
365+
The following code snippet shows an example for using the `channel.fromSRA` factory method with a custom `retryPolicy`.
366366

367367
```nextflow
368368
channel.fromSRA(ids, retryPolicy: [delay: '250ms', maxAttempts: 5])
@@ -375,16 +375,16 @@ The following code snippet shows an example for using the `Channel.fromSRA` fact
375375
The `interval` method emits an incrementing index (starting from zero) at a periodic interval. For example:
376376

377377
```nextflow
378-
Channel.interval('1s').view()
378+
channel.interval('1s').view()
379379
```
380380

381381
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.
382382

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:
384384

385385
```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
388388
}
389389
ch.view()
390390
```
@@ -444,7 +444,7 @@ See also: [channel.fromList](#fromlist) factory method.
444444
:::
445445

446446
:::{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.
448448
:::
449449

450450
A *topic channel* is a queue channel that can receive values from many source channels *implicitly* based on a matching *topic name*.

docs/reference/cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ process sayHello {
13761376
}
13771377

13781378
workflow {
1379-
Channel.of('Bonjour', 'Ciao', 'Hello', 'Hola') | sayHello | view
1379+
channel.of('Bonjour', 'Ciao', 'Hello', 'Hola') | sayHello | view
13801380
}
13811381
```
13821382

@@ -1416,6 +1416,6 @@ process sayHello {
14161416
}
14171417

14181418
workflow {
1419-
Channel.of('Bonjour', 'Ciao', 'Hello', 'Hola') | sayHello | view
1419+
channel.of('Bonjour', 'Ciao', 'Hello', 'Hola') | sayHello | view
14201420
}
14211421
```

docs/reference/feature-flags.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,7 @@ Feature flags are used to introduce experimental or other opt-in features. They
6161
`nextflow.preview.topic`
6262
: :::{versionadded} 23.11.0-edge
6363
:::
64-
: *Experimental: may change in a future release.*
64+
: :::{versionchanged} 25.04.0
65+
This feature flag is no longer required to use topic channels.
66+
:::
6567
: When `true`, enables {ref}`topic channels <channel-topic>` feature.

docs/reference/operator.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,13 +1041,13 @@ By default, the first item is used as the initial accumulated value. You can opt
10411041
The `set` operator assigns a source channel to a variable, whose name is specified as a closure parameter:
10421042

10431043
```nextflow
1044-
Channel.of(10, 20, 30).set { my_channel }
1044+
channel.of(10, 20, 30).set { my_channel }
10451045
```
10461046

10471047
Using `set` is semantically equivalent to assigning a variable:
10481048

10491049
```nextflow
1050-
my_channel = Channel.of(10, 20, 30)
1050+
my_channel = channel.of(10, 20, 30)
10511051
```
10521052

10531053
See also: [tap](#tap)
@@ -1236,7 +1236,7 @@ Channel
12361236
```
12371237

12381238
:::{note}
1239-
`Channel.fromFilePairs()` requires the `flat: true` option in order to emit the file pairs as separate elements in the produced tuples.
1239+
`channel.fromFilePairs()` requires the `flat: true` option in order to emit the file pairs as separate elements in the produced tuples.
12401240
:::
12411241

12421242
:::{note}

docs/reference/process.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,7 @@ process foo {
16241624
}
16251625
16261626
workflow {
1627-
Channel.of('alpha', 'gamma', 'omega') | foo
1627+
channel.of('alpha', 'gamma', 'omega') | foo
16281628
}
16291629
```
16301630

docs/reference/stdlib-namespaces.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The global namespace contains globally available constants and functions.
7979
`type: String`
8080
: Type of paths returned, can be `'file'`, `'dir'` or `'any'` (default: `'file'`)
8181

82-
: See also: {ref}`Channel.fromPath <channel-path>`.
82+
: See also: {ref}`channel.fromPath <channel-path>`.
8383

8484
`files( filePattern: String, [options] ) -> List<Path>`
8585
: Get a collection of files from a file name or glob pattern. Supports the same options as `file()`.

0 commit comments

Comments
 (0)