Skip to content

Commit

Permalink
Keep only SVs that PASS
Browse files Browse the repository at this point in the history
  • Loading branch information
ramprasadn committed Jan 29, 2025
1 parent 7f0de75 commit cb2c7a6
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Changed`

- Only Structural variants that PASS the filter will be reported and annotated [#673](https://github.com/nf-core/raredisease/pull/673)
- Update haplogrep to v3.2.2 [#672](https://github.com/nf-core/raredisease/pull/672)
- d4 files are not generated by default anymore [#648](https://github.com/nf-core/raredisease/pull/648)
- Suffix used to identify unique fastq pairs from "\_T" to "\_LNUMBER" [#638](https://github.com/nf-core/raredisease/pull/638)
Expand Down
4 changes: 4 additions & 0 deletions conf/modules/call_sv_cnvnator.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ process {
ext.args = { "-call ${params.cnvnator_binsize}" }
}

withName: ".*CALL_STRUCTURAL_VARIANTS:CALL_SV_CNVNATOR:BCFTOOLS_FILTER_CNVNATOR" {
ext.args = { '-i \'FILTER="PASS"\'' }
}

withName: '.*CALL_STRUCTURAL_VARIANTS:CALL_SV_CNVNATOR:SVDB_MERGE_CNVNATOR' {
ext.args = '--notag --pass_only'
ext.prefix = { "${meta.id}_cnvnator" }
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/call_sv_germlinecnvcaller.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ process {

withName: '.*CALL_STRUCTURAL_VARIANTS:CALL_SV_GERMLINECNVCALLER:BCFTOOLS_VIEW' {
ext.prefix = { "${meta.id}_gatkcnv_segments_refiltered" }
ext.args = { '--output-type z --exclude "N_ALT = 0" ' }
ext.args = { '--output-type z --exclude "N_ALT = 0" -i \'FILTER="PASS"\'' }
}

withName: '.*CALL_STRUCTURAL_VARIANTS:CALL_SV_GERMLINECNVCALLER:SVDB_MERGE_GCNVCALLER' {
Expand Down
3 changes: 3 additions & 0 deletions conf/modules/call_sv_manta.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ process {
ext.args = { (params.analysis_type == "wes") ? '--exome' : '' }
ext.prefix = { "${meta.id}_manta" }
}
withName: ".*CALL_STRUCTURAL_VARIANTS:CALL_SV_MANTA:BCFTOOLS_FILTER_MANTA" {
ext.args = { '-i \'FILTER="PASS"\'' }
}
}
4 changes: 4 additions & 0 deletions conf/modules/call_sv_tiddit.config
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ process {
ext.args = '-p 6'
}

withName: ".*CALL_STRUCTURAL_VARIANTS:CALL_SV_TIDDIT:BCFTOOLS_FILTER_TIDDIT" {
ext.args = { '-i \'FILTER="PASS"\'' }
}

withName: '.*CALL_STRUCTURAL_VARIANTS:CALL_SV_TIDDIT:SVDB_MERGE_TIDDIT' {
ext.args = '--notag --pass_only'
ext.prefix = { "${meta.id}_tiddit" }
Expand Down
2 changes: 1 addition & 1 deletion subworkflows/local/call_structural_variants.nf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ workflow CALL_STRUCTURAL_VARIANTS {

if (!params.analysis_type.equals("mito")) {
CALL_SV_MANTA (ch_genome_bam, ch_genome_bai, ch_genome_fasta, ch_genome_fai, ch_case_info, ch_target_bed)
.diploid_sv_vcf
.filtered_diploid_sv_vcf_tbi
.collect{it[1]}
.set{ manta_vcf }
ch_versions = ch_versions.mix(CALL_SV_MANTA.out.versions)
Expand Down
24 changes: 14 additions & 10 deletions subworkflows/local/call_sv_cnvnator/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// A subworkflow to call CNVs using cnvnator
//

nextflow.enable.dsl = 2

include { CNVNATOR_CNVNATOR as CNVNATOR_RD } from '../../../modules/nf-core/cnvnator/cnvnator/main.nf'
include { CNVNATOR_CNVNATOR as CNVNATOR_HIST } from '../../../modules/nf-core/cnvnator/cnvnator/main.nf'
include { CNVNATOR_CNVNATOR as CNVNATOR_STAT } from '../../../modules/nf-core/cnvnator/cnvnator/main.nf'
include { CNVNATOR_CNVNATOR as CNVNATOR_PARTITION } from '../../../modules/nf-core/cnvnator/cnvnator/main.nf'
include { CNVNATOR_CNVNATOR as CNVNATOR_CALL } from '../../../modules/nf-core/cnvnator/cnvnator/main.nf'
include { CNVNATOR_CONVERT2VCF } from '../../../modules/nf-core/cnvnator/convert2vcf/main.nf'
include { SVDB_MERGE as SVDB_MERGE_CNVNATOR } from '../../../modules/nf-core/svdb/merge/main'
include { CNVNATOR_CNVNATOR as CNVNATOR_RD } from '../../../modules/nf-core/cnvnator/cnvnator/main.nf'
include { CNVNATOR_CNVNATOR as CNVNATOR_HIST } from '../../../modules/nf-core/cnvnator/cnvnator/main.nf'
include { CNVNATOR_CNVNATOR as CNVNATOR_STAT } from '../../../modules/nf-core/cnvnator/cnvnator/main.nf'
include { CNVNATOR_CNVNATOR as CNVNATOR_PARTITION } from '../../../modules/nf-core/cnvnator/cnvnator/main.nf'
include { CNVNATOR_CNVNATOR as CNVNATOR_CALL } from '../../../modules/nf-core/cnvnator/cnvnator/main.nf'
include { CNVNATOR_CONVERT2VCF } from '../../../modules/nf-core/cnvnator/convert2vcf/main.nf'
include { TABIX_BGZIPTABIX as INDEX_CNVNATOR } from '../../../modules/nf-core/tabix/bgziptabix/main'
include { BCFTOOLS_FILTER as BCFTOOLS_FILTER_CNVNATOR } from '../../../modules/nf-core/bcftools/filter/main.nf'
include { SVDB_MERGE as SVDB_MERGE_CNVNATOR } from '../../../modules/nf-core/svdb/merge/main'

workflow CALL_SV_CNVNATOR {
take:
Expand All @@ -27,7 +27,9 @@ workflow CALL_SV_CNVNATOR {
CNVNATOR_STAT ( [[:],[],[]], CNVNATOR_HIST.out.root, [[:],[]], [[:],[]], "stat" )
CNVNATOR_PARTITION ( [[:],[],[]], CNVNATOR_STAT.out.root, [[:],[]], [[:],[]], "partition" )
CNVNATOR_CALL ( [[:],[],[]], CNVNATOR_PARTITION.out.root, [[:],[]], [[:],[]], "call" )
CNVNATOR_CONVERT2VCF (CNVNATOR_CALL.out.tab).vcf
CNVNATOR_CONVERT2VCF (CNVNATOR_CALL.out.tab)
INDEX_CNVNATOR (CNVNATOR_CONVERT2VCF.out.vcf)
BCFTOOLS_FILTER_CNVNATOR (INDEX_CNVNATOR.out.gz_tbi).vcf
.collect{it[1]}
.toList()
.set { vcf_file_list }
Expand All @@ -45,6 +47,8 @@ workflow CALL_SV_CNVNATOR {
ch_versions = ch_versions.mix(CNVNATOR_CALL.out.versions)
ch_versions = ch_versions.mix(CNVNATOR_CONVERT2VCF.out.versions)
ch_versions = ch_versions.mix(SVDB_MERGE_CNVNATOR.out.versions)
ch_versions = ch_versions.mix(INDEX_CNVNATOR.out.versions)
ch_versions = ch_versions.mix(BCFTOOLS_FILTER_CNVNATOR.out.versions)

emit:
vcf = SVDB_MERGE_CNVNATOR.out.vcf // channel: [ val(meta), path(*.tar.gz) ]
Expand Down
10 changes: 9 additions & 1 deletion subworkflows/local/call_sv_manta/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// A structural variant caller workflow for manta
//

include { MANTA_GERMLINE as MANTA } from '../../../modules/nf-core/manta/germline/main'
include { MANTA_GERMLINE as MANTA } from '../../../modules/nf-core/manta/germline/main'
include { BCFTOOLS_FILTER as BCFTOOLS_FILTER_MANTA } from '../../../modules/nf-core/bcftools/filter/main.nf'

workflow CALL_SV_MANTA {
take:
Expand Down Expand Up @@ -41,7 +42,13 @@ workflow CALL_SV_MANTA {
MANTA ( manta_input, ch_genome_fasta, ch_genome_fai, [] )
}

MANTA.out.diploid_sv_vcf
.join(MANTA.out.diploid_sv_vcf_tbi)
.set {ch_filter_in}
BCFTOOLS_FILTER_MANTA (ch_filter_in)

ch_versions = MANTA.out.versions
ch_versions = ch_versions.mix(BCFTOOLS_FILTER_MANTA.out.versions)

emit:
candidate_small_indels_vcf = MANTA.out.candidate_small_indels_vcf // channel: [ val(meta), path(vcf) ]
Expand All @@ -50,5 +57,6 @@ workflow CALL_SV_MANTA {
candidate_sv_vcf_tbi = MANTA.out.candidate_sv_vcf_tbi // channel: [ val(meta), path(tbi) ]
diploid_sv_vcf = MANTA.out.diploid_sv_vcf // channel: [ val(meta), path(vcf) ]
diploid_sv_vcf_tbi = MANTA.out.diploid_sv_vcf_tbi // channel: [ val(meta), path(tbi) ]
filtered_diploid_sv_vcf_tbi = BCFTOOLS_FILTER_MANTA.out.vcf // channel: [ val(meta), path(vcf), path(tbi) ]
versions = ch_versions
}
12 changes: 8 additions & 4 deletions subworkflows/local/call_sv_tiddit/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
// A structural variant caller workflow for tiddit
//

include { TIDDIT_SV } from '../../../modules/nf-core/tiddit/sv/main'
include { SVDB_MERGE as SVDB_MERGE_TIDDIT } from '../../../modules/nf-core/svdb/merge/main'
include { TIDDIT_SV } from '../../../modules/nf-core/tiddit/sv/main'
include { SVDB_MERGE as SVDB_MERGE_TIDDIT } from '../../../modules/nf-core/svdb/merge/main'
include { TABIX_BGZIPTABIX as INDEX_TIDDIT } from '../../../modules/nf-core/tabix/bgziptabix/main'
include { BCFTOOLS_FILTER as BCFTOOLS_FILTER_TIDDIT } from '../../../modules/nf-core/bcftools/filter/main.nf'

workflow CALL_SV_TIDDIT {
take:
Expand All @@ -15,8 +17,8 @@ workflow CALL_SV_TIDDIT {
main:
TIDDIT_SV ( ch_bam_bai, ch_genome_fasta, ch_bwa_index )

TIDDIT_SV.out
.vcf
INDEX_TIDDIT (TIDDIT_SV.out.vcf)
BCFTOOLS_FILTER_TIDDIT (INDEX_TIDDIT.out.gz_tbi).vcf
.collect{it[1]}
.toList()
.set { vcf_file_list }
Expand All @@ -29,6 +31,8 @@ workflow CALL_SV_TIDDIT {

ch_versions = TIDDIT_SV.out.versions.first()
ch_versions = ch_versions.mix(SVDB_MERGE_TIDDIT.out.versions)
ch_versions = ch_versions.mix(INDEX_TIDDIT.out.versions)
ch_versions = ch_versions.mix(BCFTOOLS_FILTER_TIDDIT.out.versions)

emit:
vcf = SVDB_MERGE_TIDDIT.out.vcf // channel: [ val(meta), path(vcf) ]
Expand Down

0 comments on commit cb2c7a6

Please sign in to comment.