Skip to content

Commit 8d7bb35

Browse files
authored
Merge pull request #837 from nf-core/sanitycheckxtra
Fix issues in call_sv_MT & extend vcfanno sanity check
2 parents 356cbf1 + b24e296 commit 8d7bb35

5 files changed

Lines changed: 14 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7575
- Fixed CADD annotation to support chr prefix [#745](https://github.com/nf-core/raredisease/pull/745)
7676
- Fixed mismatch between VCF and ROH calls when analysing multiple samples [#755](https://github.com/nf-core/raredisease/pull/755)
7777
- Fixed pipeline to run variant calling even with bait_padding set to 0 [#757](https://github.com/nf-core/raredisease/pull/757)
78+
- Fixed runtime errors in `call_sv_MT` and `call_structural_variants` when MitoSAlt produces no structural variant calls [#837](https://github.com/nf-core/raredisease/pull/837)
79+
- Fixed vcfanno sanity check map closure to handle `ch_vcfanno_resources` emitting a list of paths [#837](https://github.com/nf-core/raredisease/pull/837)
7880

7981
### Parameters
8082

nextflow_schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@
620620
"fa_icon": "fas fa-forward",
621621
"description": "Disable specified tools.",
622622
"help_text": "Multiple tools can be specified, separated by commas.",
623-
"pattern": "^((fastp|gens|germlinecnvcaller|peddy|smncopynumbercaller|vcf2cytosure|fastqc|ngsbits)?,?)*(?<!,)$"
623+
"pattern": "^((fastp|gens|germlinecnvcaller|peddy|smncopynumbercaller|vcf2cytosure|fastqc|ngsbits|mitosalt)?,?)*(?<!,)$"
624624
}
625625
}
626626
},

subworkflows/local/call_structural_variants/main.nf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ workflow CALL_STRUCTURAL_VARIANTS {
141141
ch_merged_tbi = TABIX_TABIX.out.index
142142

143143
} else {
144-
// For mito-only analysis, use mitosalt_vcf directly
145-
TABIX_TABIX (ch_saltshaker_vcf)
146-
ch_merged_svs = ch_saltshaker_vcf
144+
// For mito-only analysis, use saltshaker_vcf with meta directly (ch_saltshaker_vcf
145+
// holds collected paths only, ch_sv_mt_out.saltshaker_vcf holds [meta, vcf] tuples)
146+
TABIX_TABIX (ch_sv_mt_out.saltshaker_vcf)
147+
ch_merged_svs = ch_sv_mt_out.saltshaker_vcf
147148
ch_merged_tbi = TABIX_TABIX.out.index
148149
}
149150

subworkflows/local/call_sv_MT/main.nf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ workflow CALL_SV_MT {
4040
val_mitosalt_heteroplasmy_limit // string: [mandatory] mitosalt_heteroplasmy_limit
4141

4242
main:
43+
ch_saltshaker_html = channel.empty()
4344
ch_saltshaker_txt = channel.empty()
4445
ch_saltshaker_vcf = channel.empty()
4546
ch_saltshaker_plot = channel.empty()
@@ -131,16 +132,17 @@ workflow CALL_SV_MT {
131132
)
132133
ch_saltshaker_plot = SALTSHAKER_PLOT.out.plot
133134

135+
// Only merge if Saltshaker produced VCFs; filter on the flat list before wrapping so
136+
// combine never sees an empty-spread issue (combining case_info with [[]] would produce
137+
// a 1-element channel item that breaks 2-param destructuring closures downstream).
134138
SALTSHAKER_CLASSIFY.out.vcf
135139
.collect{ _meta, vcf -> vcf }
136-
.toList()
140+
.filter{ !it.isEmpty() }
141+
.map{ vcf_list -> [vcf_list] }
137142
.set { ch_vcf_file_list }
138143

139-
// Saltshaker only runs if there are mitosalt calls, so we only merge in that case (ie vcfs
140-
// exist, combined channel has two elements) to avoid a merge error
141144
ch_case_info
142145
.combine(ch_vcf_file_list)
143-
.filter{ it -> it.size() == 2}
144146
.set { ch_merge_input_vcfs }
145147

146148
SVDB_MERGE ( ch_merge_input_vcfs, [], true ).vcf

workflows/raredisease.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ workflow RAREDISEASE {
446446
if (val_run_vcfanno_db_sanity_check && (!skip_snv_annotation || (!skip_mt_annotation && (val_run_mt_for_wes || val_analysis_type.matches("wgs|mito"))))) {
447447
ch_vcfanno_resources
448448
.combine(ch_vcfanno_extra)
449-
.map { resources, extra -> [resources, extra].flatten() }
449+
.map { files -> files.flatten() }
450450
.set { ch_all_vcfanno_dbs }
451451
SANITY_CHECK_VCFANNO_DATABASES (ch_vcfanno_toml, ch_all_vcfanno_dbs)
452452
ch_vcfanno_toml_final = SANITY_CHECK_VCFANNO_DATABASES.out.toml

0 commit comments

Comments
 (0)