generated from opensafely/research-template
/
project.yaml
88 lines (67 loc) · 2.26 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
######################################
# This script defines the project pipeline - it specifys the execution orders for all the code in this
# repo using a series of actions.
######################################
version: '3.0'
expectations:
population_size: 100000
actions:
# Extract data ----
## Cohort data
extract_data:
run: cohortextractor:latest generate_cohort --study-definition study_definition --index-date-range "2019-01-01 to 2021-04-01 by month" --output-dir=output/data --output-format=feather
outputs:
highly_sensitive:
cohort: output/data/input_*.feather
## Ethnicity
extract_ethnicity:
run: cohortextractor:latest generate_cohort --study-definition study_definition_ethnicity --output-dir=output/data --output-format=feather
outputs:
highly_sensitive:
cohort: output/data/input_ethnicity.feather
# Data processing ----
## Add ethnicity
join_ethnicity:
run: python:latest python analysis/join_ethnicity.py
needs: [extract_data, extract_ethnicity]
outputs:
highly_sensitive:
cohort: output/data/input*.feather
## Generate measures
generate_measures:
run: cohortextractor:latest generate_measures --study-definition study_definition --output-dir=output/data
needs: [join_ethnicity]
outputs:
moderately_sensitive:
measure_csv: output/data/measure_*.csv
## Process data
data_process:
run: r:latest analysis/process/process_data.R
needs: [generate_measures]
outputs:
moderately_sensitive:
data: output/data/data_*.csv
# Results ----
# ## Table 1
# table_1:
# run: r:latest analysis/descriptive/table_1.R
# needs: [data_process]
# outputs:
# moderately_sensitive:
# plots: output/tables/table1.csv
#
# ## Table 2
# table_2:
# run: r:latest analysis/descriptive/table_2.R
# needs: [data_process]
# outputs:
# moderately_sensitive:
# plots: output/tables/table2*.csv
# ## Figures
# summary_figures:
# run: r:latest analysis/descriptive/summary_plots.R
# needs: [data_process]
# outputs:
# moderately_sensitive:
# plot1: output/figures/total_*.png
# plot2: output/figures/new_*.png