From 9ded9c81204a6cdd1170abf88558eef7fc385c9b Mon Sep 17 00:00:00 2001 From: Alexander Koc Date: Mon, 29 Jul 2024 08:49:00 +0200 Subject: [PATCH 1/8] Add alignment_only flag --- configs/nextflow.hopper.config | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/nextflow.hopper.config b/configs/nextflow.hopper.config index 3b88890..c60dd4e 100644 --- a/configs/nextflow.hopper.config +++ b/configs/nextflow.hopper.config @@ -94,6 +94,8 @@ params { run_chanjo2 = true reanalyze = false + + alignment_only = false } process { From 0814e0fdb3d3d0a84d0dc66f02fdf6d5c29bce78 Mon Sep 17 00:00:00 2001 From: Alexander Koc Date: Mon, 29 Jul 2024 08:49:48 +0200 Subject: [PATCH 2/8] Don't process bam when alignment_only run --- main.nf | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/main.nf b/main.nf index 1e6f381..e13bf32 100644 --- a/main.nf +++ b/main.nf @@ -589,7 +589,7 @@ process d4_coverage { container = "${params.container_d4tools}" when: - params.run_chanjo2 + params.run_chanjo2 && !params.alignment_only input: set group, id, file(bam), file(bai) from d4_bam @@ -641,7 +641,7 @@ process depth_onco { // stageOutMode 'copy' when: - params.assay == "swea" + params.assay == "swea" && !params.alignment_only input: set group, id, file(bam), file(bai) from depth_onco @@ -669,7 +669,7 @@ process SMNCopyNumberCaller { tag "$id" when: - params.antype == "wgs" + params.antype == "wgs" && !params.alignment_only input: set group, id, file(bam), file(bai) from smncnc_bam.mix(bam_SMN_choice) @@ -750,7 +750,7 @@ process expansionhunter { // stageOutMode 'copy' when: - params.str + params.str && !params.alignment_only input: set group, id, file(bam), file(bai), sex, type \ @@ -1106,7 +1106,7 @@ process dnascope { container = "${params.container_sentieon}" when: - params.varcall + params.varcall && !params.alignment_only input: set group, id, bam, bai, bqsr from complete_bam.mix(dnascope_bam_choice).join(dnascope_bqsr, by: [0,1]) @@ -1316,7 +1316,7 @@ process freebayes { // stageOutMode 'copy' when: - params.antype == "panel" + params.antype == "panel" && !params.alignment_only input: set group, id, file(bam), file(bai) from bam_freebayes.mix(bam_freebayes_choice) @@ -2557,7 +2557,7 @@ process gatkcov { set group, file("*versions.yml") into ch_gatkcov_versions when: - params.gatkcov + params.gatkcov && !params.alignment_only script: """ @@ -2689,7 +2689,7 @@ process gatk_coverage { tag "$id" when: - params.sv && params.gatkcnv + params.sv && params.gatkcnv && !params.alignment_only input: set group, id, file(bam), file(bai) from bam_gatk.mix(bam_gatk_choice) @@ -2968,7 +2968,7 @@ process manta { // stageOutMode 'copy' when: - params.sv && params.antype == "wgs" + params.sv && params.antype == "wgs" && !params.alignment_only input: set group, id, file(bam), file(bai) from bam_manta.mix(bam_manta_choice) @@ -3015,7 +3015,7 @@ process manta_panel { // stageOutMode 'copy' when: - params.sv && params.antype == "panel" + params.sv && params.antype == "panel" && !params.alignment_only input: set group, id, file(bam), file(bai) from bam_manta_panel.mix(bam_mantapanel_choice) @@ -3061,7 +3061,7 @@ process delly_panel { cache 'deep' when: - params.sv && params.antype == "panel" && params.delly + params.sv && params.antype == "panel" && params.delly && !params.alignment_only input: set group, id, file(bam), file(bai) from bam_delly_panel.mix(bam_dellypanel_choice) @@ -3108,7 +3108,7 @@ process cnvkit_panel { // stageOutMode 'copy' when: - params.sv && params.antype == "panel" + params.sv && params.antype == "panel" && !params.alignment_only input: set group, id, file(bam), file(bai), file(vcf), file(multi), val(INS_SIZE), val(MEAN_DEPTH), val(COV_DEV) from bam_cnvkit_panel.mix(bam_cnvkitpanel_choice).join(vcf_cnvkit, by:[0,1]).join(qc_cnvkit_val, by:[0,1]).view() @@ -3247,7 +3247,7 @@ process tiddit { // stageOutMode 'copy' when: - params.sv && params.antype == "wgs" + params.sv && params.antype == "wgs" && !params.alignment_only input: From b20aa59aa1cf9f0f64e9f845d297818df4582ce5 Mon Sep 17 00:00:00 2001 From: Alexander Koc Date: Mon, 29 Jul 2024 08:53:51 +0200 Subject: [PATCH 3/8] Add alignment_only to a few more processes --- main.nf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.nf b/main.nf index e13bf32..83ea3cd 100644 --- a/main.nf +++ b/main.nf @@ -448,6 +448,9 @@ process bqsr { set group, id, file("${id}.bqsr.table") into dnascope_bqsr set group, file("*versions.yml") into ch_bqsr_versions + when: + !params.alignment_only + script: """ sentieon driver -t ${task.cpus} \\ @@ -1018,7 +1021,7 @@ process melt { set id, group, file(bam), file(bai), val(INS_SIZE), val(MEAN_DEPTH), val(COV_DEV) from bam_melt.mix(bam_melt_choice).join(qc_melt_val) when: - params.run_melt + params.run_melt && !params.alignment_only output: set group, id, file("${id}.melt.merged.vcf") into melt_vcf_nonfiltered From a30e13d0efc591c234b54cdf76220960a3d82d36 Mon Sep 17 00:00:00 2001 From: Alexander Koc Date: Mon, 29 Jul 2024 08:55:39 +0200 Subject: [PATCH 4/8] Add alignment_only condition to mtBAM processes --- main.nf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.nf b/main.nf index 83ea3cd..2388f0a 100644 --- a/main.nf +++ b/main.nf @@ -1507,7 +1507,7 @@ process run_mutect2 { publishDir "${OUTDIR}/vcf", mode: 'copy', overwrite: 'true', pattern: '*.vcf' when: - !params.onco + !params.onco && !params.alignment_only input: set group, id, file(bam), file(bai) from mutserve_bam.groupTuple() @@ -1704,6 +1704,9 @@ process run_eklipse { set group, file("${id}_eklipse.INFO") into eklipse_INFO set group, file("*versions.yml") into ch_run_eklipse_versions + when: + !params.alignment_only + script: """ source activate htslib10 From 0955ad4d477bdf188e5330ba80c769dac9418214 Mon Sep 17 00:00:00 2001 From: Alexander Koc Date: Mon, 29 Jul 2024 11:37:39 +0200 Subject: [PATCH 5/8] Don't generate yaml for align-only --- main.nf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.nf b/main.nf index 2388f0a..1443091 100644 --- a/main.nf +++ b/main.nf @@ -3849,6 +3849,9 @@ process create_yaml { time '5m' memory '1 GB' + when: + !params.alignment_only + input: set group, id, sex, mother, father, phenotype, diagnosis, type, assay, clarity_sample_id, ffpe, analysis, type, file(ped), file(INFO) from yml_diag.join(ped_scout).join(yaml_INFO) From b97ca0763b8d18a7008b1da9334685f7acb23a0c Mon Sep 17 00:00:00 2001 From: Alexander Koc Date: Mon, 29 Jul 2024 14:40:47 +0200 Subject: [PATCH 6/8] BAM only changenotes --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaedfb4..f439b83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +### 3.9.4 +* add flag `--alignment_only` to only output genomic and mito `.bam` and QC data + ### 3.9.3 * Re-optimized profiles wgs and onco. More memory allocations From 4ced2ae55a533912990dd7ebbee4ebc1df7f944f Mon Sep 17 00:00:00 2001 From: Alexander Koc Date: Tue, 30 Jul 2024 08:44:54 +0200 Subject: [PATCH 7/8] Update docs --- docs/running_the_pipeline.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/running_the_pipeline.md b/docs/running_the_pipeline.md index 43b8ac0..244b7ed 100644 --- a/docs/running_the_pipeline.md +++ b/docs/running_the_pipeline.md @@ -103,3 +103,7 @@ Assuming it is named `jobfile.run`, then it can be queued by running: sbatch jobfile.run ``` +## BAM and Sequencing QC-only run + +For an alignment and QC-only run, where the pipeline only outputs genomic and mitochondrial BAM files and associated QC data, pass the `--alignment_only` to `nextflow run` + From 085c08f9bacdd532eccbc4b8b82ebb4cd4b289bb Mon Sep 17 00:00:00 2001 From: Alexander Koc Date: Tue, 13 Aug 2024 11:38:03 +0200 Subject: [PATCH 8/8] Drop QC data output from align only runs --- main.nf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.nf b/main.nf index 91a162d..f5105dc 100644 --- a/main.nf +++ b/main.nf @@ -488,6 +488,9 @@ process sentieon_qc { // stageOutMode 'copy' container = "${params.container_sentieon}" + when: + !params.alignment_only + input: set id, group, file(bam), file(bai) from qc_bam.mix(bam_qc_choice) @@ -1437,8 +1440,8 @@ process sentieon_mitochondrial_qc { container = "${params.container_sentieon}" when: - params.antype == "wgs" - + params.antype == "wgs" && !params.alignment_only + input: set group, id, file(bam), file(bai) from qc_mito_bam