From a63cada38d6778ab055fb6a095b2afb72a844810 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Wed, 5 Jul 2023 10:25:35 +0200 Subject: [PATCH 1/5] Skip binning prep when downstream steps aren't executed --- CHANGELOG.md | 1 + workflows/mag.nf | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b6d67a4..7f51bef4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#439](https://github.com/nf-core/mag/pull/445) - Fix bug in assembly input (by @prototaxites) - [#447](https://github.com/nf-core/mag/pull/447) - Remove `default: None` from parameter schema (by @drpatelh) - [#449](https://github.com/nf-core/mag/pull/447) - Fix results file overwriting in Ancient DNA workflow (reported by @alexhbnr, fix by @jfy133) +- [#XXX](https://github.com/nf-core/mag/pull/447) - Fix binning preparation from running even when binning was requested to be skipped (reported by @prototaxites, fix by @jfy133) ### `Dependencies` diff --git a/workflows/mag.nf b/workflows/mag.nf index 2182b6e3..195ee105 100644 --- a/workflows/mag.nf +++ b/workflows/mag.nf @@ -617,10 +617,12 @@ workflow MAG { ch_busco_summary = Channel.empty() ch_checkm_summary = Channel.empty() - BINNING_PREPARATION ( - ch_assemblies, - ch_short_reads - ) + if ( !skip_binning || params.ancient_dna ) { + BINNING_PREPARATION ( + ch_assemblies, + ch_short_reads + ) + } /* ================================================================================ From 0c37d8e69113415b4623761855dd0dfcdf5a5d66 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Wed, 5 Jul 2023 10:26:44 +0200 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f51bef4..b6e2bd92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#439](https://github.com/nf-core/mag/pull/445) - Fix bug in assembly input (by @prototaxites) - [#447](https://github.com/nf-core/mag/pull/447) - Remove `default: None` from parameter schema (by @drpatelh) - [#449](https://github.com/nf-core/mag/pull/447) - Fix results file overwriting in Ancient DNA workflow (reported by @alexhbnr, fix by @jfy133) -- [#XXX](https://github.com/nf-core/mag/pull/447) - Fix binning preparation from running even when binning was requested to be skipped (reported by @prototaxites, fix by @jfy133) +- [#470](https://github.com/nf-core/mag/pull/470) - Fix binning preparation from running even when binning was requested to be skipped (reported by @prototaxites, fix by @jfy133) ### `Dependencies` From 9a2ee912b5761ebd162064ba03209772ff4d1c1b Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Wed, 5 Jul 2023 11:48:26 +0200 Subject: [PATCH 3/5] Add binning_rpep conditional everywhere --- workflows/mag.nf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/workflows/mag.nf b/workflows/mag.nf index 195ee105..3747ff01 100644 --- a/workflows/mag.nf +++ b/workflows/mag.nf @@ -617,7 +617,7 @@ workflow MAG { ch_busco_summary = Channel.empty() ch_checkm_summary = Channel.empty() - if ( !skip_binning || params.ancient_dna ) { + if ( !params.skip_binning || params.ancient_dna ) { BINNING_PREPARATION ( ch_assemblies, ch_short_reads @@ -688,8 +688,10 @@ workflow MAG { } } - ch_versions = ch_versions.mix(BINNING_PREPARATION.out.bowtie2_version.first()) - ch_versions = ch_versions.mix(BINNING.out.versions) + if ( !params.skip_binning || params.ancient_dna ) { + ch_versions = ch_versions.mix(BINNING_PREPARATION.out.bowtie2_version.first()) + ch_versions = ch_versions.mix(BINNING.out.versions) + } /* * DAS Tool: binning refinement @@ -945,7 +947,9 @@ workflow MAG { } } - ch_multiqc_files = ch_multiqc_files.mix(BINNING_PREPARATION.out.bowtie2_assembly_multiqc.collect().ifEmpty([])) + if ( !params.skip_binning || params.ancient_dna ) { + ch_multiqc_files = ch_multiqc_files.mix(BINNING_PREPARATION.out.bowtie2_assembly_multiqc.collect().ifEmpty([])) + } if (!params.skip_binning && !params.skip_prokka){ ch_multiqc_files = ch_multiqc_files.mix(PROKKA.out.txt.collect{it[1]}.ifEmpty([])) From c60a9d015ea3e2e100e39d2da5ebe0f2afeb2b97 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Wed, 5 Jul 2023 11:51:41 +0200 Subject: [PATCH 4/5] Add final skippbinning condition --- workflows/mag.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/mag.nf b/workflows/mag.nf index 3747ff01..568a96e2 100644 --- a/workflows/mag.nf +++ b/workflows/mag.nf @@ -955,7 +955,7 @@ workflow MAG { ch_multiqc_files = ch_multiqc_files.mix(PROKKA.out.txt.collect{it[1]}.ifEmpty([])) } - if (!params.skip_binqc && params.binqc_tool == 'busco'){ + if (!params.skip_binning && !params.skip_binqc && params.binqc_tool == 'busco'){ ch_multiqc_files = ch_multiqc_files.mix(BUSCO_QC.out.multiqc.collect().ifEmpty([])) } From 54869cfe1df6f3cf6ff45548415fbcbadaf0eb15 Mon Sep 17 00:00:00 2001 From: James Fellows Yates Date: Thu, 6 Jul 2023 11:20:00 +0200 Subject: [PATCH 5/5] Fix channel mixing --- workflows/mag.nf | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/workflows/mag.nf b/workflows/mag.nf index 568a96e2..1d90b528 100644 --- a/workflows/mag.nf +++ b/workflows/mag.nf @@ -622,6 +622,7 @@ workflow MAG { ch_assemblies, ch_short_reads ) + ch_versions = ch_versions.mix(BINNING_PREPARATION.out.bowtie2_version.first()) } /* @@ -657,6 +658,7 @@ workflow MAG { ch_short_reads ) } + ch_versions = ch_versions.mix(BINNING.out.versions) if ( params.bin_domain_classification ) { @@ -688,11 +690,6 @@ workflow MAG { } } - if ( !params.skip_binning || params.ancient_dna ) { - ch_versions = ch_versions.mix(BINNING_PREPARATION.out.bowtie2_version.first()) - ch_versions = ch_versions.mix(BINNING.out.versions) - } - /* * DAS Tool: binning refinement */ @@ -717,10 +714,8 @@ workflow MAG { } BINNING_REFINEMENT ( ch_contigs_for_binrefinement, ch_prokarya_bins_dastool ) - ch_refined_bins = ch_eukarya_bins_dastool.mix(BINNING_REFINEMENT.out.refined_bins) ch_refined_unbins = BINNING_REFINEMENT.out.refined_unbins - ch_versions = ch_versions.mix(BINNING_REFINEMENT.out.versions) if ( params.postbinning_input == 'raw_bins_only' ) {