Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to only output BAM files #213

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions configs/nextflow.hopper.config
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ params {

run_chanjo2 = true
reanalyze = false

alignment_only = false
}

process {
Expand Down
4 changes: 4 additions & 0 deletions docs/running_the_pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

46 changes: 29 additions & 17 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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} \\
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -2558,7 +2567,7 @@ process gatkcov {
set group, file("*versions.yml") into ch_gatkcov_versions

when:
params.gatkcov
params.gatkcov && !params.alignment_only

script:
"""
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -3248,7 +3257,7 @@ process tiddit {
// stageOutMode 'copy'

when:
params.sv && params.antype == "wgs"
params.sv && params.antype == "wgs" && !params.alignment_only


input:
Expand Down Expand Up @@ -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)

Expand Down