-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVACC
221 lines (186 loc) · 9.76 KB
/
VACC
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
# Main workflow of VASIL: Immunological landscape from Vaccinations
import os
report: "report/workflow.rst"
rule_all_common = ["vaccination/Timeline/Vaccination_Timeline.csv"]
rule_all_common.append("vaccination/Timeline/Vaccination_Total.csv"),
rule_all_common.append("vaccination/Cross_Vacc/cross_status.csv"),
if not os.path.exists("results/Cross_with_delta_valitation.pck"):
rule_all_common.append("results/Cross_with_delta_valitation.pck")
rule_all_common.append("vaccination/ImL_ALL_vs_Vacc_ver2/simulation_status_ALL.csv")
if config["all_il"]:
rule_all_common.append(
"vaccination/Immunological_Landscape_ALL/simulation_status_ALL.csv"
),
if not os.path.exists("results/Cross_with_delta_valitation.pck"):
rule_all_common.append("results/Cross_with_delta_valitation.pck")
rule_all_common.append(
"vaccination/Susceptible_weighted_mean_over_spikegroups_all_PK.csv"
),
rule_all_common.append("vaccination/plots/ALL_vs_Vacc_ver2/Susceptible_Trends_ALL_vs_Vacc.pdf"),
rule all:
input:
rule_all_common,
if not os.path.exists("results/Cross_with_delta_valitation.pck"):
rule compute_cross_delta:
input:
spikes_dic="results/SpikeGroups.pck",
mutations_dic="results/Mutation_Profiles.pck",
dms_data_regrouped="results/epitope_data/dms_per_ab_per_site.csv",
params:
lineage_focus="only_delta",
mutation_focus="None",
cross_spk="None",
output:
cross_delta="results/Cross_with_delta_valitation.pck",
shell:
"python {workflow.basedir}/scripts/Cross_neutralization/Compute_FR.py {input.spikes_dic} {input.mutations_dic} {input.dms_data_regrouped} {params.lineage_focus} {params.mutation_focus} {output.cross_delta} {params.cross_spk}"
rule get_vacc_infos:
input:
vacc_data=config["vacc_data"],
params:
date_start=config["date_start_vacc"],
date_end=config["date_end_vacc"],
date_switch=config["date_switch_vacc"],
vacc_considered=config["vacc_considered"]
output:
dir=directory("vaccination/Timeline"),
res1="vaccination/Timeline/Vaccination_Timeline.csv",
res2="vaccination/Timeline/Vaccination_Total.csv",
shell:
"python {workflow.basedir}/scripts/Vaccination/Process_Vaccination_Timeline.py {input.vacc_data} {params.date_start} {params.date_end} {params.date_switch} {params.vacc_considered} {output.dir}"
rule get_cross_vaccs:
input:
spikes_dic="results/SpikeGroups.pck",
mutations_dic="results/Mutation_Profiles.pck",
dms_data_regrouped="results/epitope_data/dms_per_ab_per_site.csv",
lineage_focus="vaccination/Timeline/Vaccination_Timeline.csv",
params:
mutation_focus=["avail"],
len_groups=1,
cross_delta="None",
output:
cross_spkdir=directory("vaccination/Cross_Vacc"),
res="vaccination/Cross_Vacc/cross_status.csv",
shell:
"python {workflow.basedir}/scripts/Cross_neutralization/Compute_FR.py {input.spikes_dic} {input.mutations_dic} {input.dms_data_regrouped} {params.len_groups} {input.lineage_focus} {params.mutation_focus} {params.cross_delta} {output.cross_spkdir}"
rule get_il_all_vs_vacc_ver2:
input:
cases=config["cases"],
cross_delta="results/Cross_with_delta_valitation.pck",
cross_spk="results/Cross_react_dic_spikegroups_ALL.pck",
spikes_dic="results/SpikeGroups.pck",
spikes_freqs="results/Daily_SpikeGroups_Freq.csv",
dms_data_regrouped="results/epitope_data/dms_per_ab_per_site.csv",
VE_delta=config["VE_delta"],
params:
total_pop=config["total_population"],
date_start=config["date_start"],
date_end=config["date_end"],
lineage_focus="ALL_vs_Vacc_ver2",
save_neut=False,
antigen="none",
num_antigen=1,
cases_column=config["cases_column"],
output:
resultdir=directory("vaccination/ImL_ALL_vs_Vacc_ver2"),
results_done="vaccination/ImL_ALL_vs_Vacc_ver2/simulation_status_ALL.csv",
shell:
"python {workflow.basedir}/scripts/Expected_immunized/Expected_immunized.py {input.cases} {input.cross_delta} {input.cross_spk} {input.spikes_dic} {input.spikes_freqs} {input.dms_data_regrouped} {input.VE_delta} {params.total_pop} {params.date_start} {params.date_end} {output.resultdir} {params.save_neut} {params.lineage_focus} {params.num_antigen} {params.antigen} {params.cases_column}"
if config["all_il"]:
if not config["cross_missing"]:
rule get_Immunological_Landscape_all:
input:
cases=config["cases"],
cross_delta="results/Cross_with_delta_valitation.pck",
cross_spk="results/Cross_react_dic_spikegroups_ALL.pck",
spikes_dic="results/SpikeGroups.pck",
spikes_freqs="results/Daily_SpikeGroups_Freq.csv",
dms_data_regrouped="results/epitope_data/dms_per_ab_per_site.csv",
VE_delta=config["VE_delta"],
params:
total_pop=config["total_population"],
date_start=config["date_start"],
date_end=config["date_end"],
lineage_focus="ALL",
save_neut=False,
antigen="none",
num_antigen=1,
cases_column=config["cases_column"],
output:
resultdir=directory("vaccination/Immunological_Landscape_ALL"),
results_done="vaccination/Immunological_Landscape_ALL/simulation_status_ALL.csv",
shell:
"python {workflow.basedir}/scripts/Expected_immunized/Expected_immunized.py {input.cases} {input.cross_delta} {input.cross_spk} {input.spikes_dic} {input.spikes_freqs} {input.dms_data_regrouped} {input.VE_delta} {params.total_pop} {params.date_start} {params.date_end} {output.resultdir} {params.save_neut} {params.lineage_focus} {params.num_antigen} {params.antigen} {params.cases_column}"
else:
rule get_Immunological_Landscape_all:
input:
cases=config["cases"],
cross_delta="results/Cross_with_delta_valitation.pck",
cross_spk="results/Cross_react_dic_spikegroups_present.pck",
spikes_dic="results/SpikeGroups.pck",
spikes_freqs="results/Daily_SpikeGroups_Freq.csv",
dms_data_regrouped="results/epitope_data/dms_per_ab_per_site.csv",
VE_delta=config["VE_delta"],
params:
total_pop=config["total_population"],
date_start=config["date_start"],
date_end=config["date_end"],
lineage_focus="ALL",
save_neut=False,
antigen="none",
num_antigen=1,
cases_column=config["cases_column"],
output:
resultdir=directory("vaccination/Immunological_Landscape_ALL"),
results_done="vaccination/Immunological_Landscape_ALL/simulation_status_ALL.csv",
shell:
"python {workflow.basedir}/scripts/Expected_immunized/Expected_immunized.py {input.cases} {input.cross_delta} {input.cross_spk} {input.spikes_dic} {input.spikes_freqs} {input.dms_data_regrouped} {input.VE_delta} {params.total_pop} {params.date_start} {params.date_end} {output.resultdir} {params.save_neut} {params.lineage_focus} {params.num_antigen} {params.antigen} {params.cases_column}"
try:
os.remove("vaccination/Susceptible_weighted_mean_over_spikegroups_all_PK.csv")
except:
pass
rule get_susceptible_weighted_mean:
input:
spikes_dic="results/SpikeGroups.pck",
spikes_freqs="results/Daily_SpikeGroups_Freq.csv",
params:
threshold=config["weight_prop"],
total_pop=config["total_population"],
res_dir="vaccination",
output:
mean_trend="vaccination/Susceptible_weighted_mean_over_spikegroups_all_PK.csv",
shell:
"python {workflow.basedir}/scripts/plotting/Susceptible_weighted_mean.py {input.spikes_dic} {input.spikes_freqs} {params.threshold} {params.total_pop} {params.res_dir}"
try:
os.remove("vaccination/Susceptible_weighted_mean_over_spikegroups_vs_Vacc_ver2_all_PK.csv")
except:
pass
rule get_susceptible_weighted_mean_vs_vacc_ver2:
input:
spikes_dic="results/SpikeGroups.pck",
spikes_freqs="results/Daily_SpikeGroups_Freq.csv",
params:
threshold=config["weight_prop"],
total_pop=config["total_population"],
res_dir="vaccination_special_ver2",
output:
mean_trend="vaccination/Susceptible_weighted_mean_over_spikegroups_vs_Vacc_ver2_all_PK.csv",
shell:
"python {workflow.basedir}/scripts/plotting/Susceptible_weighted_mean.py {input.spikes_dic} {input.spikes_freqs} {params.threshold} {params.total_pop} {params.res_dir}"
rule compare_trends_ver2:
input:
mean_trends_1="vaccination/Susceptible_weighted_mean_over_spikegroups_all_PK.csv",
mean_trends_2="vaccination/Susceptible_weighted_mean_over_spikegroups_vs_Vacc_ver2_all_PK.csv",
vacc_infos="vaccination/Timeline/Vaccination_Timeline.csv",
spikes_dic="results/SpikeGroups.pck",
params:
S_vacc_dir1="obsolete",
S_vacc_dir2="obsolete",
total_pop=config["total_population"],
date_start=config["date_start_plots"],
date_end=config["date_end_plots"],
output:
dir=directory("vaccination/plots/ALL_vs_Vacc_ver2"),
res="vaccination/plots/ALL_vs_Vacc_ver2/Susceptible_Trends_ALL_vs_Vacc.pdf",
shell:
"python {workflow.basedir}/scripts/vaccination/compare_vacc_to_infections.py {input.mean_trends_1} {input.mean_trends_2} {input.vacc_infos} {params.S_vacc_dir1} {params.S_vacc_dir2} {input.spikes_dic} {params.total_pop} {params.date_start} {params.date_end} {output.dir}"