forked from garyluu/testWorkflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetadata_example2.wdl
More file actions
199 lines (152 loc) · 4.33 KB
/
metadata_example2.wdl
File metadata and controls
199 lines (152 loc) · 4.33 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
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
task combine_signif_pairs {
Array[File] signifpairs
String prefix
Int memory
Int disk_space
Int num_threads
Int num_preempt
command {
set -euo pipefail
/src/combine_signif_pairs.py ${write_lines(signifpairs)} ${prefix}
}
runtime {
docker: "gcr.io/broad-cga-francois-gtex/gtex_eqtl:V8"
memory: "${memory}GB"
disks: "local-disk ${disk_space} HDD"
cpu: "${num_threads}"
preemptible: "${num_preempt}"
}
output {
File combined_signifpairs="${prefix}.combined_signifpairs.txt.gz"
}
}
task extract_pairs {
File input_pairs
File extract_pairs
String prefix
Int memory
Int disk_space
Int num_threads
Int num_preempt
command {
set -euo pipefail
/src/extract_pairs.py ${input_pairs} ${extract_pairs} ${prefix} --feather
}
runtime {
docker: "gcr.io/broad-cga-francois-gtex/gtex_eqtl:V8"
memory: "${memory}GB"
disks: "local-disk ${disk_space} HDD"
cpu: "${num_threads}"
preemptible: "${num_preempt}"
}
output {
File extracted_pairs="${prefix}.extracted_pairs.ft"
}
meta {
author: "Francois Aguet"
}
}
task metasoft_prepare_input {
Array[File] pair_files
String prefix
Int? chunks
Int memory
Int disk_space
Int num_threads
Int num_preempt
command {
set -euo pipefail
/src/metasoft_prepare_input.py ${write_lines(pair_files)} ${prefix} ${"--chunks " + chunks} --write_full
}
runtime {
docker: "gcr.io/broad-cga-francois-gtex/gtex_eqtl:V8"
memory: "${memory}GB"
disks: "local-disk ${disk_space} HDD"
cpu: "${num_threads}"
preemptible: "${num_preempt}"
}
output {
File metasoft_input = "${prefix}.metasoft_input.txt.gz"
Array[File] metasoft_input_chunks = glob("${prefix}.metasoft_input.chunk*.txt.gz")
}
meta {
author: "Francois Aguet"
}
}
task metasoft_scatter {
File metasoft_input
String prefix
Int memory
Int disk_space
Int num_threads
Int num_preempt
command {
set -euo pipefail
/src/run_metasoft.py /opt/metasoft/Metasoft.jar ${metasoft_input} ${prefix}
}
runtime {
docker: "gcr.io/broad-cga-francois-gtex/gtex_eqtl:V8"
memory: "${memory}GB"
disks: "local-disk ${disk_space} HDD"
cpu: "${num_threads}"
preemptible: "${num_preempt}"
}
output {
File metasoft_output="${prefix}.metasoft.txt.gz"
File metasoft_log="${prefix}.metasoft.log"
}
meta {
author: "Francois Aguet"
}
}
task metasoft_postprocess {
Array[File] metasoft_chunks
Array[File] pair_files
String prefix
Int memory
Int disk_space
Int num_threads
Int num_preempt
command {
set -euo pipefail
/src/metasoft_postprocess.py ${write_lines(metasoft_chunks)} ${write_lines(pair_files)} ${prefix}
}
runtime {
docker: "gcr.io/broad-cga-francois-gtex/gtex_eqtl:V8"
memory: "${memory}GB"
disks: "local-disk ${disk_space} HDD"
cpu: "${num_threads}"
preemptible: "${num_preempt}"
}
output {
File metasoft_output="${prefix}.metasoft.txt.gz"
}
meta {
author: "Kinda like Francois Aguet but not"
}
}
workflow metasoft_workflow {
Array[File] signifpairs
Array[File] allpairs
Array[String] sample_ids
String prefix
call combine_signif_pairs { input: signifpairs=signifpairs, prefix=prefix }
# for each sample set, extract same set of pairs
scatter(i in range(length(allpairs))) {
call extract_pairs { input: input_pairs=allpairs[i], extract_pairs=combine_signif_pairs.combined_signifpairs, prefix=sample_ids[i]}
}
call metasoft_prepare_input { input: pair_files=extract_pairs.extracted_pairs, prefix=prefix}
scatter(chunk in metasoft_prepare_input.metasoft_input_chunks) {
call metasoft_scatter {
input: metasoft_input=chunk, prefix=prefix
}
}
call metasoft_postprocess {
input: metasoft_chunks=metasoft_scatter.metasoft_output, pair_files=extract_pairs.extracted_pairs, prefix=prefix
}
meta {
author : "Mr. Foo"
email : "foo@foo.com"
description: "This is a cool workflow"
}
}