diff --git a/docs/channel.rst b/docs/channel.rst index f561703830..447e421398 100644 --- a/docs/channel.rst +++ b/docs/channel.rst @@ -88,19 +88,6 @@ Channels may be created explicitly using the following channel factory methods. methods can be specified either as ``channel.of()`` or ``Channel.of()``, and so on. -.. _channel-create: - -create ------- - -.. warning:: - The ``create`` method is no longer available in DSL2 syntax. - -Creates a new channel, as shown below:: - - channelObj = Channel.create() - - .. _channel-empty: empty @@ -476,36 +463,6 @@ See also: `fromPath`_ factory method. Channel methods =============== -.. _channel-bind1: - -bind ----- - -.. warning:: - The ``bind`` method is no longer available in DSL2 syntax. - -Channel objects provide a `bind( )` method which is the basic operation to send a message over the channel. -For example:: - - myChannel = Channel.create() - myChannel.bind( 'Hello world' ) - - -.. _channel-bind2: - -operator << ------------ - -.. warning:: - The ``<<`` operator is no longer available in DSL2 syntax. - -The operator ``<<`` is just a syntax sugar for the ``bind`` method. Thus, the following example produces -an identical result as the previous one:: - - myChannel = Channel.create() - myChannel << 'Hello world' - - .. _channel-subscribe: subscribe diff --git a/docs/operator.rst b/docs/operator.rst index 321ce469d3..a2a0e31a6d 100644 --- a/docs/operator.rst +++ b/docs/operator.rst @@ -183,48 +183,6 @@ the source channel into subsets: See also: `collate`_ operator. - -.. _operator-choice: - -choice ------- - -.. warning:: - This operator is deprecated. Use `branch`_ instead. - -The ``choice`` operator allows you to forward the items emitted by a source channel to two -(or more) output channels, `choosing` one out of them at a time. - -The destination channel is selected by using a :ref:`closure ` that must return the `index` number of the channel -where the item has to be sent. The first channel is identified by the index ``0``, the second as ``1`` and so on. - -The following example sends all string items beginning with ``Hello`` into ``queue1``, -the others into ``queue2`` - -:: - - source = Channel.from 'Hello world', 'Hola', 'Hello John' - queue1 = Channel.create() - queue2 = Channel.create() - - source.choice( queue1, queue2 ) { a -> a =~ /^Hello.*/ ? 0 : 1 } - - queue1.view() - -See also `branch`_ operator. - - -.. _operator-close: - -close ------ - -The ``close`` operator sends a termination signal over the channel, causing downstream processes or operators to stop. -In a common usage scenario channels are closed automatically by Nextflow, so you won't need to use this operator explicitly. - -See also: :ref:`channel-empty` factory method. - - collate ------- @@ -468,7 +426,7 @@ For example:: [B, 2, x] [B, 2, y] -See also `join`_, `cross`_, `spread`_ and `phase`_. +See also `join`_. .. _operator-concat: @@ -539,76 +497,6 @@ a literal value, a Java class, or a `boolean predicate` that needs to be satisfi // -> 4 -.. _operator-countby: - -countBy -------- - -The ``countBy`` operator creates a channel which emits an associative array (i.e. ``Map`` object) -that counts the occurrences of the emitted items in the source channel having the same key. -For example:: - - Channel - .of( 'x', 'y', 'x', 'x', 'z', 'y' ) - .countBy() - .view() - -:: - - [x:3, y:2, z:1] - -An optional grouping criteria can be specified by using a :ref:`closure ` -that associates each item with the grouping key. For example:: - - Channel - .of( 'hola', 'hello', 'ciao', 'bonjour', 'halo' ) - .countBy { it[0] } - .view() - -:: - - [h:3, c:1, b:1] - - -.. _operator-cross: - -cross ------ - -The ``cross`` operator allows you to combine the items of two channels in such a way that -the items of the source channel are emitted along with the items emitted by the target channel -for which they have a matching key. - -The key is defined, by default, as the first entry in an array, a list or map object, -or the value itself for any other data type. For example:: - - source = Channel.of( [1, 'alpha'], [2, 'beta'] ) - target = Channel.of( [1, 'x'], [1, 'y'], [1, 'z'], [2,'p'], [2,'q'], [2,'t'] ) - - source.cross(target).view() - -It will output:: - - [ [1, alpha], [1, x] ] - [ [1, alpha], [1, y] ] - [ [1, alpha], [1, z] ] - [ [2, beta], [2, p] ] - [ [2, beta], [2, q] ] - [ [2, beta], [2, t] ] - -The above example shows how the items emitted by the source channels are associated to the ones -emitted by the target channel (on the right) having the same key. - -There are two important caveats when using the ``cross`` operator: - - #. The operator is not `commutative`, i.e. the result of ``a.cross(b)`` is different from ``b.cross(a)`` - #. The source channel should emits items for which there's no key repetition i.e. the emitted - items have an unique key identifier. - -Optionally, a mapping function can be specified in order to provide a custom rule to associate an item to a key, -in a similar manner as shown for the `phase`_ operator. - - distinct -------- @@ -1000,49 +888,7 @@ will be emitted when the empty condition is satisfied. See also: :ref:`channel-empty` method. -.. _operator-into: - -into ----- - -.. warning:: - The ``into`` operator is no longer available in DSL2 syntax. - -The ``into`` operator connects a source channel to two or more target channels in such a way the values emitted by -the source channel are copied to the target channels. For example:: - - Channel - .of( 'a', 'b', 'c' ) - .into{ foo; bar } - - foo.view{ "Foo emit: " + it } - bar.view{ "Bar emit: " + it } - -:: - - Foo emit: a - Foo emit: b - Foo emit: c - Bar emit: a - Bar emit: b - Bar emit: c - -.. note:: Note the use in this example of curly brackets and the ``;`` as channel names separator. This is needed - because the actual parameter of ``into`` is a :ref:`closure ` which defines the target channels - to which the source channel is connected. - -A second version of the ``into`` operator takes an integer `n` as an argument and returns -a list of `n` channels, each of which emits a copy of the items that were emitted by the -source channel. For example:: - - (foo, bar) = Channel.from( 'a','b','c').into(2) - foo.view{ "Foo emit: " + it } - bar.view{ "Bar emit: " + it } - -.. note:: The above example takes advantage of the :ref:`multiple assignment ` syntax - in order to assign two variables at once using the list of channels returned by the ``into`` operator. - -See also `tap`_ and `separate`_ operators. +See also `tap`_. .. _operator-join: @@ -1361,124 +1207,7 @@ that can be passed as an argument to one or more ``multiMap`` operations, as sho due to the parallel and asynchronous nature of Nextflow pipelines. -.. _operator-phase: - -phase ------ - -.. warning:: - This operator is deprecated. Use the `join`_ operator instead. - -The ``phase`` operator creates a channel that synchronizes the values emitted by two other channels, -in such a way that it emits pairs of items that have a matching key. - -The key is defined, by default, as the first entry in an array, a list or map object, -or the value itself for any other data type. - -For example:: - - ch1 = Channel.from( 1,2,3 ) - ch2 = Channel.from( 1,0,0,2,7,8,9,3 ) - ch1 .phase(ch2) .view() - -It prints:: - - [1,1] - [2,2] - [3,3] - -Optionally, a mapping function can be specified in order to provide a custom rule to associate an item to a key, -as shown in the following example:: - - ch1 = Channel.from( [sequence: 'aaaaaa', id: 1], [sequence: 'bbbbbb', id: 2] ) - ch2 = Channel.from( [val: 'zzzz', id: 3], [val: 'xxxxx', id: 1], [val: 'yyyyy', id: 2]) - ch1 .phase(ch2) { it -> it.id } .view() - -It prints:: - - [[sequence:aaaaaa, id:1], [val:xxxxx, id:1]] - [[sequence:bbbbbb, id:2], [val:yyyyy, id:2]] - -Finally, the ``phase`` operator can emit all the pairs that are incomplete, i.e. the items for which a matching element -is missing, by specifying the optional parameter ``remainder`` as shown below:: - - ch1 = Channel.from( 1,0,0,2,5,3 ) - ch2 = Channel.from( 1,2,3,4 ) - ch1 .phase(ch2, remainder: true) .view() - -It prints:: - - [1, 1] - [2, 2] - [3, 3] - [0, null] - [0, null] - [5, null] - [null, 4] - -See also `join`_ operator. - - -.. _operator-print: - -print ------ - -.. warning:: - The ``print`` operator is no longer available in DSL2 syntax. Use `view`_ instead. - -The ``print`` operator prints the items emitted by a channel to the standard output. -An optional :ref:`closure ` parameter can be specified to customise how items are printed. -For example:: - - Channel - .from('foo', 'bar', 'baz', 'qux') - .print { it.toUpperCase() + ' ' } - -It prints:: - - FOO BAR BAZ QUX - -See also: `println`_ and `view`_. - - -.. _operator-println: - -println -------- - -.. warning:: - The ``println`` operator is no longer available in DSL2 syntax. Use `view`_ instead. - -The ``println`` operator prints the items emitted by a channel to the console standard output appending -a *new line* character to each of them. For example:: - - Channel - .from('foo', 'bar', 'baz', 'qux') - .println() - -It prints:: - - foo - bar - baz - qux - -An optional closure parameter can be specified to customise how items are printed. For example:: - - Channel - .of('foo', 'bar', 'baz', 'qux') - .view { "~ $it" } - -It prints:: - - ~ foo - ~ bar - ~ baz - ~ qux - -See also: `print`_ and `view`_. - +.. _operator-randomsample: randomSample ------------ @@ -1538,95 +1267,6 @@ Optionally you can specify an initial value for the accumulator as shown below:: myChannel.reduce( initialValue ) { a, b -> ... } -.. _operator-separate: - -separate --------- - -.. warning:: - This operator is deprecated. Use `multiMap`_ instead. - -The ``separate`` operator lets you copy the items emitted by the source channel into multiple -channels, which each of these can receive a `separate` version of the same item. - -The operator applies a `mapping function` of your choosing to every item emitted by the source channel. -This function must return a list of as many values as there are output channels. Each entry in the result -list will be assigned to the output channel with the corresponding position index. For example:: - - queue1 = Channel.create() - queue2 = Channel.create() - - Channel - .from ( 2,4,8 ) - .separate( queue1, queue2 ) { a -> [a+1, a*a] } - - queue1.view { "Channel 1: $it" } - queue2.view { "Channel 2: $it" } - -:: - - Channel 1: 3 - Channel 2: 4 - Channel 1: 5 - Channel 2: 16 - Channel 2: 64 - Channel 1: 9 - -When the `mapping function` is omitted, the source channel must emit tuples of values. In this case the operator ``separate`` -splits the tuple in such a way that the value `i-th` in a tuple is assigned to the target channel with the corresponding position index. -For example:: - - alpha = Channel.create() - delta = Channel.create() - - Channel - .from([1,2], ['a','b'], ['p','q']) - .separate( alpha, delta ) - - alpha.view { "first : $it" } - delta.view { "second: $it" } - -It will output:: - - first : 1 - first : a - first : p - second: 2 - second: b - second: q - -A second version of the ``separate`` operator takes an integer `n` as an argument and returns a list of `n` channels, -each of which gets a value from the corresponding element in the list returned by the closure as explained above. -For example:: - - source = Channel.from(1,2,3) - (queue1, queue2, queue3) = source.separate(3) { a -> [a, a+1, a*a] } - - queue1.view { "Queue 1 > $it" } - queue2.view { "Queue 2 > $it" } - queue3.view { "Queue 3 > $it" } - -The output will look like the following fragment:: - - Queue 1 > 1 - Queue 1 > 2 - Queue 1 > 3 - Queue 2 > 2 - Queue 2 > 3 - Queue 2 > 4 - Queue 3 > 1 - Queue 3 > 4 - Queue 3 > 9 - -.. note:: In the above example, since the ``subscribe`` operator is asynchronous, - the output of ``channel1``, ``channel2``, and ``channel3`` may be printed in any order. - -.. note:: The above example takes advantage of the :ref:`multiple assignment ` syntax - in order to assign two variables at once using the list of channels returned by the ``separate`` operator. - -See also: `multiMap`_, `into`_, `choice`_ and `map`_ operators. - - .. _operator-set: set @@ -1909,33 +1549,6 @@ keepHeader Parses the first line as header and prepends it to each emitted chun You can also use ``countLines`` to count the number of lines in the text file(s). -.. _operator-spread: - -spread ------- - -.. warning:: - This operator is deprecated. Use `combine`_ instead. - -The ``spread`` operator combines the items emitted by the source channel with all the values in an array -or a ``Collection`` object specified as the operator argument. For example:: - - Channel - .from(1,2,3) - .spread(['a','b']) - .subscribe onNext: { println it }, onComplete: { println 'Done' } - -:: - - [1, 'a'] - [1, 'b'] - [2, 'a'] - [2, 'b'] - [3, 'a'] - [3, 'b'] - Done - - .. _operator-sum: sum @@ -2042,8 +1655,6 @@ Using the closure syntax the above example can be rewritten as shown below:: log1.view { "Log 1: $it" } log2.view { "Log 2: $it" } -See also `into`_ and `separate`_ operators. - toInteger --------- diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/ChoiceOp.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/ChoiceOp.groovy deleted file mode 100644 index 1f2bf595c3..0000000000 --- a/modules/nextflow/src/main/groovy/nextflow/extension/ChoiceOp.groovy +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2020-2022, Seqera Labs - * Copyright 2013-2019, Centre for Genomic Regulation (CRG) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package nextflow.extension -import groovy.transform.CompileStatic -import groovy.util.logging.Slf4j -import groovyx.gpars.dataflow.DataflowReadChannel -import groovyx.gpars.dataflow.DataflowWriteChannel -import groovyx.gpars.dataflow.expression.DataflowExpression -import groovyx.gpars.dataflow.operator.ChoiceClosure -import groovyx.gpars.dataflow.operator.DataflowEventAdapter -import groovyx.gpars.dataflow.operator.DataflowProcessor -import nextflow.Channel -import nextflow.Global -import nextflow.Session -/** - * Implements the logic for {@link OperatorImpl#choice} operator(s) - * - * @author Paolo Di Tommaso - */ -@Slf4j -@CompileStatic -class ChoiceOp { - - /** - * The operator source channel "normalised" in a list object. - * It must contain exactly *one* DataflowReadChannel instance - */ - private List source - - /** - * The list of output channels resulting from the choice operation - */ - private List outputs - - /** - * A closure implementing the *choice* strategy. It returns the index of the - * selected channel given the actual item emitted by the source channel - */ - private Closure code - - /** - * {@code true} when the `choice` is applied to a {@link groovyx.gpars.dataflow.DataflowVariable} - */ - private boolean stopOnFirst - - /** - * The current nextflow {@link Session} object - */ - private Session session = (Session)Global.session - - /** - * Creates the choice operator - * - * @param source The source channel either a {@link groovyx.gpars.dataflow.DataflowQueue} or a {@link groovyx.gpars.dataflow.DataflowVariable} - * @param outputs The list of output channels - * @param code The closure implementing the *choice* strategy. See {@link #code} - */ - ChoiceOp(DataflowReadChannel source, List outputs, Closure code) { - assert source - assert outputs - this.source = [source] - this.outputs = outputs - this.code = code - this.stopOnFirst = source instanceof DataflowExpression - } - - /** - * @return A {@link DataflowEventAdapter} that close properly the output - * channels when required - */ - private createListener() { - - def result = new DataflowEventAdapter() { - @Override - void afterRun(DataflowProcessor processor, List messages) { - if( !stopOnFirst ) return - // -- terminate the process - processor.terminate() - // -- close the output channels - outputs.each { - if( !(it instanceof DataflowExpression)) - it.bind(Channel.STOP) - - else if( !(it as DataflowExpression).isBound() ) - it.bind(Channel.STOP) - } - } - - @Override - boolean onException(final DataflowProcessor processor, final Throwable e) { - log.error("@unknown", e) - session.abort(e) - return true; - } - } - - return [result] - } - - /** - * Applies the choice operator - */ - def apply() { - - def params = [ - inputs: source, - outputs: outputs, - listeners: createListener() - ] - - DataflowHelper.newOperator(params, new ChoiceClosure(code)) - } - - -} diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/OpCall.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/OpCall.groovy index 8b7f9cf41c..11fd5c6dd5 100644 --- a/modules/nextflow/src/main/groovy/nextflow/extension/OpCall.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/extension/OpCall.groovy @@ -24,7 +24,7 @@ import org.codehaus.groovy.runtime.InvokerHelper @CompileStatic class OpCall implements Callable { - final static private List SPECIAL_NAMES = ["choice","merge","separate"] + final static private List SPECIAL_NAMES = ["merge"] final static private String SET_OP_hack = 'set' @@ -144,14 +144,11 @@ class OpCall implements Callable { } private Object[] read1(Object[] args) { - if( methodName != 'separate' && methodName != 'choice' ) { - Object[] params = new Object[args.length] - for( int i=0; i> outputs, final Closure> code) + // OperatorImpl#DataflowWriteChannel merge(final DataflowReadChannel source, final DataflowReadChannel... others) // can be invoked as: - // queue.separate( x, y, z ) { ... } + // queue.merge( x, y, z ) { ... } Object[] params = new Object[3] params[0] = channel diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/OperatorImpl.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/OperatorImpl.groovy index c1602a9569..89656c4d35 100644 --- a/modules/nextflow/src/main/groovy/nextflow/extension/OperatorImpl.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/extension/OperatorImpl.groovy @@ -540,39 +540,6 @@ class OperatorImpl { return target } - - /** - * Groups the items emitted by the source channel into groups determined by the supplied mapping closure and counts the frequency of the created groups - * @param source The source channel - * @return A {@code DataflowVariable} returning the a {@code Map} containing the counting values for each key - */ - @Deprecated - DataflowWriteChannel countBy(final DataflowReadChannel source ) { - countBy(source, { it }) - } - - /** - * Sorts all collection members into groups determined by the supplied mapping closure and counts the group size - * - * @param source - * @param criteria - * @return - */ - @Deprecated - DataflowWriteChannel countBy(final DataflowReadChannel source, final Closure criteria ) { - - final target = new DataflowVariable() - - reduceImpl(source, target, [:]) { Map map, item -> - def key = criteria.call(item) - def value = map.containsKey(key) ? map.get(key)+1 : 1 - map.put(key, value) - return map - } - - return target - } - /** * The min operator waits until the source channel completes, and then emits the value that had the lowest value * @@ -741,100 +708,6 @@ class OperatorImpl { } } - /** - * Sorts all collection members into groups determined by the supplied mapping closure - * - * @param source - * @param mapper - * @return - */ - @Deprecated - DataflowWriteChannel groupBy(final DataflowReadChannel source, final params = null ) { - int index = 0 - Closure mapper = DEFAULT_MAPPING_CLOSURE - - if( params instanceof Closure ) - mapper = params - - else if( params instanceof Number ) { - index = params as int - } - else if( params != null ) { - throw new IllegalArgumentException("Not a valid `group` argument: $params") - } - - final target = new DataflowVariable() - final int len = mapper.getMaximumNumberOfParameters() - reduceImpl(source, target, [:]) { Map map, item -> - def key = len == 2 ? mapper.call(item,index) : mapper.call(item) - def list = map.get(key) - list = list ? list << item : [item] - map.put(key, list) - return map - } - - return target - } - - @Deprecated - DataflowWriteChannel spread( final DataflowReadChannel source, Object other ) { - - final target = CH.create() - - def inputs - switch(other) { - case DataflowExpression: - inputs = other - break - case DataflowReadChannel: - inputs = ToListOp.apply((DataflowReadChannel)other); - break - case Collection: - inputs = Channel.value(other) - OpCall.current.get().inputs.add(inputs) - break - case (Object[]): - inputs = Channel.value(other as List) - OpCall.current.get().inputs.add(inputs) - break - default: - throw new IllegalArgumentException("Not a valid argument for 'spread' operator [${other?.class?.simpleName}]: ${other} -- Use a Collection or a channel instead. ") - } - - final stopOnFirst = source instanceof DataflowExpression - final listener = new DataflowEventAdapter() { - @Override - void afterRun(DataflowProcessor processor, List messages) { - if( !stopOnFirst ) return - processor.terminate() - target.bind(Channel.STOP) - } - - @Override - boolean onException(final DataflowProcessor processor, final Throwable e) { - OperatorImpl.log.error("@unknown", e) - session.abort(e) - return true; - } - } - - final params = [:] - params.inputs = [source, inputs] - params.outputs = [target] - params.listeners = [listener] - - newOperator(params) { a, b -> - def proc = ((DataflowProcessor) getDelegate()) - def left = [a] - def right = (b instanceof List ? b : [b]) - [left, right] - .combinations() - .each{ Collection it -> proc.bindOutput(it.flatten()) } - } - - return target - } - DataflowWriteChannel combine( DataflowReadChannel left, Object right ) { combine(left, null, right) } @@ -1042,36 +915,6 @@ class OperatorImpl { return target } - - /** - * Phase channels - * - * @param source - * @param other - * @param mapper - * @return - */ - @Deprecated - DataflowWriteChannel phase( DataflowReadChannel source, Map opts, DataflowReadChannel other, Closure mapper = null ) { - - def target = new PhaseOp(source,other) - .setMapper(mapper) - .setOpts(opts) - .apply() - - return target - } - - @Deprecated - DataflowWriteChannel phase( DataflowReadChannel source, DataflowReadChannel other, Closure mapper = null ) { - - def target = new PhaseOp(source,other) - .setMapper(mapper) - .apply() - - return target - } - /** * Implements the default mapping strategy, having the following strategy: *
@@ -1122,7 +965,6 @@ class OperatorImpl {
 
     }
 
-
     DataflowWriteChannel cross( DataflowReadChannel source, DataflowReadChannel other, Closure mapper = null ) {
 
         def target = new CrossOp(source, other)
@@ -1151,73 +993,6 @@ class OperatorImpl {
     }
 
 
-    /**
-     * When the items emitted by the source channel are tuples of values, the operator separate allows you to specify a
-     * list of channels as parameters, so that the value i-th in a tuple will be assigned to the target channel
-     * with the corresponding position index.
-     *
-     * @param source The source channel
-     * @param outputs An open array of target channels
-     */
-    @DeprecatedDsl2
-    void separate( DataflowReadChannel source, final DataflowWriteChannel... outputs ) {
-        new SeparateOp(source, outputs as List).apply()
-    }
-
-    @DeprecatedDsl2
-    void separate(final DataflowReadChannel source, final List outputs) {
-        new SeparateOp(source, outputs).apply()
-    }
-
-    @DeprecatedDsl2
-    void separate(final DataflowReadChannel source, final List outputs, final Closure code) {
-        new SeparateOp(source, outputs, code).apply()
-    }
-
-    @DeprecatedDsl2
-    List separate( final DataflowReadChannel source, int n ) {
-        def outputs = new SeparateOp(source, n).apply()
-        return outputs
-    }
-
-    @DeprecatedDsl2
-    List separate( final DataflowReadChannel source, int n, Closure mapper  ) {
-        def outputs = new SeparateOp(source, n, mapper).apply()
-        return outputs
-    }
-
-    @DeprecatedDsl2
-    void into( DataflowReadChannel source, final DataflowWriteChannel... targets ) {
-        new IntoOp(source, targets as List).apply()
-    }
-
-    @DeprecatedDsl2
-    List into( final DataflowReadChannel source, int n ) {
-        def outputs = new IntoOp(source,n).apply().getOutputs()
-        return outputs
-    }
-
-    /**
-     * Forward source dataflow channel *into* one or more dataflow channels. For example:
-     * 
-     *     Channel.from( ... )
-     *            .map { ... }
-     *            .into { foo; bar }
-     * 
- * - * It creates two new dataflow variables named {@code foo} and {@code bar} and copied the map - * result into them. - * - * @param source The source dataflow channel which items are copied into newly created dataflow variables. - * @param holder A closure that defines one or more variable names into which source items are copied. - */ - @DeprecatedDsl2 - void into( DataflowReadChannel source, Closure holder ) { - def outputs = new IntoOp(source,holder).apply().getOutputs() - OpCall.current.get().outputs.addAll(outputs) - } - - /** * Implements a tap that create implicitly a new dataflow variable in the global script context. * For example: @@ -1270,29 +1045,6 @@ class OperatorImpl { return result } - /** - * Print the channel content to the console standard output - * @param source - * @param closure - */ - @DeprecatedDsl2(message='Operator `print` is deprecated -- Use `view` instead') - void print(final DataflowReadChannel source, Closure closure = null) { - final print0 = { def obj = closure ? closure.call(it) : it; session.printConsole(obj?.toString(),false) } - subscribeImpl(source, [onNext: print0]) - } - - /** - * Print the channel content to the console standard output - * @param source - * @param closure - */ - @DeprecatedDsl2(message='Operator `println` is deprecated -- Use `view` instead') - void println(final DataflowReadChannel source, Closure closure = null) { - final print0 = { def obj = closure ? closure.call(it) : it; session.printConsole(obj?.toString(),true) } - subscribeImpl(source, [onNext: print0]) - } - - static private final Map PARAMS_VIEW = [newLine: Boolean] /** @@ -1326,11 +1078,6 @@ class OperatorImpl { view(source, Collections.emptyMap(), closure) } - @Deprecated - void choice(final DataflowReadChannel source, final List outputs, final Closure code) { - new ChoiceOp(source,outputs,code).apply() - } - // NO DAG DataflowWriteChannel merge(final DataflowReadChannel source, final DataflowReadChannel other, final Closure closure=null) { final result = CH.createBy(source) @@ -1428,11 +1175,6 @@ class OperatorImpl { return result } - @Deprecated - DataflowWriteChannel countText(DataflowReadChannel source) { - countLines(source) - } - /** * Implement a `set` operator e.g. *
@@ -1488,9 +1230,4 @@ class OperatorImpl {
                 .getOutput()
     }
 
-    @Deprecated
-    ChannelOut fork(DataflowReadChannel source, Closure action) {
-        log.warn "Operator `fork` has been renamed to `multiMap`"
-        multiMap(source, action)
-    }
 }
diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/SeparateOp.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/SeparateOp.groovy
deleted file mode 100644
index 7a44ec740f..0000000000
--- a/modules/nextflow/src/main/groovy/nextflow/extension/SeparateOp.groovy
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2020-2022, Seqera Labs
- * Copyright 2013-2019, Centre for Genomic Regulation (CRG)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package nextflow.extension
-
-import groovy.transform.CompileDynamic
-import groovy.transform.CompileStatic
-import groovy.util.logging.Slf4j
-import groovyx.gpars.dataflow.DataflowQueue
-import groovyx.gpars.dataflow.DataflowReadChannel
-import groovyx.gpars.dataflow.DataflowWriteChannel
-import groovyx.gpars.dataflow.operator.SeparationClosure
-
-/**
- * Implements the {@link OperatorImpl#separate} operator logic
- *
- * @author Paolo Di Tommaso 
- */
-@Slf4j
-@CompileStatic
-class SeparateOp {
-
-    private DataflowReadChannel source
-
-    private List outputs
-
-    private Closure mapper
-
-    SeparateOp( final DataflowReadChannel source, final List> outputs, final Closure> code = null ) {
-        assert source
-        assert outputs
-
-        this.source = source
-        this.outputs = outputs.collect { (DataflowQueue)it }
-        this.mapper = code
-
-    }
-
-    SeparateOp( final DataflowReadChannel source, final int n, Closure> mapper = null ) {
-        assert source
-        assert n
-
-        this.source = source
-        this.outputs = new ArrayList<>(n)
-        for( int i=0; i> createDefaultMapper(int size) {
-
-        int count = 0
-        Closure> result = { it ->
-            def tuple = it instanceof List ? it : [it]
-            if( tuple.size() == size )
-                return tuple
-
-            else {
-                if( count++ == 0 )
-                    log.warn "The number of target channels ($size) for the 'into' operator does not match the  number of items (${tuple.size()}) of the received tuple: $tuple"
-
-                def result = new ArrayList(size)
-                for( int i=0; i apply() {
-        if( !mapper )
-            mapper = createDefaultMapper(outputs.size())
-
-        DataflowHelper.newOperator( [source], outputs, new SeparationClosure(mapper))
-        return outputs
-    }
-
-
-}
diff --git a/modules/nextflow/src/test/groovy/nextflow/extension/DataflowChoiceExtensionTest.groovy b/modules/nextflow/src/test/groovy/nextflow/extension/DataflowChoiceExtensionTest.groovy
deleted file mode 100644
index b38059832d..0000000000
--- a/modules/nextflow/src/test/groovy/nextflow/extension/DataflowChoiceExtensionTest.groovy
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2020-2022, Seqera Labs
- * Copyright 2013-2019, Centre for Genomic Regulation (CRG)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package nextflow.extension
-import groovyx.gpars.dataflow.DataflowVariable
-import nextflow.Channel
-import nextflow.Session
-import spock.lang.Shared
-import spock.lang.Specification
-import spock.lang.Timeout
-
-/**
- *
- * @author Paolo Di Tommaso 
- */
-class DataflowChoiceExtensionTest extends Specification {
-
-    @Shared
-    Session session
-
-    def setup() {
-        session = new Session()
-    }
-
-    def cleanup() {
-        assert !session.dag.isEmpty()
-    }
-
-
-    @Timeout(1)
-    def 'should choice targets specified with an open array'() {
-
-        given:
-        def source = Channel.from 'Hello world', 'Hola', 'Hello John'
-        def queue1 = Channel.create()
-        def queue2 = Channel.create()
-        def queue3 = Channel.create()
-
-        when:
-        source.choice( queue1, queue2, queue3 ) { a -> a =~ /^Hello.*/ ? 0 : 1 }
-
-        then:
-        queue1.val == 'Hello world'
-        queue1.val == 'Hello John'
-        queue1.val == Channel.STOP
-        queue2.val == 'Hola'
-        queue2.val == Channel.STOP
-        queue3.val == Channel.STOP
-
-    }
-
-    def 'should choice targets specified with a list '() {
-
-        given:
-        def source = Channel.from 'Hello world', 'Hola', 'Hello John'
-        def queue1 = Channel.create()
-        def queue2 = Channel.create()
-
-        when:
-        source.choice( [queue1, queue2] ) { a -> a =~ /^Hello.*/ ? 0 : 1 }
-
-        then:
-        queue1.val == 'Hello world'
-        queue1.val == 'Hello John'
-        queue1.val == Channel.STOP
-        queue2.val == 'Hola'
-        queue2.val == Channel.STOP
-
-    }
-
-
-    @Timeout(1)
-    def 'should choice from a dataflow value channel'() {
-
-        given:
-        def source = Channel.value('Hello world')
-        def queue1 = new DataflowVariable()
-        def queue2 = new DataflowVariable()
-
-        when:
-        source.choice( queue1, queue2 ) { a -> a =~ /^Hello.*/ ? 0 : 1 }
-
-        then:
-        queue1.val == 'Hello world'
-        queue2.val == Channel.STOP
-
-    }
-
-
-}
diff --git a/modules/nextflow/src/test/groovy/nextflow/extension/DataflowIntoExtensionTest.groovy b/modules/nextflow/src/test/groovy/nextflow/extension/DataflowIntoExtensionTest.groovy
deleted file mode 100644
index e8bada1868..0000000000
--- a/modules/nextflow/src/test/groovy/nextflow/extension/DataflowIntoExtensionTest.groovy
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright 2020-2022, Seqera Labs
- * Copyright 2013-2019, Centre for Genomic Regulation (CRG)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package nextflow.extension
-import groovyx.gpars.dataflow.DataflowQueue
-import nextflow.Channel
-import nextflow.Session
-import spock.lang.Shared
-import spock.lang.Specification
-import spock.lang.Timeout
-
-/**
- *
- * @author Paolo Di Tommaso 
- */
-class DataflowIntoExtensionTest extends Specification {
-
-    @Shared
-    Session session
-
-    def setup() {
-        session = new Session()
-    }
-
-    def cleanup() {
-        assert !session.dag.isEmpty()
-    }
-
-
-    def 'should create two target channels'() {
-        given:
-        def result = Channel.from(1,2,3,4)
-
-        when:
-        def (ch1, ch2) = result.into(2)
-
-        then:
-        ch1 instanceof DataflowQueue
-        ch2 instanceof DataflowQueue
-
-        ch1.val == 1
-        ch1.val == 2
-        ch1.val == 3
-        ch1.val == 4
-        ch1.val == Channel.STOP
-
-        ch2.val == 1
-        ch2.val == 2
-        ch2.val == 3
-        ch2.val == 4
-        ch2.val == Channel.STOP
-
-    }
-
-    def 'should forward items into target channels'() {
-        given:
-        def result = Channel.from('a','b',[1,2])
-        def ch1 = Channel.create()
-        def ch2 = Channel.create()
-        def ch3 = Channel.create()
-
-        when:
-        result.into(ch1, ch2, ch3)
-
-        then:
-        ch1.val == 'a'
-        ch1.val == 'b'
-        ch1.val == [1,2]
-        ch1.val == Channel.STOP
-
-        ch2.val == 'a'
-        ch2.val == 'b'
-        ch2.val == [1,2]
-        ch2.val == Channel.STOP
-
-        ch3.val == 'a'
-        ch3.val == 'b'
-        ch3.val == [1,2]
-        ch3.val == Channel.STOP
-
-    }
-
-    @Timeout(1)
-    def 'should forward dataflow value into a new channel'() {
-
-        when:
-        def result = Channel.create()
-        Channel.value('Hello').into(result)
-        then:
-        result.val == 'Hello'
-        result.val == Channel.STOP
-
-    }
-
-    def 'should create new dataflow variables and forward item to them'  () {
-
-        when:
-        Channel.from(10,2,30).into { alpha; gamma }
-
-        then:
-        session.binding.alpha.val == 10
-        session.binding.alpha.val == 2
-        session.binding.alpha.val == 30
-        session.binding.alpha.val == Channel.STOP
-
-        session.binding.gamma.val == 10
-        session.binding.gamma.val == 2
-        session.binding.gamma.val == 30
-        session.binding.gamma.val == Channel.STOP
-
-    }
-
-
-}
diff --git a/modules/nextflow/src/test/groovy/nextflow/extension/DataflowSeparateExtensionTest.groovy b/modules/nextflow/src/test/groovy/nextflow/extension/DataflowSeparateExtensionTest.groovy
deleted file mode 100644
index 9e13528415..0000000000
--- a/modules/nextflow/src/test/groovy/nextflow/extension/DataflowSeparateExtensionTest.groovy
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright 2020-2022, Seqera Labs
- * Copyright 2013-2019, Centre for Genomic Regulation (CRG)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package nextflow.extension
-
-import nextflow.Channel
-import nextflow.Session
-import spock.lang.Shared
-import spock.lang.Specification
-
-/**
- *
- * @author Paolo Di Tommaso 
- */
-class DataflowSeparateExtensionTest extends Specification{
-
-    @Shared
-    Session session
-
-    def setup() {
-        session = new Session()
-    }
-
-    def cleanup() {
-        assert !session.dag.isEmpty()
-    }
-
-
-    def testSeparate() {
-
-        when:
-        def str = 'abcdef'
-        def (ch1, ch2) = Channel.from(0..3).separate(2) { [it, str[it]] }
-        then:
-        ch1.val == 0
-        ch1.val == 1
-        ch1.val == 2
-        ch1.val == 3
-        ch1.val == Channel.STOP
-
-        ch2.val == 'a'
-        ch2.val == 'b'
-        ch2.val == 'c'
-        ch2.val == 'd'
-        ch2.val == Channel.STOP
-    }
-
-
-    def testSeparate2() {
-
-        when:
-        def (ch3, ch4) = Channel.from(0..3).map { [it, it+1] } .separate(2)
-        then:
-        ch3.val == 0
-        ch3.val == 1
-        ch3.val == 2
-        ch3.val == 3
-        ch3.val == Channel.STOP
-
-        ch4.val == 1
-        ch4.val == 2
-        ch4.val == 3
-        ch4.val == 4
-        ch4.val == Channel.STOP
-
-    }
-
-    def testSeparate3() {
-
-        when:
-        def s1 = Channel.create()
-        def s2 = Channel.create()
-        def s3 = Channel.create()
-
-        Channel.from(1,2,3,4)
-                .separate([s1,s2,s3]) { item -> [item+1, item*item, item-1] }
-
-        then:
-        s1.val == 2
-        s1.val == 3
-        s1.val == 4
-        s1.val == 5
-        s1.val == Channel.STOP
-        s2.val == 1
-        s2.val == 4
-        s2.val == 9
-        s2.val == 16
-        s2.val == Channel.STOP
-        s3.val == 0
-        s3.val == 1
-        s3.val == 2
-        s3.val == 3
-        s3.val == Channel.STOP
-
-    }
-
-
-    def testSeparate4() {
-        when:
-        def x = Channel.create()
-        def y = Channel.create()
-        def source = Channel.from([1,2], ['a','b'], ['p','q'])
-        source.separate(x,y)
-        then:
-        x.val == 1
-        x.val == 'a'
-        x.val == 'p'
-        x.val == Channel.STOP
-        y.val == 2
-        y.val == 'b'
-        y.val == 'q'
-        y.val == Channel.STOP
-
-        when:
-        def x2 = Channel.create()
-        def y2 = Channel.create()
-        def source2 = Channel.from([1,2], ['a','c','b'], 'z')
-        source2.separate(x2,y2)
-        then:
-        x2.val == 1
-        x2.val == 'a'
-        x2.val == 'z'
-        x2.val == Channel.STOP
-        y2.val == 2
-        y2.val == 'c'
-        y2.val == null
-        y2.val == Channel.STOP
-    }
-
-}
diff --git a/modules/nextflow/src/test/groovy/nextflow/extension/OperatorImplTest.groovy b/modules/nextflow/src/test/groovy/nextflow/extension/OperatorImplTest.groovy
index dc496dd3da..3eb609dc85 100644
--- a/modules/nextflow/src/test/groovy/nextflow/extension/OperatorImplTest.groovy
+++ b/modules/nextflow/src/test/groovy/nextflow/extension/OperatorImplTest.groovy
@@ -427,52 +427,6 @@ class OperatorImplTest extends Specification {
         Channel.value(5).count(6).val == 0
     }
 
-    def testCountBy() {
-        expect:
-        Channel.from('hello','ciao','hola', 'hi', 'bonjour').countBy { it[0] } .val == [c:1, b:1, h:3]
-    }
-
-
-    def testGroupBy() {
-
-        def result
-
-        when:
-        result = Channel.from('hello','ciao','hola', 'hi', 'bonjour').groupBy { String str -> str[0] }
-        then:
-        result.val == [c:['ciao'], b:['bonjour'], h:['hello','hola','hi']]
-
-        when:
-        result = Channel.from( [id: 1, str:'one'], [id: 2, str:'two'], [id: 2, str:'dos'] ).groupBy()
-        then:
-        result.val == [ 1: [[id: 1, str:'one']], 2: [[id: 2, str:'two'], [id: 2, str:'dos']] ]
-
-        when:
-        result = Channel.from( [1, 'a' ], [2, 'b'], [1, 'c'], [1, 'd'], [3, 'z'] ).groupBy()
-        then:
-        result.val == [1: [[1,'a'], [1,'c'], [1,'d']], 2: [[2,'b']], 3: [[3,'z']]]
-        result instanceof DataflowVariable
-
-        when:
-        result = Channel.from( [1, 'a' ], [2, 'b'], [3, 'a'], [4, 'c'], [5, 'a'] ).groupBy(1)
-        then:
-        result.val == [a: [[1,'a'], [3,'a'], [5,'a']], b: [[2,'b']], c: [[4,'c']]]
-        result instanceof DataflowVariable
-
-        when:
-        result = Channel.from( [id: 1, str:'one'], [id: 2, str:'two'], [id: 2, str:'dos'] ).groupBy()
-        then:
-        result.val == [ 1: [[id: 1, str:'one']], 2: [[id: 2, str:'two'], [id: 2, str:'dos']] ]
-        result instanceof DataflowVariable
-
-        when:
-        result = Channel.from('hello','ciao','hola', 'hi', 'bonjour').groupBy { String str -> str[0] }
-        then:
-        result.val == [c:['ciao'], b:['bonjour'], h:['hello','hola','hi']]
-        result instanceof DataflowVariable
-
-    }
-
     def testToList() {
 
         when:
@@ -541,153 +495,6 @@ class OperatorImplTest extends Specification {
     }
 
 
-
-    def testSpread() {
-
-        when:
-        def left = Channel.from(1,2,3)
-        def right = ['aa','bb']
-        def r1 = left.spread(right)
-        then:
-        r1.val == [1, 'aa']
-        r1.val == [1, 'bb']
-        r1.val == [2, 'aa']
-        r1.val == [2, 'bb']
-        r1.val == [3, 'aa']
-        r1.val == [3, 'bb']
-        r1.val == Channel.STOP
-
-        when:
-        left = Channel.from(1,2)
-        right = Channel.from('a','bb','ccc')
-        def r2 = left.spread(right)
-        then:
-        r2.val == [1, 'a']
-        r2.val == [1, 'bb']
-        r2.val == [1, 'ccc']
-        r2.val == [2, 'a']
-        r2.val == [2, 'bb']
-        r2.val == [2, 'ccc']
-        r2.val == Channel.STOP
-
-    }
-
-    def testSpreadChained() {
-
-        when:
-        def str1 = Channel.from('a','b','c')
-        def str2 = Channel.from('x','y')
-        def result = Channel.from(1,2).spread(str1).spread(str2)
-        then:
-        result.val == [1,'a','x']
-        result.val == [1,'a','y']
-        result.val == [1,'b','x']
-        result.val == [1,'b','y']
-        result.val == [1,'c','x']
-        result.val == [1,'c','y']
-        result.val == [2,'a','x']
-        result.val == [2,'a','y']
-        result.val == [2,'b','x']
-        result.val == [2,'b','y']
-        result.val == [2,'c','x']
-        result.val == [2,'c','y']
-        result.val == Channel.STOP
-
-    }
-
-
-    def testSpreadTuple() {
-
-        when:
-        def result = Channel.from([1, 'x'], [2,'y'], [3, 'z']).spread( ['alpha','beta','gamma'] )
-
-        then:
-        result.val == [1, 'x', 'alpha']
-        result.val == [1, 'x', 'beta']
-        result.val == [1, 'x', 'gamma']
-
-        result.val == [2, 'y', 'alpha']
-        result.val == [2, 'y', 'beta']
-        result.val == [2, 'y', 'gamma']
-
-        result.val == [3, 'z', 'alpha']
-        result.val == [3, 'z', 'beta']
-        result.val == [3, 'z', 'gamma']
-
-        result.val == Channel.STOP
-    }
-
-    def testSpreadMap() {
-
-        when:
-        def result = Channel.from([id:1, val:'x'], [id:2,val:'y'], [id:3, val:'z']).spread( ['alpha','beta','gamma'] )
-
-        then:
-        result.val == [[id:1, val:'x'], 'alpha']
-        result.val == [[id:1, val:'x'], 'beta']
-        result.val == [[id:1, val:'x'], 'gamma']
-
-        result.val == [[id:2,val:'y'], 'alpha']
-        result.val == [[id:2,val:'y'], 'beta']
-        result.val == [[id:2,val:'y'], 'gamma']
-
-        result.val == [[id:3, val:'z'], 'alpha']
-        result.val == [[id:3, val:'z'], 'beta']
-        result.val == [[id:3, val:'z'], 'gamma']
-
-        result.val == Channel.STOP
-    }
-
-    def testSpreadWithSingleton() {
-        when:
-        def result = Channel.value(7).spread(['a','b','c'])
-        then:
-        result.val == [7, 'a']
-        result.val == [7, 'b']
-        result.val == [7, 'c']
-        result.val == Channel.STOP
-    }
-
-    def testSpreadWithPath() {
-        given:
-        def path1 = Paths.get('/some/data/file1')
-        def path2 = Paths.get('/some/data/file2')
-
-        when:
-        def result = Channel.from(1,2,3).spread( Channel.value(path1) )
-        then:
-        result.val == [1, path1]
-        result.val == [2, path1]
-        result.val == [3, path1]
-        result.val == Channel.STOP
-
-        when:
-        result = Channel.from(1,2,3).spread( ['abc'] )
-        then:
-        result.val == [1, 'abc']
-        result.val == [2, 'abc']
-        result.val == [3, 'abc']
-        result.val == Channel.STOP
-
-        when:
-        result = Channel.from(1,2,3).spread( Channel.value('abc') )
-        then:
-        result.val == [1, 'abc']
-        result.val == [2, 'abc']
-        result.val == [3, 'abc']
-        result.val == Channel.STOP
-
-        when:
-        result = Channel.from(1,2).spread( Channel.from(path1,path2) )
-        then:
-        result.val == [1, path1]
-        result.val == [1, path2]
-        result.val == [2, path1]
-        result.val == [2, path2]
-        result.val == Channel.STOP
-
-    }
-
     def testFlatten() {
 
         when:
@@ -1025,36 +832,6 @@ class OperatorImplTest extends Specification {
     }
 
 
-    def testDataflowSeparateWithOpenArray() {
-
-        when:
-        def s1 = Channel.create()
-        def s2 = Channel.create()
-        def s3 = Channel.create()
-
-        Channel.from(1,2,3,4)
-                .separate(s1,s2,s3) { item -> [item+1, item*item, item-1] }
-
-        then:
-        s1.val == 2
-        s1.val == 3
-        s1.val == 4
-        s1.val == 5
-        s1.val == Channel.STOP
-        s2.val == 1
-        s2.val == 4
-        s2.val == 9
-        s2.val == 16
-        s2.val == Channel.STOP
-        s3.val == 0
-        s3.val == 1
-        s3.val == 2
-        s3.val == 3
-        s3.val == Channel.STOP
-
-    }
-
-
     def testGroupTuple() {
 
         when:
diff --git a/modules/nextflow/src/test/groovy/nextflow/extension/PhaseOpTest.groovy b/modules/nextflow/src/test/groovy/nextflow/extension/PhaseOpTest.groovy
index 70ecf88aea..20eb7c5835 100644
--- a/modules/nextflow/src/test/groovy/nextflow/extension/PhaseOpTest.groovy
+++ b/modules/nextflow/src/test/groovy/nextflow/extension/PhaseOpTest.groovy
@@ -18,10 +18,8 @@
 package nextflow.extension
 
 import groovyx.gpars.dataflow.DataflowQueue
-import nextflow.Channel
 import nextflow.Session
 import spock.lang.Specification
-
 /**
  *
  * @author Paolo Di Tommaso 
@@ -82,95 +80,4 @@ class PhaseOpTest extends Specification {
 
     }
 
-    def testPhase() {
-
-        setup:
-        def ch1 = Channel.from( 1,2,3 )
-        def ch2 = Channel.from( 1,0,0,2,7,8,9,3 )
-
-        when:
-        def result = ch1.phase(ch2)
-        then:
-        result.val == [1,1]
-        result.val == [2,2]
-        result.val == [3,3]
-
-        result.val == Channel.STOP
-
-
-        when:
-        ch1 = Channel.from( [sequence: 'aaaaaa', key: 1], [sequence: 'bbbbbb', key: 2] )
-        ch2 = Channel.from( [val: 'zzzz', id: 3], [val: 'xxxxx', id: 1], [val: 'yyyyy', id: 2])
-        result = ch1.phase(ch2) { Map it ->
-            if( it.containsKey('key') ) {
-                return it.key
-            }
-            else if( it.containsKey('id') ) {
-                return it.id
-            }
-            return null
-        }
-        then:
-
-        result.val == [ [sequence: 'aaaaaa', key: 1], [val: 'xxxxx', id: 1] ]
-        result.val == [ [sequence: 'bbbbbb', key: 2], [val: 'yyyyy', id: 2] ]
-        result.val == Channel.STOP
-
-    }
-
-    def testPhaseWithRemainder() {
-
-        def ch1
-        def ch2
-        def result
-
-        when:
-        ch1 = Channel.from( 1,2,3 )
-        ch2 = Channel.from( 1,0,0,2,7,8,9,3 )
-        result = ch1.phase(ch2, remainder: true)
-
-        then:
-        result.val == [1,1]
-        result.val == [2,2]
-        result.val == [3,3]
-        result.val == [null,0]
-        result.val == [null,0]
-        result.val == [null,7]
-        result.val == [null,8]
-        result.val == [null,9]
-        result.val == Channel.STOP
-
-
-        when:
-        ch1 = Channel.from( 1,0,0,2,7,8,9,3 )
-        ch2 = Channel.from( 1,2,3 )
-        result = ch1.phase(ch2, remainder: true)
-
-        then:
-        result.val == [1,1]
-        result.val == [2,2]
-        result.val == [3,3]
-        result.val == [0,null]
-        result.val == [0,null]
-        result.val == [7,null]
-        result.val == [8,null]
-        result.val == [9,null]
-        result.val == Channel.STOP
-    }
-
-    def 'should phase entries' () {
-        given:
-        def ch1 = Channel.from(['sample1', 1], ['sample2', 2], ['sample3', 3])
-        def ch2 = Channel.from(['sample1', 4], ['sample3', 6], ['sample2', 5])
-
-        when:
-        def result = ch1.phase(ch2).toList().getVal()
-        then:
-        result.size() == 3
-        result.contains( [['sample1', 1], ['sample1', 4]] )
-        result.contains( [['sample2', 2], ['sample2', 5]])
-        result.contains( [['sample3', 3], ['sample3', 6]] )
-    }
-
-
 }
diff --git a/modules/nextflow/src/test/groovy/nextflow/extension/PrintOperatorTest.groovy b/modules/nextflow/src/test/groovy/nextflow/extension/PrintOperatorTest.groovy
deleted file mode 100644
index 97f6cd5357..0000000000
--- a/modules/nextflow/src/test/groovy/nextflow/extension/PrintOperatorTest.groovy
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2020-2022, Seqera Labs
- * Copyright 2013-2019, Centre for Genomic Regulation (CRG)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package nextflow.extension
-
-import org.junit.Rule
-import spock.lang.Specification
-
-import nextflow.Channel
-import nextflow.Session
-import test.OutputCapture
-/**
- *
- * @author Paolo Di Tommaso 
- */
-class PrintOperatorTest extends Specification{
-
-    def setupSpec() {
-        new Session()
-    }
-
-    /*
-     * Read more http://mrhaki.blogspot.com.es/2015/02/spocklight-capture-and-assert-system.html
-     */
-    @Rule
-    OutputCapture capture = new OutputCapture()
-
-    def 'should print channel item to stdout'() {
-
-        when:
-        Channel.from(1,2,3).print()
-        sleep 50
-        then:
-        capture.toString() == '123'
-
-    }
-
-    def 'should print item applying closure formatting rule'() {
-
-        when:
-        Channel.from(1,2,3).print { "> $it " }
-        sleep 50
-        then:
-        capture.toString() == '> 1 > 2 > 3 '
-
-    }
-
-    def 'should print item appending newline character'() {
-
-        when:
-        Channel.from(1,2,3).println()
-        sleep 50
-        then:
-        capture.toString() == '1\n2\n3\n'
-
-    }
-
-    def 'should print items applying closure formatting and appending newline'() {
-
-        when:
-        Channel.from(1,2,3).map{ "> $it" }.println()
-        sleep 50
-        then:
-        capture.toString() == '> 1\n> 2\n> 3\n'
-
-    }
-
-
-
-}