Process only executing once despite multiple inputs #3524
-
Bug reportWhen passing multiple channels to a process I am finding that the process doesn't run as many times as i expect Expected behavior and actual behaviorI have the following code:
With my inputs, the Steps to reproduce the problemhttps://github.com/anoronh4/minimal_bug <- here is my "minimal" reproducible example. i am trying to work with nf-core tools, therefore i have a few installations of nf-core modules. i ran the following CLI command: Program outputThere's no error or warning, i just see from the trace that only 1 process finished. But I am attaching the log! Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Just to update, after to talking to someone on the nf-core slack i've learned that this is actually expected behavior and not a bug. the issue arises from the fact that one of my channels is a queue channel, not a value channel. so now my question is: what's the best way to turn a queue channel into a value channel? I have this workaround:
is that the only way to do it? |
Beta Was this translation helpful? Give feedback.
-
It was me 😄 You can convert queue channels to value channels through operators returning a single value, such as first, last, collect, count, min, max, reduce, and sum. Regular variables passed as inputs to Nextflow processes will also automatically be converted to value channels. You can see there is no poison pill because the process below spans 3 tasks, even though the second input is a single value:
The output is:
If it was a queue channel, as in:
The output would be:
|
Beta Was this translation helpful? Give feedback.
It was me 😄
You can convert queue channels to value channels through operators returning a single value, such as first, last, collect, count, min, max, reduce, and sum. Regular variables passed as inputs to Nextflow processes will also automatically be converted to value channels. You can see there is no poison pill because the process below spans 3 tasks, even though the second input is a single value:
The output is: