Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ process {
}

withName: 'STRANGER' {
ext.prefix = { "${meta.id}_annotated_vcf" }
ext.prefix = { "${meta.id}_annotated" }
publishDir = [
path: { "${params.outdir}/${meta.id}/str" },
mode: 'copy'
Expand All @@ -667,7 +667,7 @@ process {


withName: 'ANNOTSV_SNIFFLES' {
ext.args = { meta.hpo_terms ? "-vcf 1 -genomeBuild GRCh38 -rankFiltering ${params.rankfiltering} -hpo '${meta.hpo_terms}'" : "-vcf 1 -genomeBuild GRCh38 -rankFiltering '3-5,NA'" }
ext.args = { meta.hpo_terms ? "-vcf 1 -genomeBuild GRCh38 -rankFiltering ${params.rankfiltering} -hpo '${meta.hpo_terms}'" : "-vcf 1 -genomeBuild GRCh38" }
ext.prefix = { "${meta.id}_annotsv" }
containerOptions = '--user root'
publishDir = [
Expand All @@ -677,7 +677,7 @@ process {
}

withName: 'ANNOTSV_SVIM' {
ext.args = { meta.hpo_terms ? "-vcf 1 -genomeBuild GRCh38 -rankFiltering ${params.rankfiltering} -hpo '${meta.hpo_terms}'" : "-vcf 1 -genomeBuild GRCh38 -rankFiltering '3-5,NA'" }
ext.args = { meta.hpo_terms ? "-vcf 1 -genomeBuild GRCh38 -rankFiltering ${params.rankfiltering} -hpo '${meta.hpo_terms}'" : "-vcf 1 -genomeBuild GRCh38" }
ext.prefix = { "${meta.id}_annotsv" }
containerOptions = '--user root'
publishDir = [
Expand Down
4 changes: 2 additions & 2 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ params {
// ========================================
sniffles_min_mapq = 10
annotate_sv = true
rankfiltering = '3-5,NA'
rankfiltering = '1-5,NA'
run_svim = true
svim_min_mapq = 10
filter_pass_sv = true
downsample_sv = true
downsample_sv = false
coverage_bed = null
min_read_support = 'auto'
min_read_support_limit = 2
Expand Down
4 changes: 2 additions & 2 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
},
"rankfiltering": {
"type": "string",
"default": "3-5,NA",
"default": "1-5,NA",
"title": "Rank Filtering",
"description": "Rank filtering criteria"
},
Expand Down Expand Up @@ -265,7 +265,7 @@
},
"downsample_sv": {
"type": "boolean",
"default": true,
"default": false,
"description": "Enable SV filtering by coverage.",
"fa_icon": "fas fa-filter"
},
Expand Down
23 changes: 19 additions & 4 deletions subworkflows/local/annotate_sv/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ workflow ANNOTATE_SV {

take:
ch_samplesheet
ch_sv_vcf
ch_sniffles_vcf
ch_svim_vcf
ch_snv_vcf
candidate_genes
false_positive_snv
Expand Down Expand Up @@ -38,7 +39,7 @@ workflow ANNOTATE_SV {
ch_false_positive_snv = false_positive_snv ? Channel.fromPath(false_positive_snv).map{[[id:"false_positive"], it]}.collect() : Channel.value([[id:"empty"], []])
ch_gene_transcripts = gene_transcripts ? Channel.fromPath(gene_transcripts).map{[[id:"transcripts"], it]}.collect() : Channel.value([[id:"empty"], []])

ch_annotate_input = ch_sv_vcf
ch_annotate_input_sniffles = ch_sniffles_vcf
.map { meta, vcf -> [meta.id, meta, vcf] }
.join(
ch_samplesheet.map { meta, data -> [meta.id, data.hpo_terms] },
Expand All @@ -54,15 +55,29 @@ workflow ANNOTATE_SV {
}

ANNOTSV_SNIFFLES (
ch_annotate_input,
ch_annotate_input_sniffles,
ch_annotsv_annotations,
ch_candidate_genes,
ch_false_positive_snv,
ch_gene_transcripts
)

if (params.run_svim){
ANNOTSV_SVIM (ch_annotate_input,
ch_annotate_input_svim = ch_svim_vcf
.map { meta, vcf -> [meta.id, meta, vcf] }
.join(
ch_samplesheet.map { meta, data -> [meta.id, data.hpo_terms] },
by: 0
)
.join(
ch_snv_vcf.map { meta, vcf -> [meta.id, vcf] },
by: 0
)
.map { id, meta, sv_vcf, hpo, snv_vcf ->
def clean_hpo = (hpo && hpo.trim()) ? hpo : null
[meta + [hpo_terms: clean_hpo], sv_vcf, [], snv_vcf]
}
ANNOTSV_SVIM (ch_annotate_input_svim,
ch_annotsv_annotations,
ch_candidate_genes,
ch_false_positive_snv,
Expand Down
72 changes: 48 additions & 24 deletions subworkflows/local/annotate_sv/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,32 @@ nextflow_workflow {
[ hpo_terms: 'HP:0001250;HP:0000252' ]
])

// ch_sv_vcf - [meta, vcf]
// ch_sniffles_vcf - [meta, vcf]
input[1] = Channel.of([
[ id:'test_sample' ],
file('test_sniffles.vcf')
])

// ch_snv_vcf - [meta, vcf]
// ch_svim_vcf - [meta, vcf]
input[2] = Channel.of([
[ id:'test_sample' ],
file('test_svim.vcf')
])

// ch_snv_vcf - [meta, vcf]
input[3] = Channel.of([
[ id:'test_sample' ],
file('test_snv.vcf')
])

// candidate_genes - path or null
input[3] = null
input[4] = null

// false_positive_snv - path or null
input[4] = null
input[5] = null

// gene_transcripts - path or null
input[5] = null
input[6] = null
"""
}
}
Expand Down Expand Up @@ -76,26 +82,32 @@ nextflow_workflow {
[ hpo_terms: 'HP:0001250;HP:0000252' ]
])

// ch_sv_vcf
// ch_sniffles_vcf
input[1] = Channel.of([
[ id:'test_sample' ],
file('test_sniffles.vcf')
])

// ch_snv_vcf
// ch_svim_vcf
input[2] = Channel.of([
[ id:'test_sample' ],
file('test_svim.vcf')
])

// ch_snv_vcf
input[3] = Channel.of([
[ id:'test_sample' ],
file('test_snv.vcf')
])

// candidate_genes
input[3] = 'candidate_genes.txt'
input[4] = 'candidate_genes.txt'

// false_positive_snv
input[4] = 'false_positive_snv.txt'
input[5] = 'false_positive_snv.txt'

// gene_transcripts
input[5] = 'gene_transcripts.txt'
input[6] = 'gene_transcripts.txt'
"""
}
}
Expand All @@ -120,32 +132,38 @@ nextflow_workflow {
}
workflow {
"""
// ch_samplesheet - empty hpo_terms
// ch_samplesheet
input[0] = Channel.of([
[ id:'test_sample' ],
[ hpo_terms: '' ]
[ hpo_terms: 'HP:0001250;HP:0000252' ]
])

// ch_sv_vcf
// ch_sniffles_vcf
input[1] = Channel.of([
[ id:'test_sample' ],
file('test_sniffles.vcf')
])

// ch_snv_vcf
// ch_svim_vcf
input[2] = Channel.of([
[ id:'test_sample' ],
file('test_svim.vcf')
])

// ch_snv_vcf
input[3] = Channel.of([
[ id:'test_sample' ],
file('test_snv.vcf')
])

// candidate_genes
input[3] = null
input[4] = 'candidate_genes.txt'

// false_positive_snv
input[4] = null
input[5] = 'false_positive_snv.txt'

// gene_transcripts
input[5] = null
input[6] = 'gene_transcripts.txt'
"""
}
}
Expand All @@ -169,32 +187,38 @@ nextflow_workflow {
}
workflow {
"""
// ch_samplesheet - null hpo_terms
// ch_samplesheet
input[0] = Channel.of([
[ id:'test_sample' ],
[ hpo_terms: null ]
[ hpo_terms: 'HP:0001250;HP:0000252' ]
])

// ch_sv_vcf
// ch_sniffles_vcf
input[1] = Channel.of([
[ id:'test_sample' ],
file('test_sniffles.vcf')
])

// ch_snv_vcf
// ch_svim_vcf
input[2] = Channel.of([
[ id:'test_sample' ],
file('test_svim.vcf')
])

// ch_snv_vcf
input[3] = Channel.of([
[ id:'test_sample' ],
file('test_snv.vcf')
])

// candidate_genes
input[3] = null
input[4] = 'candidate_genes.txt'

// false_positive_snv
input[4] = null
input[5] = 'false_positive_snv.txt'

// gene_transcripts
input[5] = null
input[6] = 'gene_transcripts.txt'
"""
}
}
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/local/call_str/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"id": "test_nanopore"
},
"test_nanopore_annotated_vcf.vcf.gz"
"test_nanopore_annotated.vcf.gz"
]
]
],
Expand All @@ -25,7 +25,7 @@
{
"id": "test_nanopore"
},
"test_nanopore_annotated_vcf.vcf.gz"
"test_nanopore_annotated.vcf.gz"
]
]
],
Expand Down
3 changes: 3 additions & 0 deletions workflows/longraredisease.nf
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ workflow LONGRAREDISEASE {
)

ch_sv_vcf_final = CALL_SV.out.sniffles_vcf
ch_svim_vcf = CALL_SV.out.svim_vcf
ch_versions = ch_versions.mix(CALL_SV.out.versions)

if (params.filter_pass_sv) {
Expand Down Expand Up @@ -590,6 +591,7 @@ workflow LONGRAREDISEASE {
ch_svim_vcf = FILTER_SV_SVIM.out.ch_vcf_tbi.map { meta, vcf, tbi -> [meta, vcf] }

}

}

else {
Expand All @@ -606,6 +608,7 @@ workflow LONGRAREDISEASE {

ANNOTATE_SV(ch_samplesheet,
ch_sv_vcf_final,
ch_svim_vcf,
ch_snv_vcf,
[],
[],
Expand Down
Loading