generated from opensafely/research-template
/
project.yaml
387 lines (345 loc) · 13.1 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
374
375
376
377
378
379
380
381
382
383
384
385
386
387
######################################
# This script defines the project pipeline - it specifies the execution orders for all the code in this
# repo using a series of actions.
######################################
version: '3.0'
expectations:
population_size: 10000
actions:
### BASELINE COHORT ###
# Generate study population and extract baseline characteristics at Sep 3, 2022
generate_study_pop_baseline:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_baseline
--output-dir=feather
--output-format=feather
outputs:
highly_sensitive:
cohort: output/input_baseline.feather
# Data cleaning, defining exclusions, saving final study pop
data_process_baseline:
run: r:latest analysis/processing/data_process_baseline.R
needs: [generate_study_pop_baseline]
outputs:
highly_sensitive:
cohort: output/cohort/cohort_*.csv
moderately_sensitive:
descriptive: output/descriptive/total_*.csv
### EXTRACT OUTCOMES BY INDEX DATE ###
# Extract outcomes pre-campaign (index date = Sep 3)
outcomes_sep03:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-09-03"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-09-03.feather
# Extract outcomes start of campaign (index date = Oct 15)
outcomes_oct15:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-10-15"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-10-15.feather
# Extract outcomes end of campaign (index date = Nov 26 onwards)
outcomes_nov26:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-11-26"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-11-26.feather
outcomes_nov27:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-11-27"
--output-dir=index/feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-11-27.feather
outcomes_nov28:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-11-28"
--output-dir=index/feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-11-28.feather
outcomes_nov29:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-11-29"
--output-dir=index/feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-11-29.feather
outcomes_nov30:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-11-30"
--output-dir=index/feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-11-30.feather
outcomes_dec01:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-12-01"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-12-01.feather
outcomes_dec02:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-12-02"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-12-02.feather
outcomes_dec03:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-12-03"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-12-03.feather
outcomes_dec04:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-12-04"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-12-04.feather
outcomes_dec05:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-12-05"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-12-05.feather
outcomes_dec06:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-12-06"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-12-06.feather
outcomes_dec07:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-12-07"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-12-07.feather
outcomes_dec08:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-12-08"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-12-08.feather
outcomes_dec09:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_outcomes
--index-date-range "2022-12-09"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_outcomes_2022-12-09.feather
### OUTCOMES BY WEEK FOR PLOTTING ###
# Extract no. people with outcome by week
outcomes_by_week:
run: cohortextractor:latest generate_cohort
--study-definition study_definition_measures
--index-date-range "2022-09-03 to 2023-01-28 by week"
--output-dir=feather
--output-format=feather
needs: [data_process_baseline]
outputs:
highly_sensitive:
cohort: output/input_*.feather
# Generate measures
generate_measures:
run:
cohortextractor:latest generate_measures
--study-definition study_definition_measures
--output-dir output/
needs: [data_process_baseline, outcomes_by_week]
outputs:
moderately_sensitive:
measure_csv: output/measure_*.csv
# Plots outcomes by week
plot_outcomes:
run: r:latest analysis/descriptive/plot_outcomes_by_week.R
needs: [generate_measures]
outputs:
moderately_sensitive:
outcomes: output/descriptive/outcomes_*.csv
plot: output/descriptive/outcomes_by_week.png
### OTHER PLOTS AND TABLES ###
# No. outcomes by age for table
aggregate_outcomes:
run: r:latest analysis/processing/aggregate_outcomes.R
needs: [outcomes_sep03, outcomes_oct15, outcomes_nov26]
outputs:
moderately_sensitive:
outcomes: output/covid_outcomes/by_start_date/outcomes_*.csv
# Plots of booster uptake by age
booster_uptake:
run: r:latest analysis/descriptive/booster_uptake.R
needs: [data_process_baseline]
outputs:
moderately_sensitive:
rates_csv: output/cumulative_rates/final_*.csv
plot: output/cumulative_rates/plot_*.png
# Extract demographics by age for plotting discontinuities
demographics:
run: r:latest analysis/descriptive/demographics.R
needs: [data_process_baseline]
outputs:
moderately_sensitive:
demographics_csv: output/descriptive/demographics_*.csv
fluvaccine_csv: output/descriptive/fluvax_*.csv
# Extract demographics for table
demographics_table:
run: r:latest analysis/descriptive/demographics_table.R
needs: [data_process_baseline]
outputs:
moderately_sensitive:
demographics_csv: output/descriptive/demographics_for_table*.csv
time_csv: output/descriptive/time_*.csv
flu_csv: output/descriptive/fluvax_booster*.csv
### REGRESSION ANALYSES ###
# Sharp analysis #
sharp_analysis:
run: r:latest analysis/statistical_analysis/sharp_analysis.R
needs: [outcomes_sep03, outcomes_oct15, outcomes_nov26, outcomes_nov27, outcomes_nov28, outcomes_nov29,
outcomes_nov30, outcomes_dec01, outcomes_dec02, outcomes_dec03, outcomes_dec04, outcomes_dec05,
outcomes_dec06, outcomes_dec07, outcomes_dec08, outcomes_dec09]
outputs:
moderately_sensitive:
predicted_csv: output/modelling/predicted_sharp_*.csv
coefficients1_csv: output/modelling/coef_sharp_*.csv
coefficients2_csv: output/modelling/final/coef_sharp_*.csv
plot_data_csv: output/modelling/plot_data_*.csv
plot: output/modelling/figures/plot_sharp_*.png
# Sharp analysis - sensitivity excluding age 50 #
sharp_analysis_sens:
run: r:latest analysis/statistical_analysis/sharp_analysis_sens.R
needs: [outcomes_sep03, outcomes_oct15, outcomes_nov26, outcomes_nov27, outcomes_nov28, outcomes_nov29,
outcomes_nov30, outcomes_dec01, outcomes_dec02, outcomes_dec03, outcomes_dec04, outcomes_dec05,
outcomes_dec06, outcomes_dec07, outcomes_dec08, outcomes_dec09]
outputs:
moderately_sensitive:
#predicted_csv: output/modelling/predicted_sharp_sens_*.csv
coefficients1_csv: output/modelling/coef_sharp_sens_*.csv
coefficients2_csv: output/modelling/final/coef_sharp_sens_*.csv
#plot_data_csv: output/modelling/plot_data_sens_*.csv
#plot: output/modelling/figures/plot_sharp_sens_*.png
# Fuzzy analysis #
fuzzy_analysis:
run: r:latest analysis/statistical_analysis/fuzzy_analysis.R
needs: [outcomes_nov26, outcomes_nov27, outcomes_nov28, outcomes_nov29,
outcomes_nov30, outcomes_dec01, outcomes_dec02, outcomes_dec03, outcomes_dec04, outcomes_dec05,
outcomes_dec06, outcomes_dec07, outcomes_dec08, outcomes_dec09]
outputs:
moderately_sensitive:
coefficients_csv: output/modelling/iv/coef_iv*.csv
final_csv: output/modelling/final/coef_i*.csv
data_csv: output/modelling/iv/data_*.csv
summ_txt: output/modelling/iv/summ_*.txt
# Fuzzy analysis (without adjusting for flu vax) #
fuzzy_analysis_sens:
run: r:latest analysis/statistical_analysis/fuzzy_analysis_sens.R
needs: [outcomes_nov26, outcomes_nov27, outcomes_nov28, outcomes_nov29,
outcomes_nov30, outcomes_dec01, outcomes_dec02, outcomes_dec03, outcomes_dec04, outcomes_dec05,
outcomes_dec06, outcomes_dec07, outcomes_dec08, outcomes_dec09]
outputs:
moderately_sensitive:
coefficients_csv: output/modelling/iv/sens/coef_iv_sens_*.csv
final_csv: output/modelling/final/coef_iv_sens*.csv
data_csv: output/modelling/iv/sens/data_iv_sens*.csv
summ_txt: output/modelling/iv/sens/summ_iv_sens*.txt
### IGNORE ###
# Extract outcomes
# outcomes:
# run: cohortextractor:latest generate_cohort
# --study-definition study_definition_outcomes_2
# --index-date-range "2022-09-03 to 2023-01-28 by week"
# --output-dir=feather
# --output-format=feather
# needs: [data_process_baseline]
# outputs:
# highly_sensitive:
# cohort: output/index/inpu*.feather
# Data cleaning of outcome data (control periods)
# data_process_outcomes:
# run: r:latest analysis/processing/data_process_outcomes.R
# needs: [outcomes_by_week]
# outputs:
# highly_sensitive:
# outcomes: output/cohort/outcomes*.csv
# Data cleaning of outcome data
# data_process_outcomes_2:
# run: r:latest analysis/processing/data_process_outcomes_2.R
# needs: [outcomes]
# outputs:
# highly_sensitive:
# outcomes: output/cohort/outcome*.feather
# Split into separate datasets by start date
# data_process_by_start_date:
# run: r:latest analysis/processing/data_process_by_start_date.R
# needs: [data_process_outcomes_2]
# outputs:
# moderately_sensitive:
# outcomes: output/cohort_bydate/outcomes_*.csv
# # Check latest date of outcome
# # latest_date_outcomes:
# # run: r:latest analysis/descriptive/latest_date_outcomes.R
# # needs: [data_process_outcomes_2]
# # outputs:
# # moderately_sensitive:
# # plot: output/descriptive/over*.png