generated from opensafely/research-template
/
project.yaml
373 lines (314 loc) · 13.6 KB
/
project.yaml
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
version: '3.0'
expectations:
population_size: 1000
actions:
generate_study_population_covid_primarycare:
run: cohortextractor:latest generate_cohort --study-definition study_definition_covid_primarycare
outputs:
highly_sensitive:
cohort: output/input_covid_primarycare.csv
generate_study_population_covid_SGSS:
run: cohortextractor:latest generate_cohort --study-definition study_definition_covid_SGSS
outputs:
highly_sensitive:
cohort: output/input_covid_SGSS.csv
generate_study_population_covid_admission:
run: cohortextractor:latest generate_cohort --study-definition study_definition_covid_admission
outputs:
highly_sensitive:
cohort: output/input_covid_admission.csv
process_1: # Covid ons death
run: r:latest analysis/process_1.R
needs: [generate_study_population_covid_primarycare, generate_study_population_covid_SGSS,generate_study_population_covid_admission]
outputs:
highly_sensitive:
case: output/case_covid_hosp.csv
control: output/control_covid_infection.csv
matching: #R MatchIt matching with replacement
run: r:latest -e 'rmarkdown::render("analysis/matching.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_1]
outputs:
moderately_sensitive:
html: output/matching.html
highly_sensitive:
rds1: output/matched_patients.rds
rds2: output/unmatched_cases.rds
csv: output/matched_patients_id.csv
check_unmatched:
run: r:latest -e 'rmarkdown::render("analysis/check_unmatched.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [matching]
outputs:
moderately_sensitive:
html: output/check_unmatched.html
extract_variables:
run: cohortextractor:latest generate_cohort --study-definition study_definition_outcome
needs: [matching]
outputs:
highly_sensitive:
cohort: output/input_outcome.csv
process_Rmatching: # add variables
run: r:latest analysis/process_Rmatching.R
needs: [extract_variables,matching]
outputs:
highly_sensitive:
cohort1: output/matched_outcome.rds
cohort2: output/matched_outcome_check.rds # filter died $ de-regist again
rds1: output/abtype79.rds
rds2: output/comor17.rds
table1: # compare before & after matching
run: r:latest -e 'rmarkdown::render("analysis/table1.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_1,process_Rmatching]
outputs:
moderately_sensitive:
html: output/table1.html
table2: # confounders
run: r:latest -e 'rmarkdown::render("analysis/table2.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/table2.html
table2_ab: # ab
run: r:latest -e 'rmarkdown::render("analysis/table2_ab.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/table2_ab.html
model:
run: r:latest -e 'rmarkdown::render("analysis/model.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/model.html
model_subgroup: # by age and sex
run: r:latest -e 'rmarkdown::render("analysis/model_subgroup.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/model_subgroup.html
# abtype modeling
model_abtype:
run: r:latest -e 'rmarkdown::render("analysis/model_abtype.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/model_abtype.html
model_time: # adjust for last AB time
run: r:latest -e 'rmarkdown::render("analysis/model_time.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/model_time.html
model_disease: # adjust for individual
run: r:latest -e 'rmarkdown::render("analysis/model_disease.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/model_disease.html
model_wave: # separate wave
run: r:latest -e 'rmarkdown::render("analysis/model_wave.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/model_wave.html
################# check ok###########
#### addintional check for 6 weeks exclusion
extract_variables_6w:
run: cohortextractor:latest generate_cohort --study-definition study_definition_outcome_6w
needs: [matching]
outputs:
highly_sensitive:
cohort: output/input_outcome_6w.csv
process_Rmatching_6w: # add variables
run: r:latest analysis/process_Rmatching_6w.R
needs: [extract_variables_6w,matching,process_Rmatching]
outputs:
highly_sensitive:
cohort1: output/matched_outcome_6w.rds
model_6w: # adjust for last AB time
run: r:latest -e 'rmarkdown::render("analysis/model_6w.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching_6w]
outputs:
moderately_sensitive:
html: output/model_6w.html
#### addintional check for 6 weeks exclusion
process_2: # died any cause
run: r:latest analysis/process_2.R
needs: [generate_study_population_covid_primarycare, generate_study_population_covid_SGSS]
outputs:
highly_sensitive:
control: output/control_covid_infection_2.csv
check_input: #
run: r:latest -e 'rmarkdown::render("analysis/check_input.Rmd", knit_root_dir = "/workspace", output_dir = "output")'
needs: [process_Rmatching,process_2,extract_variables,matching,process_matching,extract_variables_outcome_2_2,extract_variables_outcome_2_4,extract_variables_outcome_2_6,matching_2,process_1,generate_study_population_covid_primarycare, generate_study_population_covid_SGSS]
outputs:
moderately_sensitive:
html: output/check_input.html
# OS matching without replacement, ratio 2-4-6
matching_2:
run: python:latest python analysis/matching_outcome_2.py
needs: [process_1]
outputs:
moderately_sensitive:
matching_report2: output/matching_report_infection_hosp_2.txt
matching_report4: output/matching_report_infection_hosp_4.txt
matching_report6: output/matching_report_infection_hosp_6.txt
highly_sensitive:
combined2: output/matched_combined_infection_hosp_2.csv
combined4: output/matched_combined_infection_hosp_4.csv
combined6: output/matched_combined_infection_hosp_6.csv
extract_variables_outcome_2_2:
run: cohortextractor:latest generate_cohort --study-definition study_definition_outcome_2_2
needs: [matching_2]
outputs:
highly_sensitive:
cohort: output/input_outcome_2_2.csv
extract_variables_outcome_2_4:
run: cohortextractor:latest generate_cohort --study-definition study_definition_outcome_2_4
needs: [matching_2]
outputs:
highly_sensitive:
cohort: output/input_outcome_2_4.csv
extract_variables_outcome_2_6:
run: cohortextractor:latest generate_cohort --study-definition study_definition_outcome_2_6
needs: [matching_2]
outputs:
highly_sensitive:
cohort: output/input_outcome_2_6.csv
check_matching_2:
run: r:latest -e 'rmarkdown::render("analysis/check_matching_2.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [matching_2]
outputs:
moderately_sensitive:
html: output/check_matching_2.html
process_matching: # add variables
run: r:latest analysis/process_matching.R
needs: [extract_variables_outcome_2_6,extract_variables_outcome_2_4,extract_variables_outcome_2_2,matching_2]
outputs:
highly_sensitive:
cohort1: output/matched_outcome_2.csv
cohort2: output/matched_outcome_4.csv
cohort3: output/matched_outcome_6.csv
check_exposures_6:
run: r:latest -e 'rmarkdown::render("analysis/check_exposures_6.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_matching]
outputs:
moderately_sensitive:
html: output/check_exposures_6.html
check_exposures_4:
run: r:latest -e 'rmarkdown::render("analysis/check_exposures_4.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_matching]
outputs:
moderately_sensitive:
html: output/check_exposures_4.html
check_exposures_2:
run: r:latest -e 'rmarkdown::render("analysis/check_exposures_2.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_matching]
outputs:
moderately_sensitive:
html: output/check_exposures_2.html
# # R MatchIt
# matching: # matching with replacement
# run: r:latest -e 'rmarkdown::render("analysis/matching.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
# needs: [process_1]
# outputs:
# moderately_sensitive:
# html: output/matching.html
# highly_sensitive:
# rds1: output/matched_patients.rds
# rds2: output/unmatched_patients.rds
# csv: output/matched_patients_id.csv
check_matching:
run: r:latest -e 'rmarkdown::render("analysis/check_matching.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [matching]
outputs:
moderately_sensitive:
html: output/check_matching.html
# extract_variables:
# run: cohortextractor:latest generate_cohort --study-definition study_definition_outcome
# needs: [matching]
# outputs:
# highly_sensitive:
# cohort: output/input_outcome.csv
# process_Rmatching: # add variables
# run: r:latest analysis/process_Rmatching.R
# needs: [extract_variables,matching]
# outputs:
# highly_sensitive:
# cohort1: output/matched_outcome.rds
# rds1: output/abtype79.rds
# rds2: output/comor17.rds
check_exposures_cont: # continuous variables
run: r:latest -e 'rmarkdown::render("analysis/check_exposures_cont.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/check_exposures_cont.html
check_exposures_cat: # category variables
run: r:latest -e 'rmarkdown::render("analysis/check_exposures_cat.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/check_exposures_cat.html
modeling: # ab level
run: r:latest -e 'rmarkdown::render("analysis/modeling.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/modeling.html
modeling2: # ab level+ CCI + covid vaccine
run: r:latest -e 'rmarkdown::render("analysis/modeling2.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/modeling2.html
modeling3: # all
run: r:latest -e 'rmarkdown::render("analysis/modeling3.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/modeling3.html
describe_ab:
run: r:latest -e 'rmarkdown::render("analysis/describe_ab.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/describe_ab.html
# abtype modeling
modeling4: # all
run: r:latest -e 'rmarkdown::render("analysis/modeling4.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/modeling4.html
# broad ab modeling
modeling5: # all
run: r:latest -e 'rmarkdown::render("analysis/modeling5.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_Rmatching]
outputs:
moderately_sensitive:
html: output/modeling5.html
# unmatched controls
extract_variables_unmatched:
run: cohortextractor:latest generate_cohort --study-definition study_definition_unmatched
needs: [process_1]
outputs:
highly_sensitive:
cohort: output/input_unmatched.csv
process_unmatched: # add variables
run: r:latest analysis/process_unmatched.R
needs: [extract_variables_unmatched]
outputs:
highly_sensitive:
cohort1: output/unmatched_outcome.rds
# check_exposures_cont_unmatched: # continuous variables
# run: r:latest -e 'rmarkdown::render("analysis/check_exposures_cont_unmatched.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
# needs: [process_unmatched]
# outputs:
# moderately_sensitive:
# html: output/check_exposures_cont_unmatched.html
check_exposures_cat_unmatched: # category variables
run: r:latest -e 'rmarkdown::render("analysis/check_exposures_cat_unmatched.Rmd", knit_root_dir = "/workspace", output_dir="/workspace/output")'
needs: [process_unmatched]
outputs:
moderately_sensitive:
html: output/check_exposures_cat_unmatched.html