Ethan Everett Hetrick
04/16/2026, 3:11 AM.collect()
// Error if sample count is insufficient after filtering
if( ch_samplesheet.size() < params.min_samples ) {
error "ERROR: At least ${params.min_samples} samples are required." }Arthur
04/16/2026, 3:29 AMsize but rather a count.
Probably best to try something like:
ch_samplesheet.count().map{ ct -> ct < params.min_samples ? error("Too few samples. ${ct} < ${params.min_samples}") : "" }
But be aware that if you don’t block the use of ch_samplesheet downstream then processes can start before this full evaluates (they will then be killed/finish if this errors out).
I can’t think of the best way to block in this instance right now, but I think there will be one.Nicolas Vannieuwkerke
04/16/2026, 7:16 AMEthan Everett Hetrick
04/21/2026, 9:44 PMNicolas Vannieuwkerke
04/22/2026, 7:54 AM