Skip to content

Commit aa58f16

Browse files
committed
move logic upstream
1 parent 265ffe6 commit aa58f16

8 files changed

Lines changed: 45 additions & 65 deletions

File tree

main.nf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,11 @@ workflow NFCORE_RAREDISEASE {
264264

265265
ch_cadd_header = channel.fromPath("$projectDir/assets/cadd_to_vcf_header_-1.0-.txt", checkIfExists: true).collect()
266266
ch_foundin_header = channel.fromPath("$projectDir/assets/foundin.hdr", checkIfExists: true).collect()
267-
ch_manta_call_regions = val_manta_call_regions
268-
? channel.value([file(val_manta_call_regions), file(val_manta_call_regions_tbi)])
269-
: channel.value([[], []])
267+
ch_manta_regions = val_analysis_type.equals("wgs")
268+
? (val_manta_call_regions
269+
? channel.value([file(val_manta_call_regions), file(val_manta_call_regions_tbi)])
270+
: channel.value([[], []]))
271+
: ch_target_bed.map { _meta, bed, tbi -> [bed, tbi] }
270272
ch_ngsbits_method = channel.value(val_ngsbits_samplegender_method)
271273
ch_sentieon_pcr_indel_model = channel.value(val_sentieon_dnascope_pcr_indel_model)
272274
ch_subdepth = channel.value(val_subdepth)
@@ -409,7 +411,7 @@ workflow NFCORE_RAREDISEASE {
409411
ch_hgnc_ids,
410412
ch_intervals_wgs,
411413
ch_intervals_y,
412-
ch_manta_call_regions,
414+
ch_manta_regions,
413415
ch_me_references,
414416
ch_me_svdb_resources,
415417
ch_ml_model,

subworkflows/local/call_structural_variants/main.nf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ workflow CALL_STRUCTURAL_VARIANTS {
2424
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
2525
ch_genome_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
2626
ch_genome_hisat2index // channel: [mandatory] [ val(meta), path(hisat2index) ]
27-
ch_manta_call_regions // channel: [optional] [ path(bed), path(tbi) ]
27+
ch_manta_regions // channel: [mandatory] [ path(bed), path(tbi) ]
2828
ch_mitosalt_config // channel: [mandatory] [val(mitosalt_breakspan),val(mitosalt_breakthreshold),...,val(mitosalt_split_length)]
2929
ch_mt_bam_bai // channel: [mandatory] [ val(meta), path(bam), path(bai) ]
3030
ch_mt_fai // channel: [mandatory] [ val(meta), path(mtfai) ]
@@ -35,7 +35,6 @@ workflow CALL_STRUCTURAL_VARIANTS {
3535
ch_reads // channel: [mandatory] [ val(meta), [path(reads)] ]
3636
ch_subdepth // channel: [mandatory] [ val(mitosalt_depth) ]
3737
ch_svcaller_priority // channel: [mandatory] [ val(["var caller tag 1", ...]) ]
38-
ch_target_bed // channel: [mandatory for WES] [ val(meta), path(bed), path(tbi) ]
3938
skip_germlinecnvcaller // boolean
4039
skip_mitosalt // boolean
4140
val_analysis_type // string: "wes", "wgs", or "mito"
@@ -60,7 +59,7 @@ workflow CALL_STRUCTURAL_VARIANTS {
6059
ch_tiddit_vcf = channel.empty()
6160

6261
if (!val_analysis_type.equals("mito")) {
63-
CALL_SV_MANTA (ch_genome_bam, ch_genome_bai, ch_genome_fasta, ch_genome_fai, ch_case_info, ch_target_bed, ch_manta_call_regions, val_analysis_type)
62+
CALL_SV_MANTA (ch_genome_bam, ch_genome_bai, ch_genome_fasta, ch_genome_fai, ch_case_info, ch_manta_regions)
6463
.filtered_diploid_sv_vcf
6564
.collect{ _meta, vcf -> vcf }
6665
.set{ ch_manta_vcf }

subworkflows/local/call_structural_variants/tests/main.nf.test

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,18 @@ nextflow_workflow {
6363
])
6464
input[20] = channel.value(10000000)
6565
input[21] = channel.value(['manta', 'tiddit', 'cnvnator'])
66-
input[22] = channel.of([[id:'target'], [], []])
67-
input[23] = true
68-
input[24] = false
69-
input[25] = 'wgs'
70-
input[26] = 407
71-
input[27] = 16081
72-
input[28] = 5763
73-
input[29] = 5730
74-
input[30] = 16569
75-
input[31] = 'MT'
76-
input[32] = 15
77-
input[33] = 0.01
78-
input[34] = true
66+
input[22] = true
67+
input[23] = false
68+
input[24] = 'wgs'
69+
input[25] = 407
70+
input[26] = 16081
71+
input[27] = 5763
72+
input[28] = 5730
73+
input[29] = 16569
74+
input[30] = 'MT'
75+
input[31] = 15
76+
input[32] = 0.01
77+
input[33] = true
7978
"""
8079
}
8180
}

subworkflows/local/call_structural_variants/tests/main.nf.test.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
"justhusky_sv.vcf.gz.tbi"
1717
]
1818
],
19+
"timestamp": "2026-04-14T15:51:47.077800376",
1920
"meta": {
2021
"nf-test": "0.9.3",
2122
"nextflow": "25.10.4"
22-
},
23-
"timestamp": "2026-04-14T15:51:47.077800376"
23+
}
2424
}
2525
}

subworkflows/local/call_sv_manta/main.nf

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ include { MANTA_GERMLINE as MANTA } from '../../../modules/nf-core/
77

88
workflow CALL_SV_MANTA {
99
take:
10-
ch_bam // channel: [mandatory] [ val(meta), path(bam) ]
11-
ch_bai // channel: [mandatory] [ val(meta), path(bai) ]
12-
ch_genome_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
13-
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
14-
ch_case_info // channel: [mandatory] [ val(case_info) ]
15-
ch_bed // channel: [mandatory for WES] [ val(meta), path(bed), path(tbi) ]
16-
ch_manta_call_regions // channel: [optional] [ path(bed), path(tbi) ]
17-
val_analysis_type // string: "wes", "wgs", or "mito"
10+
ch_bam // channel: [mandatory] [ val(meta), path(bam) ]
11+
ch_bai // channel: [mandatory] [ val(meta), path(bai) ]
12+
ch_genome_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
13+
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
14+
ch_case_info // channel: [mandatory] [ val(case_info) ]
15+
ch_regions // channel: [mandatory] [ path(bed), path(tbi) ]
1816

1917
main:
2018
ch_bam.map{ _meta, bam -> bam }
@@ -27,24 +25,11 @@ workflow CALL_SV_MANTA {
2725
.toList()
2826
.set { bai_file_list }
2927

30-
ch_bed.map {
31-
_id, bed_file, index ->
32-
return [bed_file, index]}
33-
.set { bed_input }
34-
35-
if (val_analysis_type.equals("wgs")) {
36-
ch_case_info.combine(bam_file_list)
37-
.combine(bai_file_list)
38-
.combine(ch_manta_call_regions)
39-
.set { manta_input }
40-
MANTA ( manta_input, ch_genome_fasta, ch_genome_fai, [] )
41-
} else {
42-
ch_case_info.combine(bam_file_list)
43-
.combine(bai_file_list)
44-
.combine(bed_input)
45-
.set { manta_input }
46-
MANTA ( manta_input, ch_genome_fasta, ch_genome_fai, [] )
47-
}
28+
ch_case_info.combine(bam_file_list)
29+
.combine(bai_file_list)
30+
.combine(ch_regions)
31+
.set { manta_input }
32+
MANTA ( manta_input, ch_genome_fasta, ch_genome_fai, [] )
4833

4934
MANTA.out.diploid_sv_vcf
5035
.join(MANTA.out.diploid_sv_vcf_tbi)

subworkflows/local/call_sv_manta/tests/main.nf.test

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ nextflow_workflow {
1212

1313
config "./nextflow.config"
1414

15-
test("CALL_SV_MANTA - wgs") {
15+
test("CALL_SV_MANTA") {
1616

1717
when {
1818
workflow {
@@ -36,9 +36,7 @@ nextflow_workflow {
3636
input[2] = channel.of([id:'genome'], file(params.pipelines_testdata_base_path + 'reference/reference.fasta', checkIfExists: true)).collect()
3737
input[3] = channel.of([id:'genome'], file(params.pipelines_testdata_base_path + 'reference/reference.fasta.fai', checkIfExists: true)).collect()
3838
input[4] = channel.of([id:'justhusky'])
39-
input[5] = channel.of([[id:'target'], [], []])
40-
input[6] = channel.value([[], []])
41-
input[7] = 'wgs'
39+
input[5] = channel.value([[], []])
4240
"""
4341
}
4442
}
@@ -53,7 +51,7 @@ nextflow_workflow {
5351
)
5452
}
5553
}
56-
test("CALL_SV_MANTA - wgs, stub") {
54+
test("CALL_SV_MANTA - stub") {
5755

5856
options "-stub"
5957

@@ -79,9 +77,7 @@ nextflow_workflow {
7977
input[2] = channel.of([id:'genome'], file(params.pipelines_testdata_base_path + 'reference/reference.fasta', checkIfExists: true)).collect()
8078
input[3] = channel.of([id:'genome'], file(params.pipelines_testdata_base_path + 'reference/reference.fasta.fai', checkIfExists: true)).collect()
8179
input[4] = channel.of([id:'justhusky'])
82-
input[5] = channel.of([[id:'target'], [], []])
83-
input[6] = channel.value([[], []])
84-
input[7] = 'wgs'
80+
input[5] = channel.value([[], []])
8581
"""
8682
}
8783
}

subworkflows/local/call_sv_manta/tests/main.nf.test.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"CALL_SV_MANTA - wgs": {
2+
"CALL_SV_MANTA": {
33
"content": [
44
"9f37331609347a1685ba4862d8583b2f",
55
"2111e88e54fdd01f0492901606bcea6f"
66
],
7-
"timestamp": "2026-03-01T20:55:33.556714847",
7+
"timestamp": "2026-06-03T11:38:41.791162924",
88
"meta": {
9-
"nf-test": "0.9.4",
9+
"nf-test": "0.9.5",
1010
"nextflow": "25.10.4"
1111
}
1212
},
13-
"CALL_SV_MANTA - wgs, stub": {
13+
"CALL_SV_MANTA - stub": {
1414
"content": [
1515
{
1616
"0": [
@@ -127,9 +127,9 @@
127127
]
128128
}
129129
],
130-
"timestamp": "2026-03-05T12:58:54.578278212",
130+
"timestamp": "2026-06-03T11:39:05.440330127",
131131
"meta": {
132-
"nf-test": "0.9.4",
132+
"nf-test": "0.9.5",
133133
"nextflow": "25.10.4"
134134
}
135135
}

workflows/raredisease.nf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ workflow RAREDISEASE {
104104
ch_hgnc_ids
105105
ch_intervals_wgs
106106
ch_intervals_y
107-
ch_manta_call_regions
107+
ch_manta_regions
108108
ch_me_references
109109
ch_me_svdb_resources
110110
ch_ml_model
@@ -637,7 +637,7 @@ workflow RAREDISEASE {
637637
ch_genome_fai,
638638
ch_genome_fasta,
639639
ch_genome_hisat2index,
640-
ch_manta_call_regions,
640+
ch_manta_regions,
641641
ch_mitosalt_config,
642642
ch_mapped.mt_bam_bai,
643643
ch_mt_fai,
@@ -648,7 +648,6 @@ workflow RAREDISEASE {
648648
ch_input_fastqs,
649649
ch_subdepth,
650650
ch_svcaller_priority,
651-
ch_target_bed,
652651
skip_germlinecnvcaller,
653652
skip_mitosalt,
654653
val_analysis_type,

0 commit comments

Comments
 (0)