Skip to content

Commit 7b531ea

Browse files
Merge pull request #448 from FriederikeHanssen/skip_bqsr
allow tp skip bqsr
2 parents 57c4140 + 3bad5be commit 7b531ea

File tree

4 files changed

+54
-35
lines changed

4 files changed

+54
-35
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- [##448](https://github.com/nf-core/sarek/pull/448) - Allow to skip base quality recalibration with `--skip_bqsr`
13+
1214
### Changed
1315

1416
### Fixed

nextflow.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ params {
4747
skip_markduplicates = false // Do not skip markDuplicates by default
4848
sequencing_center = null // No sequencing center to be written in BAM header in MapReads process
4949

50+
//BQSR
51+
skip_bqsr = false
52+
5053
// Variant Calling
5154
ascat_ploidy = null // Use default value
5255
ascat_purity = null // Use default value

nextflow_schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@
219219
"fa_icon": "fas fa-fast-forward",
220220
"description": "Skip GATK MarkDuplicates",
221221
"help_text": "This params will also save the mapped BAMS, to enable restart from step `prepare_recalibration`"
222+
},
223+
"skip_bqsr": {
224+
"type": "boolean",
225+
"default": false,
226+
"fa_icon": "fas fa-fast-forward",
227+
"description": "Skip Base Quality Recalibration"
222228
}
223229
}
224230
},

workflows/sarek.nf

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -383,48 +383,56 @@ workflow SAREK {
383383
qc_reports = qc_reports.mix(MARKDUPLICATES.out.qc.collect{it[1]}.ifEmpty([]))
384384

385385
// STEP 3: Create recalibration tables
386-
PREPARE_RECALIBRATION(
387-
cram_markduplicates,
388-
('bqsr' in params.use_gatk_spark),
389-
dict,
390-
fai,
391-
fasta,
392-
intervals,
393-
num_intervals,
394-
known_sites,
395-
known_sites_tbi,
396-
params.no_intervals)
397-
398-
table_bqsr = PREPARE_RECALIBRATION.out.table_bqsr
399-
PREPARE_RECALIBRATION_CSV(table_bqsr)
400-
401-
cram_applybqsr = cram_markduplicates.join(table_bqsr)
386+
if(!params.skip_bqsr){
387+
PREPARE_RECALIBRATION(
388+
cram_markduplicates,
389+
('bqsr' in params.use_gatk_spark),
390+
dict,
391+
fai,
392+
fasta,
393+
intervals,
394+
num_intervals,
395+
known_sites,
396+
known_sites_tbi,
397+
params.no_intervals)
398+
399+
table_bqsr = PREPARE_RECALIBRATION.out.table_bqsr
400+
PREPARE_RECALIBRATION_CSV(table_bqsr)
401+
402+
cram_applybqsr = cram_markduplicates.join(table_bqsr)
403+
}
402404
}
403405

404406
if (step == 'recalibrate') bam_applybqsr = input_sample
405407

406408
if (step in ['mapping', 'preparerecalibration', 'recalibrate']) {
407-
// STEP 4: RECALIBRATING
408-
RECALIBRATE(
409-
('bqsr' in params.use_gatk_spark),
410-
('bamqc' in skip_qc),
411-
('samtools' in skip_qc),
412-
cram_applybqsr,
413-
dict,
414-
fai,
415-
fasta,
416-
intervals,
417-
num_intervals,
418-
target_bed)
419-
420-
cram_recalibrated = RECALIBRATE.out.cram
421-
cram_recalibrated_qc = RECALIBRATE.out.qc
422409

423-
RECALIBRATE_CSV(cram_recalibrated)
424-
425-
qc_reports = qc_reports.mix(cram_recalibrated_qc.collect{it[1]}.ifEmpty([]))
410+
if(!params.skip_bqsr){
411+
// STEP 4: RECALIBRATING
412+
RECALIBRATE(
413+
('bqsr' in params.use_gatk_spark),
414+
('bamqc' in skip_qc),
415+
('samtools' in skip_qc),
416+
cram_applybqsr,
417+
dict,
418+
fai,
419+
fasta,
420+
intervals,
421+
num_intervals,
422+
target_bed)
423+
424+
cram_recalibrated = RECALIBRATE.out.cram
425+
cram_recalibrated_qc = RECALIBRATE.out.qc
426+
427+
RECALIBRATE_CSV(cram_recalibrated)
428+
429+
qc_reports = qc_reports.mix(cram_recalibrated_qc.collect{it[1]}.ifEmpty([]))
430+
cram_variant_calling = cram_recalibrated
431+
432+
}else{
433+
cram_variant_calling = cram_markduplicates
434+
}
426435

427-
cram_variant_calling = cram_recalibrated
428436
}
429437

430438
if (step in 'variantcalling') cram_variant_calling = input_sample

0 commit comments

Comments
 (0)