forked from nf-core/raredisease
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.nf
More file actions
61 lines (53 loc) · 2.83 KB
/
Copy pathmain.nf
File metadata and controls
61 lines (53 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// A structural variant caller workflow for manta
//
include { MANTA_GERMLINE as MANTA } from '../../../modules/nf-core/manta/germline/main'
include { BCFTOOLS_VIEW as BCFTOOLS_VIEW_MANTA } from '../../../modules/nf-core/bcftools/view/main.nf'
workflow CALL_SV_MANTA {
take:
ch_bam // channel: [mandatory] [ val(meta), path(bam) ]
ch_bai // channel: [mandatory] [ val(meta), path(bai) ]
ch_genome_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
ch_genome_fai // channel: [mandatory] [ val(meta), path(fai) ]
ch_case_info // channel: [mandatory] [ val(case_info) ]
ch_bed // channel: [mandatory for WES] [ val(meta), path(bed), path(tbi) ]
val_analysis_type // string: "wes", "wgs", or "mito"
main:
ch_bam.map{ _meta, bam -> bam }
.collect(sort: { a, b -> a.getName() <=> b.getName() })
.toList()
.set { bam_file_list }
ch_bai.map{ _meta, bai -> bai }
.collect(sort: { a, b -> a.getName() <=> b.getName() })
.toList()
.set { bai_file_list }
ch_bed.map {
_id, bed_file, index ->
return [bed_file, index]}
.set { bed_input }
if (val_analysis_type.equals("wgs")) {
ch_case_info.combine(bam_file_list)
.combine(bai_file_list)
.map { meta, input, index -> [meta, input, index] + [ [], [] ] }
.set { manta_input }
MANTA ( manta_input, ch_genome_fasta, ch_genome_fai, [] )
} else {
ch_case_info.combine(bam_file_list)
.combine(bai_file_list)
.combine(bed_input)
.set { manta_input }
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_VIEW_MANTA (ch_filter_in, [], [], [])
emit:
candidate_small_indels_vcf = MANTA.out.candidate_small_indels_vcf // channel: [ val(meta), path(vcf) ]
candidate_small_indels_vcf_tbi = MANTA.out.candidate_small_indels_vcf_tbi // channel: [ val(meta), path(tbi) ]
candidate_sv_vcf = MANTA.out.candidate_sv_vcf // channel: [ val(meta), path(vcf) ]
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 = BCFTOOLS_VIEW_MANTA.out.vcf // channel: [ val(meta), path(vcf) ]
}