-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
97 lines (88 loc) · 3.02 KB
/
Snakefile
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
rule all:
input:
# "data/processed/countries/Bermuda_microcells.csv",
# "data/processed/countries/Bermuda_pop_dist.json",
# "data/processed/countries/Gibraltar_microcells.csv",
# "data/processed/countries/Gibraltar_pop_dist.json",
"data/processed/countries/Luxembourg_microcells.csv",
"data/processed/countries/Luxembourg_pop_dist.json",
# "data/processed/countries/Netherlands_microcells.csv",
# "data/processed/countries/Netherlands_pop_dist.json",
# "data/processed/countries/New Zealand_microcells.csv",
# "data/processed/countries/New Zealand_pop_dist.json",
# "data/processed/provinces/CA-NB_microcells.csv",
# "data/processed/provinces/CA-NB_pop_dist.json",
# "data/processed/cities/Winnipeg_microcells.csv",
# "data/processed/cities/Winnipeg_pop_dist.json",
# "data/processed/cities/Dublin2_microcells.csv",
# "data/processed/cities/Dublin2_pop_dist.json",
"outputs/dag.pdf"
rule render_dag:
input:
"Snakefile"
output:
"outputs/dag.pdf"
shell:
"snakemake --dag | dot -Tpdf > outputs/dag.pdf"
rule get_country_arrays:
input:
"data/raw/GHS_POP_E2015_GLOBE_R2019A_4326_30ss_V1_0.tif",
"data/raw/ne_10m_admin_0_countries_lakes.zip"
output:
"data/processed/countries/{country}.npz"
script:
"scripts/get_country_arrays.py"
rule get_province_arrays:
input:
"data/raw/GHS_POP_E2015_GLOBE_R2019A_4326_30ss_V1_0.tif",
"data/raw/ne_10m_admin_1_states_provinces.zip"
output:
"data/processed/provinces/{province}.npz",
script:
"scripts/get_province_arrays.py"
rule get_city_arrays:
input:
"data/raw/GHS_POP_E2015_GLOBE_R2019A_4326_30ss_V1_0.tif",
"data/raw/ne_10m_urban_areas_landscan.zip"
output:
"data/processed/cities/{city}.npz",
script:
"scripts/get_city_arrays.py"
rule plot_place:
input:
"data/processed/{region}/{place}.npz"
output:
"outputs/{region}/{place}.pdf"
script:
"scripts/plot_place.py"
rule country_pops:
input:
"data/processed/{region}/{country}.npz"
output:
"data/processed/{region}/{country}_population.txt"
script:
"scripts/country_pops.py"
rule lat_long_pops:
input:
"data/processed/{region}/{place}.npz",
output:
"data/processed/{region}/{place}_cells.csv"
script:
"scripts/lat_long_pops.py"
rule make_microcells:
input:
"data/processed/{region}/{place}_cells.csv",
"configs/{region}/{place}_parameters.json",
"outputs/{region}/{place}.pdf"
output:
"data/processed/{region}/{place}_microcells.csv"
script:
"scripts/microcell_conversion.py"
rule make_pop_dist:
input:
"data/raw/WPP2022_PopulationByAge5GroupSex_Medium.csv",
"configs/{region}/{place}_parameters.json"
output:
"data/processed/{region}/{place}_pop_dist.json"
script:
"scripts/get_pop_dist.py"