Replace collect with toList
The operator chain .collect().ifEmpty{[]} could be replaced with toList() simplifying a bit the code
https://github.com/nf-core/rnaseq/blob/e049f51f0214b2aef7624b9dd496a404a7c34d14/workflows/rnaseq.nf#L768
@nf-core/core - let's also put this into the template right ?
I did. Have a look at the linked issues...
Thanks! This won't work when we need to use a closure with collect though like below:
https://github.com/nf-core/rnaseq/blob/e049f51f0214b2aef7624b9dd496a404a7c34d14/workflows/rnaseq.nf#L777-L786
Given that we will have to use a closure to remove the meta map (first element) from most channels in a proper pipeline I am wondering whether it is worth keeping the current syntax for consistency. This way we can quite easily see which channels have a meta map and those that don't.
+1 for fixing in tools though.
Going to stick with what we have as mentioned in my comment above and use toList() wherever appropriate. Thanks!