diff --git a/CHANGELOG.md b/CHANGELOG.md index 2db8af46..c2e58fd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Changed` +- Refactored code to only handle clinical variants in the generate_clinical_set workflow [#693](https://github.com/nf-core/raredisease/pull/693) - Updated `add_most_severe_consequence` and `add_most_severe_pli` to fix spelling and language server warnings [#689](https://github.com/nf-core/raredisease/pull/689) - Refactored code to address issues highlighted by language server [#688](https://github.com/nf-core/raredisease/pull/688) - Changed for loop to each in create_pedigree_file [#683](https://github.com/nf-core/raredisease/pull/683) diff --git a/subworkflows/local/annotate_mobile_elements.nf b/subworkflows/local/annotate_mobile_elements.nf index cfd66de9..2d08ca07 100644 --- a/subworkflows/local/annotate_mobile_elements.nf +++ b/subworkflows/local/annotate_mobile_elements.nf @@ -78,6 +78,6 @@ workflow ANNOTATE_MOBILE_ELEMENTS { ch_versions = ch_versions.mix( BCFTOOLS_VIEW_FILTER.out.versions ) emit: - vcf = BCFTOOLS_VIEW_FILTER.out.vcf // channel: [ val(meta), path(vcf) ] + vcf_ann = BCFTOOLS_VIEW_FILTER.out.vcf // channel: [ val(meta), path(vcf) ] versions = ch_versions // channel: [ path(versions.yml) ] } diff --git a/subworkflows/local/annotate_mt_snvs.nf b/subworkflows/local/annotate_mt_snvs.nf index 306d8ed0..b1fba8b0 100644 --- a/subworkflows/local/annotate_mt_snvs.nf +++ b/subworkflows/local/annotate_mt_snvs.nf @@ -31,7 +31,6 @@ workflow ANNOTATE_MT_SNVS { main: ch_versions = Channel.empty() ch_haplog = Channel.empty() - ch_haplogrep_in = Channel.empty() // add prefix to meta ch_mt_vcf diff --git a/subworkflows/local/generate_clinical_set.nf b/subworkflows/local/generate_clinical_set.nf index 8fb541af..3ed94ad6 100644 --- a/subworkflows/local/generate_clinical_set.nf +++ b/subworkflows/local/generate_clinical_set.nf @@ -4,7 +4,6 @@ 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 { @@ -16,15 +15,8 @@ workflow GENERATE_CLINICAL_SET { main: ch_versions = Channel.empty() - ch_vcf - .multiMap { meta, vcf -> - clinical: [ meta + [ set: "clinical" ], vcf ] - research: [ meta + [ set: "research" ], vcf ] - } - .set { ch_clin_research_vcf } - ENSEMBLVEP_FILTERVEP( - ch_clin_research_vcf.clinical, + ch_vcf, ch_hgnc_ids ) .output @@ -40,17 +32,9 @@ workflow GENERATE_CLINICAL_SET { ch_versions = ch_versions.mix( TABIX_BGZIP.out.versions ) } - ch_clin_research_vcf.research - .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_TABIX.out.versions ) emit: - vcf = ch_clin_research_split // channel: [ val(meta), path(vcf) ] - tbi = TABIX_TABIX.out.tbi // channel: [ val(meta), path(tbi) ] - versions = ch_versions // channel: [ path(versions.yml) ] + vcf = ch_clinical // channel: [ val(meta), path(vcf) ] + versions = ch_versions // channel: [ path(versions.yml) ] } diff --git a/workflows/raredisease.nf b/workflows/raredisease.nf index e03021b2..ad905885 100644 --- a/workflows/raredisease.nf +++ b/workflows/raredisease.nf @@ -496,15 +496,23 @@ workflow RAREDISEASE { ).set { ch_snv_annotate } ch_versions = ch_versions.mix(ch_snv_annotate.versions) + ch_snv_annotate.vcf_ann + .multiMap { meta, vcf -> + clinical: [ meta + [ set: "clinical" ], vcf ] + research: [ meta + [ set: "research" ], vcf ] + } + .set { ch_clin_research_snv_vcf } + GENERATE_CLINICAL_SET_SNV( - ch_snv_annotate.vcf_ann, + ch_clin_research_snv_vcf.clinical, ch_hgnc_ids, false ) ch_versions = ch_versions.mix(GENERATE_CLINICAL_SET_SNV.out.versions) + ch_ann_csq_snv_in = GENERATE_CLINICAL_SET_SNV.out.vcf.mix(ch_clin_research_snv_vcf.research) ANN_CSQ_PLI_SNV ( - GENERATE_CLINICAL_SET_SNV.out.vcf, + ch_ann_csq_snv_in, ch_variant_consequences_snv ) ch_versions = ch_versions.mix(ANN_CSQ_PLI_SNV.out.versions) @@ -549,15 +557,23 @@ workflow RAREDISEASE { ).set { ch_mt_annotate } ch_versions = ch_versions.mix(ch_mt_annotate.versions) + ch_mt_annotate.vcf_ann + .multiMap { meta, vcf -> + clinical: [ meta + [ set: "clinical" ], vcf ] + research: [ meta + [ set: "research" ], vcf ] + } + .set { ch_clin_research_mt_vcf } + GENERATE_CLINICAL_SET_MT( - ch_mt_annotate.vcf_ann, + ch_clin_research_mt_vcf.clinical, ch_hgnc_ids, true ) ch_versions = ch_versions.mix(GENERATE_CLINICAL_SET_MT.out.versions) + ch_ann_csq_mtsnv_in = GENERATE_CLINICAL_SET_MT.out.vcf.mix(ch_clin_research_mt_vcf.research) ANN_CSQ_PLI_MT( - GENERATE_CLINICAL_SET_MT.out.vcf, + ch_ann_csq_mtsnv_in, ch_variant_consequences_snv ) ch_versions = ch_versions.mix(ANN_CSQ_PLI_MT.out.versions) @@ -625,15 +641,24 @@ workflow RAREDISEASE { ).set { ch_sv_annotate } ch_versions = ch_versions.mix(ch_sv_annotate.versions) + ch_sv_annotate.vcf_ann + .multiMap { meta, vcf -> + clinical: [ meta + [ set: "clinical" ], vcf ] + research: [ meta + [ set: "research" ], vcf ] + } + .set { ch_clin_research_sv_vcf } + GENERATE_CLINICAL_SET_SV( - ch_sv_annotate.vcf_ann, + ch_clin_research_sv_vcf.clinical, ch_hgnc_ids, false ) ch_versions = ch_versions.mix(GENERATE_CLINICAL_SET_SV.out.versions) + ch_ann_csq_sv_in = GENERATE_CLINICAL_SET_SV.out.vcf.mix(ch_clin_research_sv_vcf.research) + ANN_CSQ_PLI_SV ( - GENERATE_CLINICAL_SET_SV.out.vcf, + ch_ann_csq_sv_in, ch_variant_consequences_sv ) ch_versions = ch_versions.mix(ANN_CSQ_PLI_SV.out.versions) @@ -684,16 +709,25 @@ workflow RAREDISEASE { params.genome, params.vep_cache_version, ch_vep_extra_files - ) + ).set { ch_me_annotate } ch_versions = ch_versions.mix(ANNOTATE_MOBILE_ELEMENTS.out.versions) + ch_me_annotate.vcf_ann + .multiMap { meta, vcf -> + clinical: [ meta + [ set: "clinical" ], vcf ] + research: [ meta + [ set: "research" ], vcf ] + } + .set { ch_clin_research_me_vcf } + GENERATE_CLINICAL_SET_ME( - ANNOTATE_MOBILE_ELEMENTS.out.vcf, + ch_clin_research_me_vcf.clinical, ch_hgnc_ids, false ) ch_versions = ch_versions.mix( GENERATE_CLINICAL_SET_ME.out.versions ) + ch_ann_csq_me_in = GENERATE_CLINICAL_SET_ME.out.vcf.mix(ch_clin_research_me_vcf.research) + ANN_CSQ_PLI_ME( GENERATE_CLINICAL_SET_ME.out.vcf, ch_variant_consequences_sv