Hi Everybody,
Sorry if I’ve missed something obvious, as this question seems quite basic.
The code below writes 5 to standard out. How do I capture that value and assign to a Groovy variable?
x = Channel
.from(1, 2, 3, 4, 5)
x.count().view()
(As an aside: the reason I want to do this is that I’ve written a pipeline that maps FASTQ files and quantifies the results. The pipeline then needs to combine the results from each replicate. However, if there is only 1 replicate then the pipeline should not run the combining script.
Therefore, I’ve tried to add logic to my pipeline which assesses the number of samples in a channel and runs the combining script accordingly.)
There must be an easy answer to this, but I just can’t see it. Any help would be much appreciated.
Thanks very much!
Steven