Skip to content

Commit

Permalink
Merge pull request #598 from nf-core/deepvar_udpate
Browse files Browse the repository at this point in the history
Add option to supply bed file with PAR regions & enable haploid analysis for males
  • Loading branch information
ramprasadn authored Aug 15, 2024
2 parents 5ce1f18 + 24b2b42 commit b712e0c
Show file tree
Hide file tree
Showing 14 changed files with 189 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Added`

- A new parameter `par_bed` to pass a PAR bed files to deepvariant [#598](https://github.com/nf-core/raredisease/pull/598)
- A new functionality to pass gzipped resources to vcfanno_extra_resources [#589](https://github.com/nf-core/raredisease/pull/589)
- A new parameter `vcfanno_extra_resources` to pass an extra resource to vcfanno [#588](https://github.com/nf-core/raredisease/pull/588)
- A new parameter `scatter_count` to control how many interval files are created from a genome (used to parallelize annotations) [#585](https://github.com/nf-core/raredisease/pull/585)
Expand All @@ -19,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Changed`

- Males' X and Y chromosomes will be treated as haploids during variant calling by deepvariant [#598](https://github.com/nf-core/raredisease/pull/598)
- Acceptable type for lane field in the samplesheet from number to string [#597](https://github.com/nf-core/raredisease/pull/597)
- Allow `0` as a valid value for `sex` in the samplesheet [#595](https://github.com/nf-core/raredisease/pull/595)
- Updated deepvariant to version 1.6.1 [#587](https://github.com/nf-core/raredisease/pull/587)
Expand Down Expand Up @@ -57,6 +59,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
| | scatter_count |
| | vcfanno_extra_resources |

### Tool updates

| Tool | Old version | New version |
| ----------- | ----------- | ----------- |
| Deepvariant | 1.5.0 | 1.6.1 |

## 2.1.0 - Obelix [2024-05-29]

### `Added`
Expand Down
5 changes: 4 additions & 1 deletion conf/modules/call_snv_deepvariant.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ process {
}

withName: '.*CALL_SNV_DEEPVARIANT:DEEPVARIANT' {
ext.args = { "--model_type=${params.analysis_type.toUpperCase()}" }
ext.args = { [
"--model_type=${params.analysis_type.toUpperCase()}",
meta.sex == "1" ? params.genome == 'GRCh37' ? '--haploid_contigs="X,Y"' : '--haploid_contigs="chrX,chrY"' : ''
].join(' ') }
ext.prefix = { "${meta.id}_deepvar" }
}

Expand Down
2 changes: 2 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,12 @@ The mandatory and optional parameters for each category are tabulated below.
| ml_model<sup>2</sup> | known_dbsnp_tbi<sup>2</sup> |
| analysis_type<sup>3</sup> | call_interval<sup>2</sup> |
| | known_dbsnp_tbi<sup>2</sup> |
| | par_bed<sup>4</sup> |

<sup>1</sup>Default variant caller is DeepVariant, but you have the option to use Sentieon as well.<br />
<sup>2</sup>These parameters are only used by Sentieon.<br />
<sup>3</sup>Default is WGS, but you have the option to choose WES as well.<br />
<sup>4</sup>This parameter is only used by Deepvariant.<br />

##### 5. Variant calling - Structural variants

Expand Down
1 change: 1 addition & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ params.mobile_element_references = getGenomeAttribute('mobile_element_refe
params.mobile_element_svdb_annotations = getGenomeAttribute('mobile_element_svdb_annotations')
params.ml_model = getGenomeAttribute('ml_model')
params.mt_fasta = getGenomeAttribute('mt_fasta')
params.par_bed = getGenomeAttribute('par_bed')
params.ploidy_model = getGenomeAttribute('ploidy_model')
params.reduced_penetrance = getGenomeAttribute('reduced_penetrance')
params.readcount_intervals = getGenomeAttribute('readcount_intervals')
Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
},
"deepvariant": {
"branch": "master",
"git_sha": "ccf06a896339d2a4ed8594daa9f9adb827cb8189",
"git_sha": "a7e8b8afd4fa82f20d745fa778bfdbf39c1f7efb",
"installed_by": ["modules"]
},
"eklipse": {
Expand Down
3 changes: 3 additions & 0 deletions modules/nf-core/deepvariant/main.nf

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

9 changes: 9 additions & 0 deletions modules/nf-core/deepvariant/meta.yml

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

48 changes: 48 additions & 0 deletions modules/nf-core/deepvariant/tests/main.nf.test

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

91 changes: 90 additions & 1 deletion modules/nf-core/deepvariant/tests/main.nf.test.snap

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

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

8 changes: 8 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,14 @@
"description": "Path to mitochondrial FASTA genome file.",
"fa_icon": "fas fa-file"
},
"par_bed": {
"type": "string",
"exists": true,
"format": "path",
"fa_icon": "fas fa-file",
"pattern": "^\\S+\\.bed(\\.gz)?$",
"description": "Path to a BED file containing PAR regions (used by deepvariant)."
},
"ploidy_model": {
"type": "string",
"exists": true,
Expand Down
2 changes: 2 additions & 0 deletions subworkflows/local/call_snv.nf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ workflow CALL_SNV {
ch_dbsnp_tbi // channel: [optional] [ val(meta), path(tbi) ]
ch_call_interval // channel: [mandatory] [ path(intervals) ]
ch_ml_model // channel: [mandatory] [ path(model) ]
ch_par_bed // channel: [optional] [ val(meta), path(bed) ]
ch_case_info // channel: [mandatory] [ val(case_info) ]
ch_foundin_header // channel: [mandatory] [ path(header) ]
ch_pcr_indel_model // channel: [optional] [ val(sentieon_dnascope_pcr_indel_model) ]
Expand All @@ -50,6 +51,7 @@ workflow CALL_SNV {
ch_genome_bam_bai,
ch_genome_fasta,
ch_genome_fai,
ch_par_bed,
ch_case_info,
ch_foundin_header,
ch_genome_chrsizes
Expand Down
3 changes: 2 additions & 1 deletion subworkflows/local/variant_calling/call_snv_deepvariant.nf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ workflow CALL_SNV_DEEPVARIANT {
ch_bam_bai // channel: [mandatory] [ val(meta), path(bam), path(bai) ]
ch_genome_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
ch_par_bed // channel: [optional] [ val(meta), path(bed) ]
ch_case_info // channel: [mandatory] [ val(case_info) ]
ch_foundin_header // channel: [mandatory] [ path(header) ]
ch_genome_chrsizes // channel: [mandatory] [ path(chrsizes) ]
Expand All @@ -28,7 +29,7 @@ workflow CALL_SNV_DEEPVARIANT {
}
.set { ch_deepvar_in }

DEEPVARIANT ( ch_deepvar_in, ch_genome_fasta, ch_genome_fai, [[],[]] )
DEEPVARIANT ( ch_deepvar_in, ch_genome_fasta, ch_genome_fai, [[],[]], ch_par_bed )
DEEPVARIANT.out.gvcf
.collect{it[1]}
.toList()
Expand Down
3 changes: 3 additions & 0 deletions workflows/raredisease.nf
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ workflow RAREDISEASE {
ch_mtshift_fai = ch_references.mtshift_fai
ch_mtshift_fasta = ch_references.mtshift_fasta
ch_mtshift_intervals = ch_references.mtshift_intervals
ch_par_bed = params.par_bed ? Channel.fromPath(params.par_bed).map{ it -> [[id:'par_bed'], it] }.collect()
: Channel.value([[],[]])
ch_ploidy_model = params.ploidy_model ? Channel.fromPath(params.ploidy_model).map{ it -> [[id:it[0].simpleName], it] }.collect()
: Channel.empty()
ch_readcount_intervals = params.readcount_intervals ? Channel.fromPath(params.readcount_intervals).collect()
Expand Down Expand Up @@ -502,6 +504,7 @@ workflow RAREDISEASE {
ch_dbsnp_tbi,
ch_call_interval,
ch_ml_model,
ch_par_bed,
ch_case_info,
ch_foundin_header,
Channel.value(params.sentieon_dnascope_pcr_indel_model)
Expand Down

0 comments on commit b712e0c

Please sign in to comment.