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

5% frequency threshold for mitochondrial clinical vcfs #616

Merged
merged 6 commits into from
Sep 25, 2024
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Changed`

- Report only variants above 5% heteroplasmy in the clinical vcf file for mitochondria [#616](https://github.com/nf-core/raredisease/pull/616)

### `Fixed`

### Parameters
Expand Down
8 changes: 7 additions & 1 deletion conf/modules/generate_clinical_set.config
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ process {
process {
withName: '.*:GENERATE_CLINICAL_SET_MT:ENSEMBLVEP_FILTERVEP' {
ext.when = !params.skip_vep_filter
ext.prefix = { "${meta.id}_mt_${meta.set}" }
ext.prefix = { "${meta.id}_mt_filtervep_${meta.set}" }
ext.args = { "--filter \"HGNC_ID in ${feature_file}\"" }
}

withName: '.*:GENERATE_CLINICAL_SET_MT:BCFTOOLS_FILTER' {
ext.when = !params.skip_vep_filter
ext.prefix = { "${meta.id}_mt_${meta.set}" }
ext.args = { "-Oz -i 'AF>0.05'" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be good to add a line in the documentation saying that the default is not to output variants with a VAF below 5%.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! 👍🏻

}

withName: '.*:GENERATE_CLINICAL_SET_MT:TABIX_BGZIP' {
ext.when = !params.skip_vep_filter
ext.prefix = { "${meta.id}_mt_${meta.set}" }
Expand Down
2 changes: 1 addition & 1 deletion docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ We recommend using vcfanno to annotate SNVs with precomputed CADD scores (files
<summary>Output files</summary>

- `rank_and_filter/`
- `<case_id>_mt_ranked_clinical.vcf.gz`: file containing clinically relevant mitochondrial SNVs.
- `<case_id>_mt_ranked_clinical.vcf.gz`: file containing clinically relevant mitochondrial SNVs, and only contains variants less than 5%VAF by default.
- `<case_id>_mt_ranked_clinical.vcf.gz.tbi`: index of the file containing clinically relevant mitochondrial SNVs.
- `<case_id>_mt_ranked_research.vcf.gz`: file containing mitochondrial SNV annotations with their rank scores.
- `<case_id>_mt_ranked_research.vcf.gz.tbi`: index of the file containing mitochondrial SNV annotations with their rank scores.
Expand Down
15 changes: 12 additions & 3 deletions subworkflows/local/generate_clinical_set.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
include { ENSEMBLVEP_FILTERVEP } from '../../modules/nf-core/ensemblvep/filtervep'
include { TABIX_BGZIP } from '../../modules/nf-core/tabix/bgzip'
include { TABIX_TABIX } from '../../modules/nf-core/tabix/tabix'
include { BCFTOOLS_FILTER } from '../../modules/nf-core/bcftools/filter'

workflow GENERATE_CLINICAL_SET {
take:
ch_vcf // channel: [mandatory] [ val(meta), path(vcf) ]
ch_hgnc_ids // channel: [mandatory] [ val(hgnc_ids) ]
val_ismt // value: if mitochondria, set to true

main:
ch_versions = Channel.empty()
Expand All @@ -28,16 +30,23 @@ workflow GENERATE_CLINICAL_SET {
.output
.set { ch_filtervep_out }

TABIX_BGZIP( ch_filtervep_out )
if (val_ismt) {
BCFTOOLS_FILTER (ch_filtervep_out)
ch_clinical = BCFTOOLS_FILTER.out.vcf
ch_versions = ch_versions.mix( BCFTOOLS_FILTER.out.versions )
} else {
TABIX_BGZIP( ch_filtervep_out )
ch_clinical = TABIX_BGZIP.out.output
ch_versions = ch_versions.mix( TABIX_BGZIP.out.versions )
}

ch_clin_research_vcf.research
.mix( TABIX_BGZIP.out.output )
.mix( ch_clinical )
.set { ch_clin_research_split }

TABIX_TABIX( ch_clin_research_split )

ch_versions = ch_versions.mix( ENSEMBLVEP_FILTERVEP.out.versions )
ch_versions = ch_versions.mix( TABIX_BGZIP.out.versions )
ch_versions = ch_versions.mix( TABIX_TABIX.out.versions )

emit:
Expand Down
12 changes: 8 additions & 4 deletions workflows/raredisease.nf
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,8 @@ workflow RAREDISEASE {

GENERATE_CLINICAL_SET_SNV(
ch_snv_annotate.vcf_ann,
ch_hgnc_ids
ch_hgnc_ids,
false
)
ch_versions = ch_versions.mix(GENERATE_CLINICAL_SET_SNV.out.versions)

Expand Down Expand Up @@ -602,7 +603,8 @@ workflow RAREDISEASE {

GENERATE_CLINICAL_SET_MT(
ch_mt_annotate.vcf_ann,
ch_hgnc_ids
ch_hgnc_ids,
true
)
ch_versions = ch_versions.mix(GENERATE_CLINICAL_SET_MT.out.versions)

Expand Down Expand Up @@ -677,7 +679,8 @@ workflow RAREDISEASE {

GENERATE_CLINICAL_SET_SV(
ch_sv_annotate.vcf_ann,
ch_hgnc_ids
ch_hgnc_ids,
false
)
ch_versions = ch_versions.mix(GENERATE_CLINICAL_SET_SV.out.versions)

Expand Down Expand Up @@ -738,7 +741,8 @@ workflow RAREDISEASE {

GENERATE_CLINICAL_SET_ME(
ANNOTATE_MOBILE_ELEMENTS.out.vcf,
ch_hgnc_ids
ch_hgnc_ids,
false
)
ch_versions = ch_versions.mix( GENERATE_CLINICAL_SET_ME.out.versions )

Expand Down