-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathidmWorkflow.wdl
236 lines (218 loc) · 10.4 KB
/
idmWorkflow.wdl
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
version 1.0
struct ModelInputs {
String model
Map[String, String] parameters
}
task run_epispot {
input {
File setup_os_script
File install_git_script
File install_python_script
File install_model_script
File run_model_script
File run_model_executable
String git_repository_url
Int start
Int stop
Int num_samples
String pop_size
}
command {
${setup_os_script}
${install_git_script}
${install_python_script}
${install_model_script} "${git_repository_url}"
${run_model_script} "${run_model_executable}" "${git_repository_url}" "${start}" "${stop}" "${num_samples}" "${pop_size}"
}
runtime {
docker: "python:3.9.18-slim-bullseye"
}
output {
# File response = stdout()
File epispot_results_txt = "results/comp_pop_over_time-${start}-${stop}-${num_samples}-${pop_size}.txt"
File epispot_results_png = "results/comp_pop_over_time-${start}-${stop}-${num_samples}-${pop_size}.png"
}
}
task run_bayesian {
input {
File setup_os_script
File install_git_script
File install_python_script
File install_model_script
File run_model_script
String git_repository_url
String state
String start_date
String end_date
}
command {
${setup_os_script}
${install_git_script}
${install_python_script}
${install_model_script} "${git_repository_url}"
${run_model_script} "${git_repository_url}" "${state}" "${start_date}" "${end_date}"
}
runtime {
docker: "python:3.6.15-bullseye"
}
output {
# File response = stdout()
File results_samples = "bayesian-covid-model-demo/scripts/results/samples/${state}.npz"
File results_summary = "bayesian-covid-model-demo/scripts/results/summary/${state}.txt"
File results_vis_r0 = "bayesian-covid-model-demo/scripts/results/vis/${state}_R0.png"
File results_vis_scale_lin_daily_False_T_28 = "bayesian-covid-model-demo/scripts/results/vis/${state}_scale_lin_daily_False_T_28.png"
File results_vis_scale_lin_daily_False_T_56 = "bayesian-covid-model-demo/scripts/results/vis/${state}_scale_lin_daily_False_T_56.png"
File results_vis_scale_lin_daily_True_T_28 = "bayesian-covid-model-demo/scripts/results/vis/${state}_scale_lin_daily_True_T_28.png"
File results_vis_scale_lin_daily_True_T_56 = "bayesian-covid-model-demo/scripts/results/vis/${state}_scale_lin_daily_True_T_56.png"
File results_vis_scale_log_daily_False_T_28 = "bayesian-covid-model-demo/scripts/results/vis/${state}_scale_log_daily_False_T_28.png"
File results_vis_scale_log_daily_False_T_56 = "bayesian-covid-model-demo/scripts/results/vis/${state}_scale_log_daily_False_T_56.png"
File results_vis_scale_log_daily_True_T_28 = "bayesian-covid-model-demo/scripts/results/vis/${state}_scale_log_daily_True_T_28.png"
File results_vis_scale_log_daily_True_T_56 = "bayesian-covid-model-demo/scripts/results/vis/${state}_scale_log_daily_True_T_56.png"
}
}
task run_seir {
input {
File setup_os_script
File install_SEIR_script
File SEIR_script
}
command {
${setup_os_script}
${install_SEIR_script}
R --slave --no-save --no-restore --no-site-file --no-environ -f ${SEIR_script} --args ""
}
runtime {
docker: "npanicker/r-desolve:1.1"
}
output {
# File response = stdout()
File seir_results = "Rplots.pdf"
}
}
task moveResults {
input {
File move_results_script
File epispot_results_txt
File epispot_results_png
File bayesian_results_samples
File bayesian_results_summary
File bayesian_results_vis_r0
File bayesian_results_vis_scale_lin_daily_False_T_28
File bayesian_results_vis_scale_lin_daily_False_T_56
File bayesian_results_vis_scale_lin_daily_True_T_28
File bayesian_results_vis_scale_lin_daily_True_T_56
File bayesian_results_vis_scale_log_daily_False_T_28
File bayesian_results_vis_scale_log_daily_False_T_56
File bayesian_results_vis_scale_log_daily_True_T_28
File bayesian_results_vis_scale_log_daily_True_T_56
File seir_results
}
command {
${move_results_script} "${epispot_results_txt}"
${move_results_script} "${epispot_results_png}"
${move_results_script} "${bayesian_results_samples}" "samples"
${move_results_script} "${bayesian_results_summary}" "summary"
${move_results_script} "${bayesian_results_vis_r0}" "vis"
${move_results_script} "${bayesian_results_vis_scale_lin_daily_False_T_28}" "vis"
${move_results_script} "${bayesian_results_vis_scale_lin_daily_False_T_56}" "vis"
${move_results_script} "${bayesian_results_vis_scale_lin_daily_True_T_28}" "vis"
${move_results_script} "${bayesian_results_vis_scale_lin_daily_True_T_56}" "vis"
${move_results_script} "${bayesian_results_vis_scale_log_daily_False_T_28}" "vis"
${move_results_script} "${bayesian_results_vis_scale_log_daily_False_T_56}" "vis"
${move_results_script} "${bayesian_results_vis_scale_log_daily_True_T_28}" "vis"
${move_results_script} "${bayesian_results_vis_scale_log_daily_True_T_56}" "vis"
${move_results_script} "${seir_results}"
}
output {
String out = read_string(stdout())
}
}
workflow idmWorkflow {
input {
File jsonFile = "model_input_parameters.json"
}
Array[ModelInputs] modelInputs = read_json(jsonFile)
scatter (modelInput in modelInputs){
String modelName = modelInput.model
if (modelName=="epispot") {
Map[String, String] epispotMap = modelInput.parameters
}
if (modelName=="bayesian") {
Map[String, String] bayesianMap = modelInput.parameters
}
}
Map[String, String] epispot = select_first(epispotMap)
Map[String, String] bayesian = select_first(bayesianMap)
call run_epispot {
input:
setup_os_script = "./scripts/sh/setup_os.sh",
install_git_script = "./scripts/sh/install_git.sh",
install_python_script = "./scripts/sh/epispot/install_python_libraries.sh",
install_model_script = "./scripts/sh/epispot/install_model.sh",
run_model_script = "./scripts/sh/epispot/run_model.sh",
run_model_executable = "./scripts/python/epispot_run.py",
git_repository_url = "https://github.com/epispot/epispot",
start = epispot["start"],
stop = epispot["stop"],
num_samples = epispot["num_samples"],
pop_size = epispot["pop_size"]
}
call run_bayesian {
input:
setup_os_script = "./scripts/sh/setup_os.sh",
install_git_script = "./scripts/sh/install_git.sh",
install_python_script = "./scripts/sh/bayesian/install_python_libraries.sh",
install_model_script = "./scripts/sh/bayesian/install_model.sh",
run_model_script = "./scripts/sh/bayesian/run_model.sh",
git_repository_url = "https://github.com/midas-network/bayesian-covid-model-demo.git",
state = bayesian["state"],
start_date = bayesian["start_date"],
end_date = bayesian["end_date"]
}
call run_seir {
input:
setup_os_script = "./scripts/sh/setup_os.sh",
install_SEIR_script = "./scripts/sh/seir/install_SEIR.sh",
SEIR_script = "./scripts/R/seir/SEIR.R",
}
output {
# File epispot_response = run_epispot.response
File epispot_results_txt = run_epispot.epispot_results_txt
File epispot_results_png = run_epispot.epispot_results_png
# File response = run_bayesian.response
File bayesian_results_samples = run_bayesian.results_samples
File bayesian_results_summary = run_bayesian.results_summary
File bayesian_results_vis_r0 = run_bayesian.results_vis_r0
File bayesian_results_vis_scale_lin_daily_False_T_28 = run_bayesian.results_vis_scale_lin_daily_False_T_28
File bayesian_results_vis_scale_lin_daily_False_T_56 = run_bayesian.results_vis_scale_lin_daily_False_T_56
File bayesian_results_vis_scale_lin_daily_True_T_28 = run_bayesian.results_vis_scale_lin_daily_True_T_28
File bayesian_results_vis_scale_lin_daily_True_T_56 = run_bayesian.results_vis_scale_lin_daily_True_T_56
File bayesian_results_vis_scale_log_daily_False_T_28 = run_bayesian.results_vis_scale_log_daily_False_T_28
File bayesian_results_vis_scale_log_daily_False_T_56 = run_bayesian.results_vis_scale_log_daily_False_T_56
File bayesian_results_vis_scale_log_daily_True_T_28 = run_bayesian.results_vis_scale_log_daily_True_T_28
File bayesian_results_vis_scale_log_daily_True_T_56 = run_bayesian.results_vis_scale_log_daily_True_T_56
# File seir_response = run_seir.response
File seir_results = run_seir.seir_results
}
call moveResults {
input:
move_results_script = "./scripts/sh/move_results.sh",
# epispot_response = epispot_response,
epispot_results_txt = epispot_results_txt,
epispot_results_png = epispot_results_png,
# bayesian_response = bayesian_response,
bayesian_results_samples = bayesian_results_samples,
bayesian_results_summary = bayesian_results_summary,
bayesian_results_vis_r0 = bayesian_results_vis_r0,
bayesian_results_vis_scale_lin_daily_False_T_28 = bayesian_results_vis_scale_lin_daily_False_T_28,
bayesian_results_vis_scale_lin_daily_False_T_56 = bayesian_results_vis_scale_lin_daily_False_T_56,
bayesian_results_vis_scale_lin_daily_True_T_28 = bayesian_results_vis_scale_lin_daily_True_T_28,
bayesian_results_vis_scale_lin_daily_True_T_56 = bayesian_results_vis_scale_lin_daily_True_T_56,
bayesian_results_vis_scale_log_daily_False_T_28 = bayesian_results_vis_scale_log_daily_False_T_28,
bayesian_results_vis_scale_log_daily_False_T_56 = bayesian_results_vis_scale_log_daily_False_T_56,
bayesian_results_vis_scale_log_daily_True_T_28 = bayesian_results_vis_scale_log_daily_True_T_28,
bayesian_results_vis_scale_log_daily_True_T_56 = bayesian_results_vis_scale_log_daily_True_T_56,
# seir_response = seir_response,
seir_results = seir_results
}
}