Link Search Menu Expand Document

Step 1 - Operate on a stream

Let us illustrate the stream-like nature of a NXF Channel using a very simple example: computing $1+1$.

// Step - 1
workflow step1 {
  Channel.from(1) \
    | map{ it + 1 } \
    | view{ it }
}

This chunk is directly taken from main.nf, running it can be done as follows:

> nextflow -q run . -entry step1
WARN: DSL 2 IS AN EXPERIMENTAL FEATURE UNDER DEVELOPMENT -- SYNTAX MAY CHANGE IN FUTURE RELEASE
2