How to use the output of a process to check for a condition? #4287
-
Hi,
And, I want to check the output
But, It doesn't work... I tried Also, I need to check if the output of a process is an empty file in a condition again... but no luck... I appreciate any help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The appropriate way to handle channels is to use channel operators. You can use the The rule of thumb to remember: If you want to do something with a channel, you need to use a channel operator (or a process) 😉 |
Beta Was this translation helpful? Give feedback.
The appropriate way to handle channels is to use channel operators. You can use the
branch
operator (docs here) for checking a condition. It will create N new channels, where N is the number of conditions that you described, distributing the channel elements according to your condition. If you want something more elaborate, you can also use a Nextflow process. If you want a process to only create tasks based on a condition, you can also use thewhen
block (docs here).The rule of thumb to remember: If you want to do something with a channel, you need to use a channel operator (or a process) 😉