-
Notifications
You must be signed in to change notification settings - Fork 58
/
phase_vcf.cwl
101 lines (99 loc) · 2.73 KB
/
phase_vcf.cwl
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
label: "phase VCF"
requirements:
- class: SubworkflowFeatureRequirement
- class: StepInputExpressionRequirement
- class: InlineJavascriptRequirement
inputs:
somatic_vcf:
type: File
secondaryFiles: [.tbi]
germline_vcf:
type: File
reference:
type:
- string
- File
secondaryFiles: [.fai, ^.dict]
reference_dict:
type: File
bam:
type: File
secondaryFiles: ${if (self.nameext === ".bam") {return self.basename + ".bai"} else {return self.basename + ".crai"}}
normal_sample_name:
type: string
tumor_sample_name:
type: string
outputs:
phased_vcf:
type: File
outputSource: bgzip_and_index_phased_vcf/indexed_vcf
secondaryFiles: [.tbi]
steps:
rename_germline_vcf:
run: ../tools/replace_vcf_sample_name.cwl
in:
input_vcf: germline_vcf
sample_to_replace: normal_sample_name
new_sample_name: tumor_sample_name
out: [renamed_vcf]
index_renamed_germline:
run: ../tools/index_vcf.cwl
in:
vcf: rename_germline_vcf/renamed_vcf
out:
[indexed_vcf]
select_somatic_tumor_sample:
run: ../tools/select_variants.cwl
in:
reference: reference
vcf: somatic_vcf
output_vcf_basename:
default: 'somatic_tumor_only'
samples_to_include:
source: tumor_sample_name
valueFrom: ${ return [self]; }
out:
[filtered_vcf]
index_filtered_somatic:
run: ../tools/index_vcf.cwl
in:
vcf: select_somatic_tumor_sample/filtered_vcf
out: [indexed_vcf]
combine_variants:
run: ../tools/pvacseq_combine_variants.cwl
in:
reference: reference
germline_vcf: index_renamed_germline/indexed_vcf
somatic_vcf: index_filtered_somatic/indexed_vcf
out:
[combined_vcf]
sort:
run: ../tools/sort_vcf.cwl
in:
vcf: combine_variants/combined_vcf
reference_dict: reference_dict
out:
[sorted_vcf]
bgzip_and_index:
run: bgzip_and_index.cwl
in:
vcf: sort/sorted_vcf
out:
[indexed_vcf]
phase_vcf:
run: ../tools/read_backed_phasing.cwl
in:
reference: reference
bam: bam
vcf: bgzip_and_index/indexed_vcf
out:
[phased_vcf]
bgzip_and_index_phased_vcf:
run: bgzip_and_index.cwl
in:
vcf: phase_vcf/phased_vcf
out:
[indexed_vcf]