Skip to content

Commit

Permalink
Merge pull request #557 from FriederikeHanssen/single_sample_gatk
Browse files Browse the repository at this point in the history
Haplotypecaller fix + single sample germline VC
  • Loading branch information
maxulysse authored Jun 16, 2022
2 parents a3d836b + cc5fd50 commit 6bfbdb1
Show file tree
Hide file tree
Showing 16 changed files with 471 additions and 101 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#538](https://github.com/nf-core/sarek/pull/538) - Add param `--seq_platform`, default: `ILLUMINA`
- [#545](https://github.com/nf-core/sarek/pull/545) - Add modules and subworkflows for `cnvkit` tumor_only mode
- [#540](https://github.com/nf-core/sarek/pull/540) - Add modules and subworkflows for `cnvkit` somatic mode
- [#557](https://github.com/nf-core/sarek/pull/557) - Add `Haplotypecaller` single sample mode together with `CNNScoreVariants` and `FilterVariantTranches`
- [#576](https://github.com/nf-core/sarek/pull/576) - Add modules and subworkflows for `cnvkit` germline mode

### Changed
Expand Down
30 changes: 24 additions & 6 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ process {
}

withName: 'TABIX_KNOWN_INDELS' {
ext.when = { !params.known_indels_tbi && params.known_indels && (params.step == 'mapping' || params.step == "markduplicates" || params.step == 'prepare_recalibration') }
ext.when = { !params.known_indels_tbi && params.known_indels && (params.step == 'mapping' || params.step == "markduplicates" || params.step == 'prepare_recalibration' || (params.tools && params.tools.contains('haplotypecaller')) ) }
publishDir = [
enabled: params.save_reference,
mode: params.publish_dir_mode,
Expand Down Expand Up @@ -549,18 +549,20 @@ process{
}

// HAPLOTYPECALLER
withName: 'MERGE_HAPLOTYPECALLER' {
ext.prefix = {"${meta.id}.g"}
withName: 'MERGE_HAPLOTYPECALLER.*' {
ext.prefix = { params.joint_germline ? "${meta.id}.g" : "${meta.id}" }
publishDir = [
enabled: !params.no_intervals,
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/haplotypecaller" },
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
withName: 'MERGE_HAPLOTYPECALLER_FILTERED' {
ext.prefix = { "${meta.id}.filtered" }
}
withName: 'HAPLOTYPECALLER' {
ext.args = { params.joint_germline ? "-ERC GVCF" : "" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}.g" : "${meta.id}_${intervals.simpleName}.g" }
ext.prefix = { meta.num_intervals <= 1 ? ( params.joint_germline ? "${meta.id}.g" : "${meta.id}" ) : ( params.joint_germline ? "${meta.id}_${intervals.simpleName}.g" :"${meta.id}_${intervals.simpleName}" ) }
ext.when = { params.tools && params.tools.contains('haplotypecaller') }
publishDir = [
mode: params.publish_dir_mode,
Expand All @@ -569,10 +571,26 @@ process{
saveAs: { meta.num_intervals > 1 ? null : "haplotypecaller/${it}" }
]
}
withName: 'CNNSCOREVARIANTS' {
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}" : "${meta.id}_${intervals.simpleName}" }
publishDir = [
enabled: false
]
}
withName: 'FILTERVARIANTTRANCHES' {
ext.args = { "--info-key CNN_1D" }
ext.prefix = { meta.num_intervals <= 1 ? "${meta.id}" : "${meta.id}_${intervals.simpleName}" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/"},
pattern: "*{vcf.gz,vcf.gz.tbi}",
saveAs: { meta.num_intervals > 1 ? null : "haplotypecaller/${it}" }
]
}

withName: 'GENOTYPEGVCFS' {
ext.when = { params.tools && params.tools.contains('haplotypecaller') && params.joint_germline}
publishDir = [
enabled: params.generate_gvcf,
mode: params.publish_dir_mode,
path: { "${params.outdir}/variant_calling/${meta.id}/haplotypecaller"},
pattern: "*{vcf.gz,vcf.gz.tbi}"
Expand Down
2 changes: 1 addition & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ profiles {
tools_germline {
params.input = "${baseDir}/tests/csv/3.0/recalibrated_germline.csv"
params.dbsnp = params.test_data['homo_sapiens']['genome']['dbsnp_138_hg38_21_vcf_gz']
params.known_indels = params.test_data['homo_sapiens']['genome']['mills_and_1000g_indels_21_vcf_gz']
params.fasta = params.test_data['homo_sapiens']['genome']['genome_21_fasta']
params.intervals = params.test_data['homo_sapiens']['genome']['genome_21_multi_interval_bed']
params.step = 'variant_calling'
params.joint_germline = true
params.wes = true

params.nucleotides_per_second = 20
Expand Down
6 changes: 6 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@
"gatk4/calculatecontamination": {
"git_sha": "169b2b96c1167f89ab07127b7057c1d90a6996c7"
},
"gatk4/cnnscorevariants": {
"git_sha": "5d72500d601432f5396e9022c3a709854197db1a"
},
"gatk4/createsequencedictionary": {
"git_sha": "169b2b96c1167f89ab07127b7057c1d90a6996c7"
},
Expand All @@ -111,6 +114,9 @@
"gatk4/filtermutectcalls": {
"git_sha": "169b2b96c1167f89ab07127b7057c1d90a6996c7"
},
"gatk4/filtervarianttranches": {
"git_sha": "175ea9b7f95a0e2fd3679f7a052c6dcb60b61a6e"
},
"gatk4/gatherbqsrreports": {
"git_sha": "169b2b96c1167f89ab07127b7057c1d90a6996c7"
},
Expand Down
58 changes: 58 additions & 0 deletions modules/nf-core/modules/gatk4/cnnscorevariants/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions modules/nf-core/modules/gatk4/cnnscorevariants/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions modules/nf-core/modules/gatk4/filtervarianttranches/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions modules/nf-core/modules/gatk4/filtervarianttranches/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ params {
cf_minqual = 0 // ControlFreec default values
cf_window = null // by default we are not using this in Control-FREEC

generate_gvcf = false // g.vcf are not produced by HaplotypeCaller by default
pon = null // No default PON (Panel of Normals) file for GATK Mutect2 / Sentieon TNscope
pon_tbi = null // No default PON index for GATK Mutect2 / Sentieon TNscope
ignore_soft_clipped_bases = false // no --dont-use-soft-clipped-bases for GATK Mutect2
wes = false // Set to true, if data is exome/targeted sequencing data. Used to use correct models in various variant callers
joint_germline = false //
joint_germline = false // g.vcf & joint germline calling are not run by default if HaplotypeCaller is selected


// Annotation
vep_dbnsfp = null // dbnsfp plugin disabled within VEP
Expand Down
Loading

0 comments on commit 6bfbdb1

Please sign in to comment.