diff --git a/CHANGELOG.md b/CHANGELOG.md index 50f377b..780cca8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # CHANGELOG +### TBA + +* add flag `--alignment_only` to only output genomic and mito `.bam` and QC data + ### 3.9.4 + * Use -K flag in bwa-mem for consistent results ### 3.9.3 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 { 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` + diff --git a/main.nf b/main.nf index 9851314..f5105dc 100644 --- a/main.nf +++ b/main.nf @@ -449,6 +449,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} \\ @@ -485,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) @@ -590,7 +596,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 @@ -642,7 +648,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 @@ -670,7 +676,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) @@ -751,7 +757,7 @@ process expansionhunter { // stageOutMode 'copy' when: - params.str + params.str && !params.alignment_only input: set group, id, file(bam), file(bai), sex, type \ @@ -1019,7 +1025,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 @@ -1107,7 +1113,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]) @@ -1317,7 +1323,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) @@ -1434,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 @@ -1505,7 +1511,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() @@ -1702,6 +1708,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 @@ -2558,7 +2567,7 @@ process gatkcov { set group, file("*versions.yml") into ch_gatkcov_versions when: - params.gatkcov + params.gatkcov && !params.alignment_only script: """ @@ -2690,7 +2699,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) @@ -2969,7 +2978,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) @@ -3016,7 +3025,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) @@ -3062,7 +3071,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) @@ -3109,7 +3118,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() @@ -3248,7 +3257,7 @@ process tiddit { // stageOutMode 'copy' when: - params.sv && params.antype == "wgs" + params.sv && params.antype == "wgs" && !params.alignment_only input: @@ -3844,6 +3853,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)