From 9dd5895482f8942570b3dc37956fa3aadb092d18 Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 5 May 2026 16:40:24 +0000 Subject: [PATCH] Exclude ingress samples with no reads --- main.nf | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/main.nf b/main.nf index 0e38637..c3e679c 100644 --- a/main.nf +++ b/main.nf @@ -423,11 +423,23 @@ workflow { ] } + analysis_samples = decorated_samples + .filter { meta, sample_reads, stats -> + if (meta.n_seqs == 0) { + log.warn("Sample ${meta.alias} has no reads - excluded from transcriptome analysis.") + return false + } + true + } + .ifEmpty { + throw new Exception("No samples with reads were available for transcriptome analysis.") + } + pychopper_results = Channel.empty() - processed_samples = decorated_samples + processed_samples = analysis_samples if (params.cdna_preprocess) { - grouped_samples = decorated_samples.branch { meta, sample_reads, stats -> + grouped_samples = analysis_samples.branch { meta, sample_reads, stats -> to_process: sample_reads != null passthrough: sample_reads == null }