-
Notifications
You must be signed in to change notification settings - Fork 1
/
genomel_cohort_genotyping.cwl
271 lines (247 loc) · 8.22 KB
/
genomel_cohort_genotyping.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
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
requirements:
- class: InlineJavascriptRequirement
- class: StepInputExpressionRequirement
- class: MultipleInputFeatureRequirement
- class: ScatterFeatureRequirement
- class: SubworkflowFeatureRequirement
inputs:
job_uuid: string
bed_files: File[]
reference:
type: File
secondaryFiles: [.fai, ^.dict]
cromwell_engine: boolean
###GATK4
gvcf_files:
type: File[]
secondaryFiles: [.tbi]
gatk4_genotyping_thread_count: int
number_of_chunks_for_gatk: int
###Freebayes
bam_files:
type: File[]
secondaryFiles: [^.bai]
freebayes_thread_count: int
number_of_chunks_for_freebayes: int
###Upload
aws_config: File
aws_shared_credentials: File
upload_s3_profile: string
upload_s3_endpoint: string
upload_s3_bucket: string
outputs:
gatk4_vcf:
type: File
outputSource: sort_gatk4/sorted_vcf
freebayes_vcf:
type: File
outputSource: sort_freebayes/sorted_vcf
variant_ensemble_vcf:
type: File
outputSource: sort_ensemble/sorted_vcf
time_logs:
type: File[]
outputSource: extract_time_log/output
steps:
gatk4_cohort_genotyping:
run: ./cwl/workflows/variant_calling/gatk4_cohort_genotyping.cwl
scatter: [bed_file, output_prefix]
scatterMethod: dotproduct
in:
job_uuid: job_uuid
gvcf_files: gvcf_files
reference: reference
bed_file: bed_files
thread_count: gatk4_genotyping_thread_count
number_of_chunks: number_of_chunks_for_gatk
output_prefix:
source: bed_files
valueFrom: $(self.nameroot)
cromwell_engine: cromwell_engine
out: [time_metrics_from_gatk4_cohort_genotyping,
time_metrics_from_picard_sortvcf,
time_metrics_from_selectvariants,
gatk4_cohort_genotyping_vcf]
freebayes_cohort_genotyping:
run: ./cwl/workflows/variant_calling/freebayes.cwl
scatter: [bed_file, output_prefix]
scatterMethod: dotproduct
in:
job_uuid: job_uuid
bam_files: bam_files
reference: reference
bed_file: bed_files
thread_count: freebayes_thread_count
number_of_chunks: number_of_chunks_for_freebayes
output_prefix:
source: bed_files
valueFrom: $(self.nameroot)
cromwell_engine: cromwell_engine
out: [time_metrics_from_freebayes,
time_metrics_from_picard_sortvcf,
time_metrics_from_selectvariants,
freebayes_vcf]
sort_gatk4:
run: ./cwl/tools/variant_calling/picard_sortvcf.cwl
in:
job_uuid: job_uuid
vcf: gatk4_cohort_genotyping/gatk4_cohort_genotyping_vcf
reference_dict:
source: reference
valueFrom: $(self.secondaryFiles[1])
output_prefix:
valueFrom: 'genomel_cohort.gatk4.genomel_all'
out: [sorted_vcf, time_metrics]
sort_freebayes:
run: ./cwl/tools/variant_calling/picard_sortvcf.cwl
in:
job_uuid: job_uuid
vcf: freebayes_cohort_genotyping/freebayes_vcf
reference_dict:
source: reference
valueFrom: $(self.secondaryFiles[1])
output_prefix:
valueFrom: 'genomel_cohort.freebayes.genomel_all'
out: [sorted_vcf, time_metrics]
variant_ensemble:
run: ./cwl/tools/variant_calling/vArmyKnife_variant_ensemble.cwl
in:
job_uuid: job_uuid
reference: reference
output_name:
source: job_uuid
valueFrom: $(self + '.variant_ensemble.vcf.gz')
gatk4_vcf: sort_gatk4/sorted_vcf
freebayes_vcf: sort_freebayes/sorted_vcf
out: [ensemble_vcf, time_metrics]
sort_ensemble:
run: ./cwl/tools/variant_calling/picard_sortvcf.cwl
in:
job_uuid: job_uuid
vcf:
source: variant_ensemble/ensemble_vcf
valueFrom: $([self])
reference_dict:
source: reference
valueFrom: $(self.secondaryFiles[1])
output_prefix:
valueFrom: 'genomel_cohort.variant_ensemble.genomel_all'
out: [sorted_vcf, time_metrics]
upload_gatk4_vcf:
run: ./cwl/tools/utils/awscli_upload.cwl
in:
aws_config: aws_config
aws_shared_credentials: aws_shared_credentials
input: sort_gatk4/sorted_vcf
s3uri:
source: [upload_s3_bucket, sort_gatk4/sorted_vcf]
valueFrom: $(self[0])/$(self[1].basename)
s3_profile: upload_s3_profile
s3_endpoint: upload_s3_endpoint
out: [output, time_metrics]
upload_gatk4_vcf_index:
run: ./cwl/tools/utils/awscli_upload.cwl
in:
aws_config: aws_config
aws_shared_credentials: aws_shared_credentials
input:
source: sort_gatk4/sorted_vcf
valueFrom: $(self.secondaryFiles[0])
s3uri:
source: [upload_s3_bucket, sort_gatk4/sorted_vcf]
valueFrom: $(self[0])/$(self[1].secondaryFiles[0].basename)
s3_profile: upload_s3_profile
s3_endpoint: upload_s3_endpoint
out: [output, time_metrics]
upload_freebayes_vcf:
run: ./cwl/tools/utils/awscli_upload.cwl
in:
aws_config: aws_config
aws_shared_credentials: aws_shared_credentials
input: sort_freebayes/sorted_vcf
s3uri:
source: [upload_s3_bucket, sort_freebayes/sorted_vcf]
valueFrom: $(self[0])/$(self[1].basename)
s3_profile: upload_s3_profile
s3_endpoint: upload_s3_endpoint
out: [output, time_metrics]
upload_freebayes_vcf_index:
run: ./cwl/tools/utils/awscli_upload.cwl
in:
aws_config: aws_config
aws_shared_credentials: aws_shared_credentials
input:
source: sort_freebayes/sorted_vcf
valueFrom: $(self.secondaryFiles[0])
s3uri:
source: [upload_s3_bucket, sort_freebayes/sorted_vcf]
valueFrom: $(self[0])/$(self[1].secondaryFiles[0].basename)
s3_profile: upload_s3_profile
s3_endpoint: upload_s3_endpoint
out: [output, time_metrics]
upload_ensemble_vcf:
run: ./cwl/tools/utils/awscli_upload.cwl
in:
aws_config: aws_config
aws_shared_credentials: aws_shared_credentials
input: sort_ensemble/sorted_vcf
s3uri:
source: [upload_s3_bucket, sort_ensemble/sorted_vcf]
valueFrom: $(self[0])/$(self[1].basename)
s3_profile: upload_s3_profile
s3_endpoint: upload_s3_endpoint
out: [output, time_metrics]
upload_ensemble_vcf_index:
run: ./cwl/tools/utils/awscli_upload.cwl
in:
aws_config: aws_config
aws_shared_credentials: aws_shared_credentials
input:
source: sort_ensemble/sorted_vcf
valueFrom: $(self.secondaryFiles[0])
s3uri:
source: [upload_s3_bucket, sort_ensemble/sorted_vcf]
valueFrom: $(self[0])/$(self[1].secondaryFiles[0].basename)
s3_profile: upload_s3_profile
s3_endpoint: upload_s3_endpoint
out: [output, time_metrics]
extract_time_log:
run: ./cwl/tools/utils/extract_outputs.cwl
in:
file_array:
source: [gatk4_cohort_genotyping/time_metrics_from_gatk4_cohort_genotyping,
gatk4_cohort_genotyping/time_metrics_from_picard_sortvcf,
gatk4_cohort_genotyping/time_metrics_from_selectvariants,
freebayes_cohort_genotyping/time_metrics_from_freebayes,
freebayes_cohort_genotyping/time_metrics_from_picard_sortvcf,
freebayes_cohort_genotyping/time_metrics_from_selectvariants,
variant_ensemble/time_metrics,
sort_gatk4/time_metrics,
sort_freebayes/time_metrics,
sort_ensemble/time_metrics,
upload_gatk4_vcf/time_metrics,
upload_gatk4_vcf_index/time_metrics,
upload_freebayes_vcf/time_metrics,
upload_freebayes_vcf_index/time_metrics,
upload_ensemble_vcf/time_metrics,
upload_ensemble_vcf_index/time_metrics]
valueFrom: |
${
var log_list = []
for (var i = 0; i < self.length; i++){
if (Array.isArray(self[i])){
if (Array.isArray(self[i][0])){
for (var j = 0; j < self[i][0].length; j++){
log_list.push(self[i][0][j])
}
} else { log_list.push(self[i][0]) }
} else {
log_list.push(self[i])
}
}
return log_list
}
out: [output]