carpentries-incubator / workflows-nextflow

Workflow management with Nextflow and nf-core
https://carpentries-incubator.github.io/workflows-nextflow/
Other
19 stars 29 forks source link

Multiple outputs in a Process. #25

Closed ggrimes closed 3 months ago

ggrimes commented 3 years ago

Maybe include an example of multiple defined outputs in the Process episode

For example:

Below we create 2 files and then in the workflow scope mix the output channels and group together by tuple id ` nextflow.enable.dsl = 2

process P1 {

output: tuple val('tupleid'), path('p1.txt') tuple val('tupleid'), path('p2.txt')

script: """ touch p1.txt touch p2.txt """ }

workflow {

P1() P1.out[0].mix(P1.out[1]).groupTuple().view()

} `

kerimoff commented 3 years ago

This is definitely one of the most used case scenarios. I am hopeful to help you with this wonderful initiative.

Thanks for starting this carpentry course ❤️ Will try to help as much as I possibly can to complete this course preparation