From bb8d909cf6e64f6fea35fa7935b54eb7d461121d Mon Sep 17 00:00:00 2001 From: fmalmeida Date: Mon, 25 Mar 2024 12:20:34 +0100 Subject: [PATCH] add a parser for raw/filtered results --- subworkflows/local/kallisto_bustools.nf | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/subworkflows/local/kallisto_bustools.nf b/subworkflows/local/kallisto_bustools.nf index d420ab01..3deee2c5 100644 --- a/subworkflows/local/kallisto_bustools.nf +++ b/subworkflows/local/kallisto_bustools.nf @@ -52,11 +52,23 @@ workflow KALLISTO_BUSTOOLS { ch_versions = ch_versions.mix(KALLISTOBUSTOOLS_COUNT.out.versions) + // get raw/filtered counts + ch_raw_counts = KALLISTOBUSTOOLS_COUNT.out.count.map{ meta, kb_dir -> + if (file("${kb_dir.toUriString()}/counts_unfiltered").exists()) { + [meta, file("${kb_dir.toUriString()}/counts_unfiltered")] + } + } + ch_filtered_counts = KALLISTOBUSTOOLS_COUNT.out.count.map{ meta, kb_dir -> + if (file("${kb_dir.toUriString()}/counts_filtered").exists()) { + [meta, file("${kb_dir.toUriString()}/counts_filtered")] + } + } + emit: ch_versions - counts = KALLISTOBUSTOOLS_COUNT.out.count - raw_counts = KALLISTOBUSTOOLS_COUNT.out.raw_counts - filtered_counts = KALLISTOBUSTOOLS_COUNT.out.filtered_counts - txp2gene = txp2gene.collect() + counts = KALLISTOBUSTOOLS_COUNT.out.count + raw_counts = ch_raw_counts + filtered_counts = ch_filtered_counts + txp2gene = txp2gene.collect() }