nextflow
nextflow copied to clipboard
Support named channel inputs for processes and workflows
New feature
I would like to have the DSL2 support specifying the channels for processes and workflows via keywords. Some workflows I've written require many channels (5, 10, even 20!). It's hard to make sure that the order I specify is the same as the order I require.
Usage scenario
workflow foo {
take:
ch_in_1
ch_in_2
...
ch_in_100
main:
...
}
workflow bar {
ch_in_1 = Channel.from(...)
ch_in_2 = Channel.from(...)
...
ch_in_100 = Channel.from(...)
...
foo(
ch_in_1: ch_in_1,
ch_in_2: ch_in_2,
....
ch_in_100: ch_in_100,
)
}
Suggest implementation
?
This is a good point. Now that DSL2 allows named outputs it makes sense to have named input arguments as well
@pditommaso how can I help contribute a PR for this? Is there a good place in the code to start looking?
Allowing this for workflows, we should do the same for processes.
The entry point should the workflow run
https://github.com/nextflow-io/nextflow/blob/7f91ecb39618b1327d5dc3d7aac9f9049159baff/modules/nextflow/src/main/groovy/nextflow/script/WorkflowDef.groovy#L166-L178
and process run
https://github.com/nextflow-io/nextflow/blob/7f91ecb39618b1327d5dc3d7aac9f9049159baff/modules/nextflow/src/main/groovy/nextflow/script/ProcessDef.groovy#L164-L164
Nice to know is that named params in groovy are just mapped to a LinkedHashMap, therefore the run method would receive a single argument of that type.
Think right now, this could open a potential ambiguity with existing code which may already invoke a workflow/process with a single map argument.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I should circle back to this. Keeping it open.