Reputation: 309
I'm implementing a Nextflow workflow where each process can give multiple outputs that may be needed downstream on different processes.
process multiple_outputs {
input:
tuple id, input from previous_process
output:
tuple id, input_for_a, input_for_b, input_for_a_b into downstream
}
Nextflow documentation states that operator into can use multiple channels and promotes channel duplication as a pattern.
However none of these options seems to work inside the process primitive and multiple channel output is not documented:
The pattern found on this answer (syntax error):
output:
tuple id, input_for_a, input_for_b, input_for_a_b into { downstream_a; downstream_b }
// nor these variants:
//
// `into { downstream_a, downstream_b }`
// `into downstream_a, downstream_b`
// `into tuple a, b`
Repeating the output into duplicated channels (one channel is empty):
output:
tuple id, input_for_a, input_for_a_b into downstream_a
tuple id, input_for_b, input_for_a_b into downstream_b
// runs, but cannot find the file in one of the channels
Which is the right way to use the output in multiple channels?
Upvotes: 2
Views: 3510
Reputation: 3381
The output declaration should be:
output:
tuple id, input_for_a, input_for_b, input_for_a_b into(downstream_a, downstream_b)
In alternative, you may want to consider using DLS2 which does not have anymore the single-channel usage requirement. Read more about it here.
Upvotes: 3
Reputation: 309
Answer b seems to work:
output:
tuple id, input_for_a, input_for_a_b into downstream_a
tuple id, input_for_b, input_for_a_b into downstream_b
It seems that it failed for non related reasons.
Upvotes: 2