After democratically reviewing and deciding on the...
# team-maintainers
e
After democratically reviewing and deciding on the first point, here is the second one 😛 https://github.com/nf-core/modules/pull/9665#discussion_r2708432728 Should I keep and update one variable (
ch_reads
) throughout the execution, or create and update a new variable, for every downstream input? Pros and cons on the link (don't want to sway opinions 😛 )
j
I personally would create new variables for each stage... it makes debugging what is in each channel at each time point a bit clearer. I tend to favour an approach like the following (variable naming could be improved):
Copy code
ch_reads_for_umitools = ch_reads.branch { tuple ->
    umitools: !skip_umitools
    skip: true
}
UMITOOLS_EXTRACT( ch_reads_for_umitools.umitools )

ch_reads_after_umitools = UMITOOLS.out.reads.mix(ch_reads_for_umitools.skip)
âž• 1
e
I don't like how that bloats the code, and I am not sure how and if garbage collector properly cleans the variables that won't be used any more in Groovy 😞
Plus, @Jim Downie, with skip flags instead of branches, the not-chosen processes will not even make it to the Nextflow execution DAG, which is also better and cleaner in my opinion.
I'd use branch only if some of the inputs would run and some wouldn't..here they all either run or not
j
That's a fair point
e
Could I have a couple more opinions on this one, and hopefully merge this PR soon? 😅