From 7f011477a90c769bd107b6e369f60b1e78a8e314 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Tue, 21 Jun 2022 09:27:07 +0200 Subject: [PATCH] Get recominbing with databases working (still needs cleanup) --- subworkflows/local/postprocessing_krona.nf | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/subworkflows/local/postprocessing_krona.nf b/subworkflows/local/postprocessing_krona.nf index 0ef4f88..0798597 100644 --- a/subworkflows/local/postprocessing_krona.nf +++ b/subworkflows/local/postprocessing_krona.nf @@ -33,11 +33,22 @@ workflow POSTPROCESSING_KRONA { // TODO PUSH BACK CENTRIFUGE_KREPORT TO PROFILING.NF WHERE DATABASE ALREADY IS? ch_input_for_centrifuge_kreport = ch_files_for_krona.centrifuge - .dump(tag: "db_for_kreport_pre") - .join(ch_databases, by: 0) - .dump(tag: "db_for_kreport_post") + .map{ + meta, file -> + def db_meta = [ tool: meta.tool, db_name: meta.db_name, db_params: meta.db_params ] + def kfile = file + def sample_meta = [ id: meta.id, run_accession: meta.run_accession, instrument_platform: meta.instrument_platform, single_end: meta.single_end, is_fasta: meta.is_fasta ] + [ db_meta, kfile, sample_meta ] + } + .dump(tag: "sample") + ch_input_for_centrifuge_krona = ch_databases.centrifuge + .collect() + .dump(tag: "db") + .combine(ch_input_for_centrifuge_kreport, by: 0) + .dump(tag: "sm") + // Kraken KRAKENTOOLS_KREPORT2KRONA ( ch_files_for_krona.kraken2 ) KRONA_KRAKENCLEANUP ( KRAKENTOOLS_KREPORT2KRONA.out.txt ) @@ -53,7 +64,6 @@ workflow POSTPROCESSING_KRONA { KRONA_KTIMPORTTEXT (ch_input_for_ktimporttext) - ch_versions = ch_versions.mix( KRONA_KTIMPORTTEXT.out.versions.first() ) // Centrifuge