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/migrations/25-10.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,8 +138,14 @@ def x_opt: String? = null
138
138
139
139
In the type system, queue channels are represented as `Channel`, while value channels are represented as `Value`. To make the terminology clearer and more concise, queue channels are now called *dataflow channels* (or simply *channels*), and value channels are now called *dataflow values*. See {ref}`dataflow-page` for more information.
140
140
141
-
:::{note}
142
-
Nextflow supports Groovy-style type annotations using the `<type> <name>` syntax, but this approach is deprecated in {ref}`strict syntax <strict-syntax-page>`. While Groovy-style annotations remain valid for functions and local variables, the language server and `nextflow lint` automatically convert them to Nextflow-style annotations during code formatting.
141
+
Groovy-style type annotations (e.g., `String x`) are still supported for functions and local variables. However, the language server and `nextflow lint` will automatically convert them to Nextflow-style annotations during code formatting.
142
+
143
+
:::{warning}
144
+
Since Nextflow-style type annotations are new in Nextflow 25.10, formatting code with Groovy-style type annotations will make it incompatible with previous versions of Nextflow. If you need your code to remain compatible with versions prior to 25.10, run the formatter with Nextflow 25.04:
Copy file name to clipboardExpand all lines: docs/process.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -678,6 +678,8 @@ In the above example, the `tuple` input consists of the value `x` and the file `
678
678
679
679
A `tuple` definition may contain any of the following qualifiers, as previously described: `val`, `env`, `path` and `stdin`. Files specified with the `path` qualifier are treated exactly the same as standalone `path` inputs.
680
680
681
+
(process-input-each)=
682
+
681
683
### Input repeaters (`each`)
682
684
683
685
The `each` qualifier allows you to repeat the execution of a process for each item in a collection, each time a new value is received. For example:
@@ -735,7 +737,7 @@ When multiple repeaters are defined, the process is executed for each *combinati
735
737
:::
736
738
737
739
:::{note}
738
-
Input repeaters do not support tuples. Use the {ref}`operator-combine`or {ref}`operator-cross`operator to combine the repeated input with the other inputs to produce all of the desired input combinations.
740
+
Input repeaters do not support tuples. Use the {ref}`operator-combine` operator to combine the repeated input with the other inputs to produce all of the desired input combinations.
Copy file name to clipboardExpand all lines: docs/reference/cli.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -942,6 +942,14 @@ Lint and format all files in the current directory (and subdirectories) and use
942
942
$ nextflow lint -format -spaces 2 .
943
943
```
944
944
945
+
:::{note}
946
+
Formatting code with the `lint` command in Nextflow 25.10 or later may make your code incompatible with previous versions of Nextflow. If you need your code to remain compatible with versions prior to 25.10, run the formatter with Nextflow 25.04:
Copy file name to clipboardExpand all lines: docs/reference/operator.md
+57-29Lines changed: 57 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,6 @@
6
6
7
7
## branch
8
8
9
-
:::{versionadded} 19.08.0-edge
10
-
:::
11
-
12
9
*Returns: multiple channels*
13
10
14
11
The `branch` operator forwards each item from a source channel to one of multiple output channels, based on a selection criteria.
@@ -63,6 +60,10 @@ The `branchCriteria()` method can be used to create a branch criteria as a varia
63
60
64
61
## buffer
65
62
63
+
:::{warning}
64
+
This operator depends on the ordering of values in the source channel. It can lead to {ref}`non-deterministic behavior <cache-nondeterministic-inputs>` if used improperly.
65
+
:::
66
+
66
67
*Returns: channel*
67
68
68
69
The `buffer` operator collects items from a source channel into subsets and emits each subset separately.
@@ -133,6 +134,10 @@ See also: [collate](#collate)
133
134
134
135
## collate
135
136
137
+
:::{warning}
138
+
This operator depends on the ordering of values in the source channel. It can lead to {ref}`non-deterministic behavior <cache-nondeterministic-inputs>` if used improperly.
139
+
:::
140
+
136
141
*Returns: channel*
137
142
138
143
The `collate` operator collects items from a source channel into groups of *N* items.
@@ -360,7 +365,9 @@ For example:
360
365
:language: console
361
366
```
362
367
363
-
See also: [mix](#mix)
368
+
:::{tip}
369
+
As a best practice, use [`mix`](#mix) instead of `concat`. The `mix` operator does not wait for each source channel to emit all values before processing the next one.
370
+
:::
364
371
365
372
(operator-count)=
366
373
@@ -473,6 +480,10 @@ See also: [combine](#combine)
473
480
474
481
## distinct
475
482
483
+
:::{warning}
484
+
This operator depends on the ordering of values in the source channel. It can lead to {ref}`non-deterministic behavior <cache-nondeterministic-inputs>` if used improperly.
485
+
:::
486
+
476
487
*Returns: channel*
477
488
478
489
The `distinct` operator forwards a source channel with *consecutively* repeated items removed, such that each emitted item is different from the preceding one:
@@ -565,6 +576,10 @@ The following example filters a channel using a boolean predicate, which is a {r
565
576
566
577
## first
567
578
579
+
:::{warning}
580
+
This operator depends on the ordering of values in the source channel. It can lead to {ref}`non-deterministic behavior <cache-nondeterministic-inputs>` if used improperly.
581
+
:::
582
+
568
583
*Returns: dataflow value*
569
584
570
585
The `first` operator emits the first item in a source channel, or the first item that matches a condition. The condition can be a {ref}`regular expression<script-regexp>`, a type qualifier (i.e. Java class), or a boolean predicate. For example:
@@ -619,7 +634,9 @@ The `flatten` operator flattens each item from a source channel that is a list o
619
634
620
635
As shown in the above example, deeply nested collections are also flattened.
621
636
622
-
See also: [flatMap](#flatmap)
637
+
:::{tip}
638
+
As a best practice, use [`flatMap`](#flatmap) instead of `flatten`. The `flatMap` operator only flattens one level and has a well-defined return type.
639
+
:::
623
640
624
641
(operator-grouptuple)=
625
642
@@ -629,7 +646,7 @@ See also: [flatMap](#flatmap)
629
646
630
647
The `groupTuple` operator collects lists (i.e. *tuples*) from a source channel into groups based on a grouping key. A new tuple is emitted for each distinct key.
631
648
632
-
To be more precise, the operator transforms a sequence of tuples like *(K, V, W, ..)* into a sequence of tuples like *(K, list(V), list(W), ..)*.
649
+
To be more precise, the operator transforms a sequence of tuples like *(K, V1, V2, ..)* into a sequence of tuples like *(K, list(V1), list(V2), ..)*.
633
650
634
651
For example:
635
652
@@ -673,13 +690,10 @@ Available options:
673
690
: The required number of items for each group. When a group reaches the required size, it is emitted.
674
691
675
692
`sort`
676
-
: Defines the sorting criteria for the grouped items. Can be one of the following values:
677
-
678
-
-`false`: No sorting is applied (default).
679
-
-`true`: Order the grouped items by the item's natural ordering i.e. numerical for number, lexicographic for string, etc. See the [Java documentation](http://docs.oracle.com/javase/tutorial/collections/interfaces/order.html) for more information.
680
-
-`'hash'`: Order the grouped items by the hash number associated to each entry.
681
-
-`'deep'`: Similar to the previous, but the hash number is created on actual entries content e.g. when the item is a file, the hash is created on the actual file content.
682
-
- A custom sorting criteria used to order the nested list elements of each tuple. It can be a {ref}`Closure <script-closure>` or a [Comparator](http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html) object.
693
+
: Defines the sorting criteria for the grouped items.
694
+
: :::{warning}
695
+
The `sort` option is discouraged because it can lead to inconsistent sorting when there are multiple groups. Perform sorting separately (e.g., in a subsequent `map` operation) to ensure correct results.
696
+
:::
683
697
684
698
(operator-ifempty)=
685
699
@@ -717,7 +731,7 @@ See also: {ref}`channel-empty` channel factory
717
731
718
732
The `join` operator emits the inner product of two source channels using a matching key.
719
733
720
-
To be more precise, the operator transforms a sequence of tuples like *(K, V1, V2, ..)* and *(K, W1, W1, ..)* into a sequence of tuples like *(K, V1, V2, .., W1, W2, ..)*.
734
+
To be more precise, the operator transforms a sequence of tuples like *(K, V1, V2, ..)* and *(K, W1, W2, ..)* into a sequence of tuples like *(K, V1, V2, .., W1, W2, ..)*.
721
735
722
736
For example:
723
737
@@ -765,6 +779,10 @@ See also: [combine](#combine), [cross](#cross)
765
779
766
780
## last
767
781
782
+
:::{warning}
783
+
This operator depends on the ordering of values in the source channel. It can lead to {ref}`non-deterministic behavior <cache-nondeterministic-inputs>` if used improperly.
784
+
:::
785
+
768
786
*Returns: dataflow value*
769
787
770
788
The `last` operator emits the last item from a source channel:
@@ -837,6 +855,12 @@ The following examples show how to find the longest string in a channel:
837
855
838
856
## merge
839
857
858
+
:::{warning}
859
+
This operator depends on the ordering of values in the source channel. It can lead to {ref}`non-deterministic behavior <cache-nondeterministic-inputs>` if used improperly.
860
+
861
+
Use [combine](#combine) or [join](#join) instead to combine multiple channels in a deterministic way, such as a matching key.
862
+
:::
863
+
840
864
*Returns: channel*
841
865
842
866
The `merge` operator joins the items from two or more channels into a new channel:
@@ -865,12 +889,6 @@ The `merge` operator may return a channel or value depending on the inputs:
865
889
866
890
- If the first argument is a dataflow value, the `merge` operator returns a dataflow value, merging the first value from each input, regardless of whether there are channel inputs with additional values.
867
891
868
-
:::{danger}
869
-
In general, the use of the `merge` operator is discouraged. Processes and channel operators are not guaranteed to emit items in the order that they were received, as they are executed concurrently. Therefore, if you try to merge output channels from different processes, the resulting channel may be different on each run, which will cause resumed runs to {ref}`not work properly <cache-nondeterministic-inputs>`.
870
-
871
-
You should always use a matching key (e.g. sample ID) to merge multiple channels, so that they are combined in a deterministic way. For this purpose, you can use the [join](#join) operator.
872
-
:::
873
-
874
892
(operator-min)=
875
893
876
894
## min
@@ -940,9 +958,6 @@ See also: [concat](#concat)
940
958
941
959
## multiMap
942
960
943
-
:::{versionadded} 19.11.0-edge
944
-
:::
945
-
946
961
*Returns: multiple channels*
947
962
948
963
The `multiMap` operator applies a set of mapping functions to a source channel, producing a separate output channel for each mapping function.
@@ -985,6 +1000,10 @@ If you use `multiMap` to split a tuple or map into multiple channels, it is reco
985
1000
986
1001
## randomSample
987
1002
1003
+
:::{warning}
1004
+
This operator depends on the ordering of values in the source channel. It can lead to {ref}`non-deterministic behavior <cache-nondeterministic-inputs>` if used improperly.
1005
+
:::
1006
+
988
1007
*Returns: channel*
989
1008
990
1009
The `randomSample` operator emits a randomly-selected subset of items from a source channel:
@@ -1049,6 +1068,10 @@ Using `set` is semantically equivalent to assigning a variable:
1049
1068
my_channel = channel.of(10, 20, 30)
1050
1069
```
1051
1070
1071
+
:::{tip}
1072
+
As a best practice, use a standard assignment (`=`) instead of `set`. Standard assignments enable more effective {ref}`type checking <preparing-static-types>`.
1073
+
:::
1074
+
1052
1075
See also: [tap](#tap)
1053
1076
1054
1077
(operator-splitcsv)=
@@ -1102,9 +1125,6 @@ Available options:
1102
1125
`decompress`
1103
1126
: When `true`, decompress the content using the GZIP format before processing it (default: `false`). Files with the `.gz` extension are decompressed automatically.
1104
1127
1105
-
`elem`
1106
-
: The index of the element to split when the source items are lists or tuples (default: first file object or first element).
1107
-
1108
1128
`header`
1109
1129
: When `true`, the first line is used as the columns names (default: `false`). Can also be a list of columns names.
1110
1130
@@ -1459,6 +1479,10 @@ An optional {ref}`closure <script-closure>` can be used to transform each item b
1459
1479
1460
1480
## take
1461
1481
1482
+
:::{warning}
1483
+
This operator depends on the ordering of values in the source channel. It can lead to {ref}`non-deterministic behavior <cache-nondeterministic-inputs>` if used improperly.
1484
+
:::
1485
+
1462
1486
*Returns: channel*
1463
1487
1464
1488
The `take` operator takes the first *N* items from a source channel:
@@ -1491,7 +1515,9 @@ The `tap` operator assigns a source channel to a variable, and emits the source
1491
1515
:language: console
1492
1516
```
1493
1517
1494
-
See also: [set](#set)
1518
+
:::{tip}
1519
+
As a best practice, use a standard assignment (`=`) instead of `tap`. Standard assignments enable more effective {ref}`type checking <preparing-static-types>`.
1520
+
:::
1495
1521
1496
1522
## toInteger
1497
1523
@@ -1588,7 +1614,7 @@ See also: [collect](#collect)
1588
1614
1589
1615
The `transpose` operator "transposes" each tuple from a source channel by flattening any nested list in each tuple, emitting each nested item separately.
1590
1616
1591
-
To be more precise, the operator transforms a sequence of tuples like *(K, list(V), list(W), ..)* into a sequence of tuples like *(K, V, W, ..)*.
1617
+
To be more precise, the operator transforms a sequence of tuples like *(K, list(V1), list(V2), ..)* into a sequence of tuples like *(K, V1, V2, ..)*.
1592
1618
1593
1619
For example:
1594
1620
@@ -1628,7 +1654,9 @@ Available options:
1628
1654
`remainder`
1629
1655
: When `true`, incomplete tuples are emitted with `null` values for missing elements, otherwise they are discarded (default: `false`).
1630
1656
1631
-
See also: [groupTuple](#grouptuple)
1657
+
:::{tip}
1658
+
As a best practice, use [`flatMap`](#flatmap) instead of `transpose`, since `flatMap` has a well-defined return type.
0 commit comments