forked from genome/analysis-workflows
/
detect_variants.cwl
397 lines (396 loc) · 12.7 KB
/
detect_variants.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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
label: "Detect Variants workflow"
requirements:
- class: SubworkflowFeatureRequirement
- class: SchemaDefRequirement
types:
- $import: ../types/vep_custom_annotation.yml
inputs:
reference:
type:
- string
- File
secondaryFiles: [.fai, ^.dict]
tumor_bam:
type: File
secondaryFiles: [.bai,^.bai]
normal_bam:
type: File
secondaryFiles: [.bai,^.bai]
interval_list:
type: File
strelka_exome_mode:
type: boolean
strelka_cpu_reserved:
type: int?
default: 8
readcount_minimum_base_quality:
type: int?
readcount_minimum_mapping_quality:
type: int?
mutect_scatter_count:
type: int
default: 50
varscan_strand_filter:
type: int?
default: 0
varscan_min_coverage:
type: int?
default: 8
varscan_min_var_freq:
type: float?
default: 0.1
varscan_p_value:
type: float?
default: 0.99
varscan_max_normal_freq:
type: float?
pindel_insert_size:
type: int
default: 400
docm_vcf:
type: File
secondaryFiles: [.tbi]
filter_docm_variants:
type: boolean
default: true
vep_cache_dir:
type: string
vep_ensembl_assembly:
type: string
doc: "genome assembly to use in vep. Examples: GRCh38 or GRCm38"
vep_ensembl_version:
type: string
doc: "ensembl version - Must be present in the cache directory. Example: 95"
vep_ensembl_species:
type: string
doc: "ensembl species - Must be present in the cache directory. Examples: homo_sapiens or mus_musculus"
synonyms_file:
type: File?
annotate_coding_only:
type: boolean?
vep_pick:
type:
- "null"
- type: enum
symbols: ["pick", "flag_pick", "pick_allele", "per_gene", "pick_allele_gene", "flag_pick_allele", "flag_pick_allele_gene"]
vep_plugins:
type: string[]
default: [Downstream, Wildtype]
filter_gnomADe_maximum_population_allele_frequency:
type: float
default: 0.001
filter_mapq0_threshold:
type: float
default: 0.15
filter_minimum_depth:
type: int
default: 1
cle_vcf_filter:
type: boolean
default: false
filter_somatic_llr_threshold:
type: float
default: 5
variants_to_table_fields:
type: string[]
default: [CHROM,POS,ID,REF,ALT,set,AC,AF]
variants_to_table_genotype_fields:
type: string[]
default: [GT,AD]
vep_to_table_fields:
type: string[]
default: [HGVSc,HGVSp]
tumor_sample_name:
type: string
normal_sample_name:
type: string
vep_custom_annotations:
type: ../types/vep_custom_annotation.yml#vep_custom_annotation[]
doc: "custom type, check types directory for input format"
known_variants:
type: File?
secondaryFiles: [.tbi]
doc: "Previously discovered variants to be flagged in this pipelines's output vcf"
outputs:
mutect_unfiltered_vcf:
type: File
outputSource: mutect/unfiltered_vcf
secondaryFiles: [.tbi]
mutect_filtered_vcf:
type: File
outputSource: mutect/filtered_vcf
secondaryFiles: [.tbi]
strelka_unfiltered_vcf:
type: File
outputSource: strelka/unfiltered_vcf
secondaryFiles: [.tbi]
strelka_filtered_vcf:
type: File
outputSource: strelka/filtered_vcf
secondaryFiles: [.tbi]
varscan_unfiltered_vcf:
type: File
outputSource: varscan/unfiltered_vcf
secondaryFiles: [.tbi]
varscan_filtered_vcf:
type: File
outputSource: varscan/filtered_vcf
secondaryFiles: [.tbi]
pindel_unfiltered_vcf:
type: File
outputSource: pindel/unfiltered_vcf
secondaryFiles: [.tbi]
pindel_filtered_vcf:
type: File
outputSource: pindel/filtered_vcf
secondaryFiles: [.tbi]
docm_filtered_vcf:
type: File
outputSource: docm/docm_variants_vcf
secondaryFiles: [.tbi]
final_vcf:
type: File
outputSource: index/indexed_vcf
secondaryFiles: [.tbi]
final_filtered_vcf:
type: File
outputSource: annotated_filter_index/indexed_vcf
secondaryFiles: [.tbi]
final_tsv:
type: File
outputSource: add_vep_fields_to_table/annotated_variants_tsv
vep_summary:
type: File
outputSource: annotate_variants/vep_summary
tumor_snv_bam_readcount_tsv:
type: File
outputSource: tumor_bam_readcount/snv_bam_readcount_tsv
tumor_indel_bam_readcount_tsv:
type: File
outputSource: tumor_bam_readcount/indel_bam_readcount_tsv
normal_snv_bam_readcount_tsv:
type: File
outputSource: normal_bam_readcount/snv_bam_readcount_tsv
normal_indel_bam_readcount_tsv:
type: File
outputSource: normal_bam_readcount/indel_bam_readcount_tsv
steps:
mutect:
run: ../subworkflows/mutect.cwl
in:
reference: reference
tumor_bam: tumor_bam
normal_bam: normal_bam
interval_list: interval_list
scatter_count: mutect_scatter_count
tumor_sample_name: tumor_sample_name
out:
[unfiltered_vcf, filtered_vcf]
strelka:
run: ../subworkflows/strelka_and_post_processing.cwl
in:
reference: reference
tumor_bam: tumor_bam
normal_bam: normal_bam
interval_list: interval_list
exome_mode: strelka_exome_mode
cpu_reserved: strelka_cpu_reserved
normal_sample_name: normal_sample_name
tumor_sample_name: tumor_sample_name
out:
[unfiltered_vcf, filtered_vcf]
varscan:
run: ../subworkflows/varscan_pre_and_post_processing.cwl
in:
reference: reference
tumor_bam: tumor_bam
normal_bam: normal_bam
interval_list: interval_list
strand_filter: varscan_strand_filter
min_coverage: varscan_min_coverage
min_var_freq: varscan_min_var_freq
p_value: varscan_p_value
max_normal_freq: varscan_max_normal_freq
normal_sample_name: normal_sample_name
tumor_sample_name: tumor_sample_name
out:
[unfiltered_vcf, filtered_vcf]
pindel:
run: ../subworkflows/pindel.cwl
in:
reference: reference
tumor_bam: tumor_bam
normal_bam: normal_bam
interval_list: interval_list
insert_size: pindel_insert_size
tumor_sample_name: tumor_sample_name
normal_sample_name: normal_sample_name
out:
[unfiltered_vcf, filtered_vcf]
docm:
run: ../subworkflows/docm_cle.cwl
in:
reference: reference
tumor_bam: tumor_bam
normal_bam: normal_bam
docm_vcf: docm_vcf
interval_list: interval_list
filter_docm_variants: filter_docm_variants
out:
[docm_variants_vcf]
combine:
run: ../tools/combine_variants.cwl
in:
reference: reference
mutect_vcf: mutect/filtered_vcf
strelka_vcf: strelka/filtered_vcf
varscan_vcf: varscan/filtered_vcf
pindel_vcf: pindel/filtered_vcf
out:
[combined_vcf]
add_docm_variants:
run: ../tools/docm_add_variants.cwl
in:
reference: reference
docm_vcf: docm/docm_variants_vcf
callers_vcf: combine/combined_vcf
out:
[merged_vcf]
decompose:
run: ../tools/vt_decompose.cwl
in:
vcf: add_docm_variants/merged_vcf
out:
[decomposed_vcf]
decompose_index:
run: ../tools/index_vcf.cwl
in:
vcf: decompose/decomposed_vcf
out:
[indexed_vcf]
annotate_variants:
run: ../tools/vep.cwl
in:
vcf: decompose_index/indexed_vcf
cache_dir: vep_cache_dir
ensembl_assembly: vep_ensembl_assembly
ensembl_version: vep_ensembl_version
ensembl_species: vep_ensembl_species
synonyms_file: synonyms_file
coding_only: annotate_coding_only
reference: reference
pick: vep_pick
custom_annotations: vep_custom_annotations
plugins: vep_plugins
out:
[annotated_vcf, vep_summary]
tumor_bam_readcount:
run: ../tools/bam_readcount.cwl
in:
vcf: annotate_variants/annotated_vcf
sample: tumor_sample_name
reference_fasta: reference
bam: tumor_bam
min_base_quality: readcount_minimum_base_quality
min_mapping_quality: readcount_minimum_mapping_quality
out:
[snv_bam_readcount_tsv, indel_bam_readcount_tsv]
normal_bam_readcount:
run: ../tools/bam_readcount.cwl
in:
vcf: annotate_variants/annotated_vcf
sample: normal_sample_name
reference_fasta: reference
bam: normal_bam
min_base_quality: readcount_minimum_base_quality
min_mapping_quality: readcount_minimum_mapping_quality
out:
[snv_bam_readcount_tsv, indel_bam_readcount_tsv]
add_tumor_bam_readcount_to_vcf:
run: ../subworkflows/vcf_readcount_annotator.cwl
in:
vcf: annotate_variants/annotated_vcf
snv_bam_readcount_tsv: tumor_bam_readcount/snv_bam_readcount_tsv
indel_bam_readcount_tsv: tumor_bam_readcount/indel_bam_readcount_tsv
data_type:
default: 'DNA'
sample_name: tumor_sample_name
out:
[annotated_bam_readcount_vcf]
add_normal_bam_readcount_to_vcf:
run: ../subworkflows/vcf_readcount_annotator.cwl
in:
vcf: add_tumor_bam_readcount_to_vcf/annotated_bam_readcount_vcf
snv_bam_readcount_tsv: normal_bam_readcount/snv_bam_readcount_tsv
indel_bam_readcount_tsv: normal_bam_readcount/indel_bam_readcount_tsv
data_type:
default: 'DNA'
sample_name: normal_sample_name
out:
[annotated_bam_readcount_vcf]
index:
run: ../tools/index_vcf.cwl
in:
vcf: add_normal_bam_readcount_to_vcf/annotated_bam_readcount_vcf
out:
[indexed_vcf]
filter_vcf:
run: ../subworkflows/filter_vcf.cwl
in:
vcf: index/indexed_vcf
filter_gnomADe_maximum_population_allele_frequency: filter_gnomADe_maximum_population_allele_frequency
filter_mapq0_threshold: filter_mapq0_threshold
filter_somatic_llr_threshold: filter_somatic_llr_threshold
filter_minimum_depth: filter_minimum_depth
tumor_bam: tumor_bam
do_cle_vcf_filter: cle_vcf_filter
reference: reference
normal_sample_name: normal_sample_name
tumor_sample_name: tumor_sample_name
gnomad_field_name:
source: vep_custom_annotations
valueFrom: |
${
if(self){
for(var i=0; i<self.length; i++){
if(self[i].annotation.gnomad_filter){
return(self[i].annotation.name + '_AF');
}
}
}
return('gnomAD_AF');
}
known_variants: known_variants
out:
[filtered_vcf]
annotated_filter_bgzip:
run: ../tools/bgzip.cwl
in:
file: filter_vcf/filtered_vcf
out:
[bgzipped_file]
annotated_filter_index:
run: ../tools/index_vcf.cwl
in:
vcf: annotated_filter_bgzip/bgzipped_file
out:
[indexed_vcf]
variants_to_table:
run: ../tools/variants_to_table.cwl
in:
reference: reference
vcf: annotated_filter_index/indexed_vcf
fields: variants_to_table_fields
genotype_fields: variants_to_table_genotype_fields
out:
[variants_tsv]
add_vep_fields_to_table:
run: ../tools/add_vep_fields_to_table.cwl
in:
vcf: annotated_filter_index/indexed_vcf
vep_fields: vep_to_table_fields
tsv: variants_to_table/variants_tsv
out: [annotated_variants_tsv]