Skip to content

Commit

Permalink
add skip for repeat annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
ramprasadn committed Jun 26, 2024
1 parent 391f8c9 commit 8101033
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 45 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ 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)
- Two new parameters `mbuffer_mem` and `samtools_sort_threads` to control resources given to mbuffer and samtools sort in the bwameme module [#570](https://github.com/nf-core/raredisease/pull/570)

### `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)
Expand All @@ -29,14 +31,15 @@ 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 | |
| skip_fastqc | |
| skip_haplocheck | |
| skip_qualimap | |
| | skip_smncopynumbercaller |
| | skip_repeat_annotation |

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

Expand Down
41 changes: 41 additions & 0 deletions conf/modules/annotate_repeat_expansions.config
Original file line number Diff line number Diff line change
@@ -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 },
]
}
}
21 changes: 0 additions & 21 deletions conf/modules/call_repeat_expansions.config
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
]
}
}
4 changes: 3 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
9 changes: 7 additions & 2 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
34 changes: 34 additions & 0 deletions subworkflows/local/annotate_repeat_expansions.nf
Original file line number Diff line number Diff line change
@@ -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) ]
}
20 changes: 2 additions & 18 deletions subworkflows/local/call_repeat_expansions.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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) ]
}
17 changes: 15 additions & 2 deletions workflows/raredisease.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}

Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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,
Expand All @@ -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)
}
}


Expand Down

0 comments on commit 8101033

Please sign in to comment.