diff --git a/CHANGELOG.md b/CHANGELOG.md index b9fb7e17..b87230e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/conf/modules/generate_clinical_set.config b/conf/modules/generate_clinical_set.config index de4d1b27..cb183ad1 100644 --- a/conf/modules/generate_clinical_set.config +++ b/conf/modules/generate_clinical_set.config @@ -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'" } + } + withName: '.*:GENERATE_CLINICAL_SET_MT:TABIX_BGZIP' { ext.when = !params.skip_vep_filter ext.prefix = { "${meta.id}_mt_${meta.set}" } diff --git a/docs/output.md b/docs/output.md index 1be5e4d5..c96f5700 100644 --- a/docs/output.md +++ b/docs/output.md @@ -529,7 +529,7 @@ We recommend using vcfanno to annotate SNVs with precomputed CADD scores (files Output files - `rank_and_filter/` - - `_mt_ranked_clinical.vcf.gz`: file containing clinically relevant mitochondrial SNVs. + - `_mt_ranked_clinical.vcf.gz`: file containing clinically relevant mitochondrial SNVs, and only contains variants less than 5%VAF by default. - `_mt_ranked_clinical.vcf.gz.tbi`: index of the file containing clinically relevant mitochondrial SNVs. - `_mt_ranked_research.vcf.gz`: file containing mitochondrial SNV annotations with their rank scores. - `_mt_ranked_research.vcf.gz.tbi`: index of the file containing mitochondrial SNV annotations with their rank scores. diff --git a/subworkflows/local/generate_clinical_set.nf b/subworkflows/local/generate_clinical_set.nf index 3e71e6b0..e4b94d8c 100644 --- a/subworkflows/local/generate_clinical_set.nf +++ b/subworkflows/local/generate_clinical_set.nf @@ -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() @@ -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: diff --git a/workflows/raredisease.nf b/workflows/raredisease.nf index c4fda9d1..88b75a3a 100644 --- a/workflows/raredisease.nf +++ b/workflows/raredisease.nf @@ -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) @@ -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) @@ -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) @@ -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 )