/
variant-calling-pair.cwl
342 lines (339 loc) · 12.1 KB
/
variant-calling-pair.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
id: variants-pair
requirements:
MultipleInputFeatureRequirement: {}
ScatterFeatureRequirement: {}
SubworkflowFeatureRequirement: {}
InlineJavascriptRequirement: {}
StepInputExpressionRequirement: {}
inputs:
tumor_bam: File
normal_bam: File
bed: File
normal_sample_name: string
tumor_sample_name: string
dbsnp:
type: File
secondaryFiles:
- .idx
cosmic:
type: File
secondaryFiles:
- .idx
mutect_dcov: int
mutect_rf: string[]
refseq: File
hotspot_vcf: string
ref_fasta:
type: File
secondaryFiles:
- .amb
- .ann
- .bwt
- .pac
- .sa
- .fai
- ^.dict
facets_snps: File
complex_nn: float
complex_tn: float
outputs:
combine_vcf:
type: File
outputSource: tabix_index/tabix_output_file
secondaryFiles:
- .tbi
annotate_vcf:
type: File
outputSource: annotate/annotate_vcf_output_file
snp_pileup:
type: File
outputSource: call_variants/snp_pileup
mutect_vcf:
type: File
outputSource: call_variants/mutect_vcf
mutect_callstats:
type: File
outputSource: call_variants/mutect_callstats
vardict_vcf:
type: File
outputSource: call_variants/vardict_vcf
vardict_norm_vcf:
type: File
outputSource: filtering/vardict_vcf_filtering_output
secondaryFiles:
- .tbi
mutect_norm_vcf:
type: File
outputSource: filtering/mutect_vcf_filtering_output
secondaryFiles:
- .tbi
steps:
normal_index:
run: ../../tools/cmo-utils/1.9.15/cmo-index.cwl
in:
bam: normal_bam
out: [bam_indexed]
tumor_index:
run: ../../tools/cmo-utils/1.9.15/cmo-index.cwl
in:
bam: tumor_bam
out: [bam_indexed]
call_variants:
in:
tumor_bam: tumor_index/bam_indexed
normal_bam: normal_index/bam_indexed
ref_fasta: ref_fasta
normal_sample_name: normal_sample_name
tumor_sample_name: tumor_sample_name
dbsnp: dbsnp
cosmic: cosmic
mutect_dcov: mutect_dcov
mutect_rf: mutect_rf
bed: bed
refseq: refseq
facets_snps: facets_snps
out: [ vardict_vcf, mutect_vcf, mutect_callstats, snp_pileup]
run:
class: Workflow
id: call-variants
inputs:
normal_bam: File
tumor_bam: File
ref_fasta: File
normal_sample_name: string
tumor_sample_name: string
dbsnp: File
cosmic: File
mutect_dcov: int
mutect_rf: string[]
bed: File
refseq: File #file of refseq genes...
facets_snps: File
outputs:
mutect_vcf:
type: File
outputSource: mutect/output
mutect_callstats:
type: File
outputSource: mutect/callstats_output
vardict_vcf:
type: File
outputSource: vardict/output
snp_pileup:
type: File
outputSource: snp_pileup/out_file
steps:
snp_pileup:
run: ../../tools/htstools/0.1.1/snp-pileup.cwl
in:
normal_bam: normal_bam
tumor_bam: tumor_bam
vcf: facets_snps
output_file:
valueFrom: ${ return inputs.normal_bam.basename.replace(".bam", "") + "__" + inputs.tumor_bam.basename.replace(".bam", "") + ".dat.gz"; }
count_orphans:
valueFrom: ${ return true; }
gzip:
valueFrom: ${ return true; }
pseudo_snps:
default: "50"
out: [out_file]
vardict:
run: ../../tools/vardict/1.5.1/vardict.cwl
in:
G: ref_fasta
b: tumor_bam
b2: normal_bam
N: tumor_sample_name
N2: normal_sample_name
bedfile: bed
C:
default: true
D:
default: false
x:
default: '2000'
H:
default: false
th:
default: '4'
E:
default: '3'
i:
default: false
hh:
default: false
f:
default: '0.01'
c:
default: '1'
Q:
default: '20'
X:
default: '5'
z:
default: '1'
S:
default: '2'
p:
default: false
q:
default: '20'
t:
default: false
vcf:
valueFrom: ${ return inputs.b.basename.replace(".bam", ".") + inputs.b2.basename.replace(".bam", ".vardict.vcf") }
out: [output]
mutect:
run: ../../tools/mutect/1.1.4/mutect.cwl
in:
reference_sequence: ref_fasta
dbsnp: dbsnp
cosmic: cosmic
input_file_normal: normal_bam
input_file_tumor: tumor_bam
read_filter: mutect_rf
downsample_to_coverage: mutect_dcov
intervals: bed
vcf:
valueFrom: ${ return inputs.input_file_tumor.basename.replace(".bam",".") + inputs.input_file_normal.basename.replace(".bam", ".mutect.vcf") }
out:
valueFrom: ${ return inputs.input_file_tumor.basename.replace(".bam",".") + inputs.input_file_normal.basename.replace(".bam", ".mutect.txt") }
out: [output, callstats_output]
filtering:
in:
complex_nn: complex_nn
complex_tn: complex_tn
normal_bam: normal_bam
tumor_bam: tumor_bam
mutect_vcf: call_variants/mutect_vcf
mutect_callstats: call_variants/mutect_callstats
vardict_vcf: call_variants/vardict_vcf
tumor_sample_name: tumor_sample_name
hotspot_vcf: hotspot_vcf
ref_fasta: ref_fasta
out: [vardict_vcf_filtering_output, mutect_vcf_filtering_output]
run:
class: Workflow
id: filtering
inputs:
complex_nn: float
complex_tn: float
normal_bam: File
tumor_bam: File
mutect_vcf: File
mutect_callstats: File
vardict_vcf: File
hotspot_vcf: string
tumor_sample_name: string
ref_fasta: File
outputs:
mutect_vcf_filtering_output:
type: File
outputSource: mutect_filtering_step/vcf
secondaryFiles:
- .tbi
vardict_vcf_filtering_output:
type: File
outputSource: vardict_filtering_step/vcf
secondaryFiles:
- .tbi
steps:
mutect_filtering_step:
run: ../../tools/basic-filtering.mutect/0.3/basic-filtering.mutect.cwl
in:
inputVcf: mutect_vcf
inputTxt: mutect_callstats
tsampleName: tumor_sample_name
hotspotVcf: hotspot_vcf
refFasta: ref_fasta
out: [vcf]
vardict_complex_filtering_step:
run: ../../tools/basic-filtering.complex/0.3/basic-filtering.complex.cwl
in:
nrm_noise: complex_nn
tum_noise: complex_tn
inputVcf: vardict_vcf
normal_bam: normal_bam
tumor_bam: tumor_bam
tumor_id: tumor_sample_name
output_vcf:
valueFrom: ${ return inputs.inputVcf.basename.replace(".vcf", ".complex_filtered.vcf"); }
out: [vcf]
vardict_filtering_step:
run: ../../tools/basic-filtering.vardict/0.3/basic-filtering.vardict.cwl
in:
inputVcf: vardict_complex_filtering_step/vcf
tsampleName: tumor_sample_name
hotspotVcf: hotspot_vcf
refFasta: ref_fasta
out: [vcf]
create_vcf_file_array:
in:
vcf_vardict: filtering/vardict_vcf_filtering_output
vcf_mutect: filtering/mutect_vcf_filtering_output
out: [ vcf_files ]
run:
class: ExpressionTool
id: create-vcf-file-array
requirements:
- class: InlineJavascriptRequirement
inputs:
vcf_vardict:
type: File
secondaryFiles:
- .tbi
vcf_mutect:
type: File
secondaryFiles:
- .tbi
outputs:
vcf_files:
type:
type: array
items: File
secondaryFiles:
- .tbi
expression: "${ var project_object = {};
project_object['vcf_files'] = [ inputs.vcf_vardict, inputs.vcf_mutect];
return project_object;
}"
concat:
run: ../../tools/bcftools.concat/1.9/bcftools.concat.cwl
in:
vcf_files_tbi: create_vcf_file_array/vcf_files
tumor_sample_name: tumor_sample_name
normal_sample_name: normal_sample_name
allow_overlaps:
valueFrom: ${ return true; }
rm_dups:
valueFrom: ${ return "all"; }
output_type:
valueFrom: ${ return "z"; }
output:
valueFrom: ${ return inputs.tumor_sample_name + "." + inputs.normal_sample_name + ".combined-variants.vcf.gz" }
out: [concat_vcf_output_file]
tabix_index:
run: ../../tools/tabix/1.9/tabix.cwl
in:
input_vcf: concat/concat_vcf_output_file
preset:
valueFrom: ${ return "vcf"; }
out: [tabix_output_file]
annotate:
run: ../../tools/bcftools.annotate/1.9/bcftools.annotate.cwl
in:
annotations: filtering/mutect_vcf_filtering_output
tumor_sample_name: tumor_sample_name
normal_sample_name: normal_sample_name
columns:
valueFrom: ${ return ["INFO/FAILURE_REASON"]; }
mark_sites:
valueFrom: ${ return "+set=MuTect"; }
vcf_file_tbi: tabix_index/tabix_output_file
output:
valueFrom: ${ return inputs.tumor_sample_name + "." + inputs.normal_sample_name + ".annotate-variants.vcf" }
out: [annotate_vcf_output_file]