Step 2 - Operate on a stream in parallel
NextFlow (and streams in general) are supposed to be a good fit for parallel execution. Let’s see how this can be done:
// Step - 2
workflow step2 {
Channel.from( [ 1, 2, 3 ] ) \
| map{ it + 1 } \
| view{ it }
}
Running it can be done using:
> nextflow -q run . -entry step2
WARN: DSL 2 IS AN EXPERIMENTAL FEATURE UNDER DEVELOPMENT -- SYNTAX MAY CHANGE IN FUTURE RELEASE
2
3
4