diff --git a/CHANGELOG.md b/CHANGELOG.md index 94d73091..5ab10277 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Added` +- Two new parameters `skip_repeat_annotation` and `skip_repeat_calling` to skip calling and annotation of repeat expansions [#574](https://github.com/nf-core/raredisease/pull/574) - A new parameter `skip_smncopynumbercaller` to skip smncopynumbercaller module[#574](https://github.com/nf-core/raredisease/pull/574) - A new parameter `skip_sv_calling` to skip sv calling workflow [#572](https://github.com/nf-core/raredisease/pull/572) - Two new parameters `skip_snv_calling` and `skip_repeat_analysis` to skip snv calling and repeat analysis respectively [#571](https://github.com/nf-core/raredisease/pull/571) @@ -14,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Changed` +- Removed `skip_repeat_analysis` added in #571 [#574](https://github.com/nf-core/raredisease/pull/574) - Remove several skip parameters that had been included in the pipeline to avoid failed CI tests (see parameters table below) [#574](https://github.com/nf-core/raredisease/pull/574) - `readcount_intervals` parameter is now mandatory for running germlinecnvcaller. [#570](https://github.com/nf-core/raredisease/pull/570) - Turn off CNVnator, TIDDIT, SMNCopyNumberCaller, Gens, and Vcf2cytosure for targeted analysis [#573](https://github.com/nf-core/raredisease/pull/573) @@ -29,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | --------------- | ------------------------ | | | mbuffer_mem | | | samtools_sort_threads | -| | skip_repeat_analysis | +| | skip_repeat_calling | | | skip_snv_calling | | | skip_sv_calling | | skip_eklipse | | @@ -37,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | skip_haplocheck | | | skip_qualimap | | | | skip_smncopynumbercaller | +| | skip_repeat_annotation | ## 2.1.0 - Obelix [2024-05-29] diff --git a/conf/modules/annotate_repeat_expansions.config b/conf/modules/annotate_repeat_expansions.config new file mode 100644 index 00000000..c1d934ea --- /dev/null +++ b/conf/modules/annotate_repeat_expansions.config @@ -0,0 +1,41 @@ +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Config file for defining DSL2 per module options and publishing paths +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Available keys to override module options: + ext.args = Additional arguments appended to command in module. + ext.args2 = Second set of arguments appended to command in module (multi-tool modules). + ext.args3 = Third set of arguments appended to command in module (multi-tool modules). + ext.prefix = File name prefix for output files. + ext.when = Conditional clause +---------------------------------------------------------------------------------------- +*/ + +// +// Repeat expansion calling options +// + +process { + + withName: '.*ANNOTATE_REPEAT_EXPANSIONS:STRANGER' { + ext.prefix = { "${meta.id}_stranger" } + } + + withName: '.*ANNOTATE_REPEAT_EXPANSIONS:COMPRESS_STRANGER' { + ext.prefix = { "${meta.id}_repeat_expansion_stranger" } + ext.args = '--output-type z' + publishDir = [ + path: { "${params.outdir}/repeat_expansions" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, + ] + } + + withName: '.*ANNOTATE_REPEAT_EXPANSIONS:INDEX_STRANGER' { + publishDir = [ + path: { "${params.outdir}/repeat_expansions" }, + mode: params.publish_dir_mode, + saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, + ] + } +} diff --git a/conf/modules/call_repeat_expansions.config b/conf/modules/call_repeat_expansions.config index a3c140a0..fd6738ae 100644 --- a/conf/modules/call_repeat_expansions.config +++ b/conf/modules/call_repeat_expansions.config @@ -58,25 +58,4 @@ process { ext.args = {"--notag"} } - withName: '.*CALL_REPEAT_EXPANSIONS:STRANGER' { - ext.prefix = { "${meta.id}_stranger" } - } - - withName: '.*CALL_REPEAT_EXPANSIONS:COMPRESS_STRANGER' { - ext.prefix = { "${meta.id}_repeat_expansion_stranger" } - ext.args = '--output-type z' - publishDir = [ - path: { "${params.outdir}/repeat_expansions" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, - ] - } - - withName: '.*CALL_REPEAT_EXPANSIONS:INDEX_STRANGER' { - publishDir = [ - path: { "${params.outdir}/repeat_expansions" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, - ] - } } diff --git a/nextflow.config b/nextflow.config index 1ec0f584..0c76f47e 100644 --- a/nextflow.config +++ b/nextflow.config @@ -34,7 +34,8 @@ params { skip_me_calling = false skip_me_annotation = false skip_mt_annotation = false - skip_repeat_analysis = false + skip_repeat_annotation = false + skip_repeat_calling = false skip_smncopynumbercaller = false skip_snv_annotation = false skip_snv_calling = false @@ -316,6 +317,7 @@ includeConfig 'conf/modules/annotate_consequence_pli.config' includeConfig 'conf/modules/annotate_genome_snvs.config' includeConfig 'conf/modules/annotate_mt_snvs.config' includeConfig 'conf/modules/annotate_structural_variants.config' +includeConfig 'conf/modules/annotate_repeat_expansions.config' includeConfig 'conf/modules/call_repeat_expansions.config' includeConfig 'conf/modules/call_snv.config' includeConfig 'conf/modules/call_structural_variants.config' diff --git a/nextflow_schema.json b/nextflow_schema.json index 46e4bdbf..e8164492 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -548,9 +548,14 @@ "description": "Specifies whether or not to subsample mt alignment.", "fa_icon": "fas fa-toggle-on" }, - "skip_repeat_analysis": { + "skip_repeat_annotation": { "type": "boolean", - "description": "Specifies whether or not to skip calling and annotation of repeat expansions.", + "description": "Specifies whether or not to skip annotation of repeat expansions.", + "fa_icon": "fas fa-toggle-on" + }, + "skip_repeat_calling": { + "type": "boolean", + "description": "Specifies whether or not to skip calling of repeat expansions.", "fa_icon": "fas fa-toggle-on" }, "skip_smncopynumbercaller": { diff --git a/subworkflows/local/annotate_repeat_expansions.nf b/subworkflows/local/annotate_repeat_expansions.nf new file mode 100644 index 00000000..5f8b8ea0 --- /dev/null +++ b/subworkflows/local/annotate_repeat_expansions.nf @@ -0,0 +1,34 @@ +// +// Annotate repeat expansions +// + +include { BCFTOOLS_VIEW as COMPRESS_STRANGER } from '../../modules/nf-core/bcftools/view/main' +include { STRANGER } from '../../modules/nf-core/stranger/main' +include { TABIX_TABIX as INDEX_STRANGER } from '../../modules/nf-core/tabix/tabix/main' + +workflow ANNOTATE_REPEAT_EXPANSIONS { + take: + ch_variant_catalog // channel: [mandatory] [ path(variant_catalog.json) ] + ch_vcf // channel: [mandatory] [ val(meta), path(vcf) ] + + main: + ch_versions = Channel.empty() + + // Annotate, compress and index + STRANGER ( ch_vcf, ch_variant_catalog ) + COMPRESS_STRANGER ( + STRANGER.out.vcf.map{ meta, vcf -> [meta, vcf, [] ]}, + [], [], [] + ) + INDEX_STRANGER ( COMPRESS_STRANGER.out.vcf ) + + ch_vcf_idx = COMPRESS_STRANGER.out.vcf.join(INDEX_STRANGER.out.tbi, failOnMismatch:true, failOnDuplicate:true) + + ch_versions = ch_versions.mix(STRANGER.out.versions.first()) + ch_versions = ch_versions.mix(COMPRESS_STRANGER.out.versions.first()) + ch_versions = ch_versions.mix(INDEX_STRANGER.out.versions.first()) + +emit: + vcf = ch_vcf_idx // channel: [ val(meta), path(vcf), path(tbi) ] + versions = ch_versions // channel: [ path(versions.yml) ] +} diff --git a/subworkflows/local/call_repeat_expansions.nf b/subworkflows/local/call_repeat_expansions.nf index 130b7a5b..c45a92ff 100644 --- a/subworkflows/local/call_repeat_expansions.nf +++ b/subworkflows/local/call_repeat_expansions.nf @@ -4,14 +4,11 @@ include { BCFTOOLS_NORM as SPLIT_MULTIALLELICS_EXP } from '../../modules/nf-core/bcftools/norm/main' include { BCFTOOLS_REHEADER as BCFTOOLS_REHEADER_EXP } from '../../modules/nf-core/bcftools/reheader/main' -include { BCFTOOLS_VIEW as COMPRESS_STRANGER } from '../../modules/nf-core/bcftools/view/main' include { EXPANSIONHUNTER } from '../../modules/nf-core/expansionhunter/main' include { PICARD_RENAMESAMPLEINVCF as RENAMESAMPLE_EXP } from '../../modules/nf-core/picard/renamesampleinvcf/main' -include { STRANGER } from '../../modules/nf-core/stranger/main' include { SAMTOOLS_SORT } from '../../modules/nf-core/samtools/sort/main' include { SAMTOOLS_INDEX } from '../../modules/nf-core/samtools/index/main' include { SVDB_MERGE as SVDB_MERGE_REPEATS } from '../../modules/nf-core/svdb/merge/main' -include { TABIX_TABIX as INDEX_STRANGER } from '../../modules/nf-core/tabix/tabix/main' include { TABIX_TABIX as TABIX_EXP_RENAME } from '../../modules/nf-core/tabix/tabix/main' workflow CALL_REPEAT_EXPANSIONS { @@ -63,29 +60,16 @@ workflow CALL_REPEAT_EXPANSIONS { SVDB_MERGE_REPEATS ( ch_svdb_merge_input, [] ) - // Annotate, compress and index - STRANGER ( SVDB_MERGE_REPEATS.out.vcf, ch_variant_catalog ) - COMPRESS_STRANGER ( - STRANGER.out.vcf.map{ meta, vcf -> [meta, vcf, [] ]}, - [], [], [] - ) - INDEX_STRANGER ( COMPRESS_STRANGER.out.vcf ) - - ch_vcf_idx = COMPRESS_STRANGER.out.vcf.join(INDEX_STRANGER.out.tbi, failOnMismatch:true, failOnDuplicate:true) - ch_versions = ch_versions.mix(EXPANSIONHUNTER.out.versions.first()) ch_versions = ch_versions.mix(BCFTOOLS_REHEADER_EXP.out.versions.first()) ch_versions = ch_versions.mix(RENAMESAMPLE_EXP.out.versions.first() ) ch_versions = ch_versions.mix(TABIX_EXP_RENAME.out.versions.first()) ch_versions = ch_versions.mix(SPLIT_MULTIALLELICS_EXP.out.versions.first()) ch_versions = ch_versions.mix(SVDB_MERGE_REPEATS.out.versions.first()) - ch_versions = ch_versions.mix(STRANGER.out.versions.first()) - ch_versions = ch_versions.mix(COMPRESS_STRANGER.out.versions.first()) - ch_versions = ch_versions.mix(INDEX_STRANGER.out.versions.first()) ch_versions = ch_versions.mix(SAMTOOLS_SORT.out.versions.first()) ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first()) emit: - vcf = ch_vcf_idx // channel: [ val(meta), path(vcf), path(tbi) ] - versions = ch_versions // channel: [ path(versions.yml) ] + vcf = SVDB_MERGE_REPEATS.out.vcf // channel: [ val(meta), path(vcf) ] + versions = ch_versions // channel: [ path(versions.yml) ] } diff --git a/workflows/raredisease.nf b/workflows/raredisease.nf index eb349c78..da7dd562 100644 --- a/workflows/raredisease.nf +++ b/workflows/raredisease.nf @@ -31,7 +31,11 @@ if (params.run_rtgvcfeval) { mandatoryParams += ["rtg_truthvcfs"] } -if (!params.skip_repeat_analysis) { +if (!params.skip_repeat_calling) { + mandatoryParams += ["variant_catalog"] +} + +if (!params.skip_repeat_annotation) { mandatoryParams += ["variant_catalog"] } @@ -141,6 +145,7 @@ include { ANNOTATE_CSQ_PLI as ANN_CSQ_PLI_SV } from '../subworkf include { ANNOTATE_GENOME_SNVS } from '../subworkflows/local/annotate_genome_snvs' include { ANNOTATE_MOBILE_ELEMENTS } from '../subworkflows/local/annotate_mobile_elements' include { ANNOTATE_MT_SNVS } from '../subworkflows/local/annotate_mt_snvs' +include { ANNOTATE_REPEAT_EXPANSIONS } from '../subworkflows/local/annotate_repeat_expansions' include { ANNOTATE_STRUCTURAL_VARIANTS } from '../subworkflows/local/annotate_structural_variants' include { CALL_MOBILE_ELEMENTS } from '../subworkflows/local/call_mobile_elements' include { CALL_REPEAT_EXPANSIONS } from '../subworkflows/local/call_repeat_expansions' @@ -448,7 +453,7 @@ workflow RAREDISEASE { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - if (!params.skip_repeat_analysis && params.analysis_type.equals("wgs") ) { + if (!params.skip_repeat_calling && params.analysis_type.equals("wgs") ) { CALL_REPEAT_EXPANSIONS ( ch_mapped.genome_bam_bai, ch_variant_catalog, @@ -457,6 +462,14 @@ workflow RAREDISEASE { ch_genome_fai ) ch_versions = ch_versions.mix(CALL_REPEAT_EXPANSIONS.out.versions) + + if (!params.skip_repeat_annotation) { + ANNOTATE_REPEAT_EXPANSIONS ( + ch_variant_catalog, + CALL_REPEAT_EXPANSIONS.out.vcf + ) + ch_versions = ch_versions.mix(CALL_REPEAT_EXPANSIONS.out.versions) + } }