-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathantibody_escape_config.yml
327 lines (302 loc) · 13.5 KB
/
antibody_escape_config.yml
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
# Configurations for determining effects of mutations on assays such as antibody
# escape, receptor affinity from soluble receptor neutralization, etc.
# Note that in the configuration for individual selections, "antibody" is used
# as a synonym for any treatment (receptor, heat, etc), and "no-antibody" is
# used as a synonym for the untreated conditions.
# --------------------------------------------------------------------------------------
# Define the selections
# --------------------------------------------------------------------------------------
# `assays` is keyed by assay (eg, "antibody_escape", "receptor_affinity", etc). Values are:
# - `title`: title used for selection in docs
# - `selections`: name of key used to define all selections for this assay
# - `averages`: name of key used to define averages across selections for this assay.
# Leave out this key if not taking averages.
# - `prob_escape_scale`: the scale used for the y-axis when plotting prob escape as
# a function of concentration. Typically symlog if all values close to zero, linear
# otherwise. Should be in the form of keyword arguments to `altair.Scale`.
# - `concentration_scale`: the scale used for the x-axis when plotting prob escape
# as a function of concentration. Is optional. Should be in the form of keyword
# arguments to `altair.Scale`.
# - `concentration_title`: the title used for the x-axis when plotting prob escape
# as a function of concentration. Is optional.
# - `scale_stat`: scale the statistic being estimated for mutation effects by this
# number. Typically is 1 (no scaling) unless you want negative values to indicate a
# favorable effect (as for soluble receptor selections), in which case use -1.
# - `stat_name`: name assigned to statistic, eg, "escape" or "receptor affinity".
assays:
antibody_escape:
title: Antibody/serum escape
selections: antibody_selections
averages: avg_antibody_escape
prob_escape_scale:
type: symlog
constant: 0.04
scale_stat: 1
stat_name: escape
receptor_affinity:
title: Receptor affinity
selections: receptor_selections
averages: avg_receptor_affinity
prob_escape_scale:
type: linear
concentration_scale:
type: linear
concentration_title: concentration of receptor
scale_stat: -1
stat_name: receptor affinity
# --------------------------------------------------------------------------------------
# Configuration for the selection experiments for each assay.
# --------------------------------------------------------------------------------------
# `<assay>_selections` is keyed by name of each selection experiment, which includes a
# no-antibody control samples and one or more antibody samples. These should typically
# be from the same library and run on same date. Selection experiments are recommended
# to be named as <Library>-<date as YYMMDD>-<description (eg, antibody)>-<replicate>.
# Each selection experiment should in turn provide the following keys:
# - `neut_standard_name`: name of neutralization standard in `neut_standard_barcodes`
# - `no_antibody_sample`: name of the no-antibody sample
# - `antibody_samples`: a dict keyed by sample name with values of:
# * `concentration`: the concentration of the antibody
# * `use_in_fit`: whether to use this sample in the `polyclonal` fit
# - `prob_escape_filters`: dict giving filters of prob_escape values to use for fitting
# - `polyclonal_params`: dict giving parameters for `polyclonal` model fitting.
# - `escape_plot_kwargs`: dict giving parameters for `polyclonal` escape plot
# - `plot_hide_stats`: dict giving data frames with stats for slider to hide mutations
# The `use_in_fit` option exists because you may decide that some samples are outside
# the preferred neutralization range to include in the fit, so if `use_in_fit: false`
# then functional scores are computed and plotted but it is not included in the fit.
# default prob_escape filters
prob_escape_filters_default: &prob_escape_filters_default
# error if sample used in fit doesn't have >= this many neut standard counts and
# >= this fraction of all counts from neut standard.
min_neut_standard_count: 1000
min_neut_standard_frac: 0.001
# Only retain for fitting variants with at least this many counts and this fraction
# of total counts in the no-antibody sample **OR** the indicated counts and fraction
# of total counts in the antibody sample.
min_no_antibody_count: 5 # make bigger for real experiments, say 20
min_no_antibody_frac: 0.00005 # make smaller for large libraries, say ~0.1 / (library size)
min_antibody_count: 10 # make bigger for real experiments, say 100
min_antibody_frac: 0.005 # make smaller for large libraries, say ~10 / (library size)
# For averaging and plotting the mean probability (fraction) escape across variants, use
# these cutoffs:
max_aa_subs: 3 # group variants with >= this many substitutions
clip_uncensored_prob_escape: 5 # clip uncensored prob escape values at this max
# default parameters for `polyclonal` model fitting
polyclonal_params_default: &polyclonal_params_default
n_epitopes: 1 # fit this many epitopes, also fit all numbers less than this and plot
spatial_distances: null # CSV with residue distances for spatial regularization, or null
fit_kwargs: # keyword arguments to `Polyclonal.fit`
reg_escape_weight: 0.1
reg_spread_weight: 0.25
reg_activity_weight: 1.0
logfreq: 200
# keyword arguments to `Polyclonal.mut_escape_plot`
escape_plot_kwargs_default: &escape_plot_kwargs_default
addtl_slider_stats:
times_seen: 3
heatmap_max_at_least: 2
heatmap_min_at_least: -2
init_floor_at_zero: false
init_site_statistic: sum
site_zoom_bar_color_col: region # supplied in `site_numbering_map`
# Specify any statistics (usually functional effects) for which you want to enable
# sliders that hide data. Keyed by statistic name, then next dict gives:
# - `csv`: CSV file with the data, should have columns "site" and "mutant"
# - `csv_col`: column in the CSV with the data
# - `init`: initial value of slider
# - `min_filters` (optional): dict keyed by other columns and only keep if value is >= this
plot_hide_stats_default: &plot_hide_stats_default
functional effect:
csv: results/func_effects/averages/293T_ACE2_entry_func_effects.csv
csv_col: effect
init: -3
min_filters:
times_seen: 3
# define the antibody selections
antibody_selections:
LibA-220210-REGN10933-1:
neut_standard_name: neut_standard
prob_escape_filters: *prob_escape_filters_default
polyclonal_params: *polyclonal_params_default
escape_plot_kwargs: *escape_plot_kwargs_default
plot_hide_stats: *plot_hide_stats_default
no_antibody_sample: LibA-220210-no_antibody-1
antibody_samples:
LibA-220210-REGN10933-0.15-1:
concentration: 0.15
use_in_fit: true
LibA-220210-REGN10933-1.39-1:
concentration: 1.39
use_in_fit: true
LibA-220210-REGN10933-5.58-1:
concentration: 5.58
use_in_fit: true
LibA-220210-REGN10933-2:
neut_standard_name: neut_standard
prob_escape_filters: *prob_escape_filters_default
polyclonal_params: *polyclonal_params_default
escape_plot_kwargs: *escape_plot_kwargs_default
plot_hide_stats: *plot_hide_stats_default
no_antibody_sample: LibA-220210-no_antibody-2
antibody_samples:
LibA-220210-REGN10933-0.15-2:
concentration: 0.15
use_in_fit: false
LibA-220210-REGN10933-1.39-2:
concentration: 1.39
use_in_fit: true
LibA-220210-REGN10933-5.58-2:
concentration: 5.58
use_in_fit: true
LibB-220302-REGN10933-1:
neut_standard_name: neut_standard
prob_escape_filters: *prob_escape_filters_default
polyclonal_params: *polyclonal_params_default
escape_plot_kwargs: *escape_plot_kwargs_default
plot_hide_stats: *plot_hide_stats_default
no_antibody_sample: LibB-220302-no_antibody-1
antibody_samples:
LibB-220302-REGN10933-0.15-1:
concentration: 0.15
use_in_fit: true
LibB-220302-REGN10933-1.39-1:
concentration: 1.39
use_in_fit: true
LibB-220302-REGN10933-5.58-1:
concentration: 5.58
use_in_fit: true
LibA-220302-S2M11-1:
neut_standard_name: neut_standard
prob_escape_filters: *prob_escape_filters_default
polyclonal_params: *polyclonal_params_default
escape_plot_kwargs: *escape_plot_kwargs_default
plot_hide_stats: *plot_hide_stats_default
no_antibody_sample: LibA-220302-no_antibody-1
antibody_samples:
LibA-220302-S2M11-0.3082-1:
concentration: 0.3082
use_in_fit: true
LibA-220302-S2M11-1.2328-1:
concentration: 1.2328
use_in_fit: true
LibA-220302-S2M11-4.9314-1:
concentration: 4.9314
use_in_fit: true
LibA-220302-S2M11-2:
neut_standard_name: neut_standard
prob_escape_filters: *prob_escape_filters_default
polyclonal_params: *polyclonal_params_default
escape_plot_kwargs: *escape_plot_kwargs_default
plot_hide_stats: *plot_hide_stats_default
no_antibody_sample: LibA-220302-no_antibody-2
antibody_samples:
LibA-220302-S2M11-0.3082-2:
concentration: 0.3082
use_in_fit: true
LibA-220302-S2M11-1.2328-2:
concentration: 1.2328
use_in_fit: true
LibA-220302-S2M11-4.9314-2:
concentration: 4.9314
use_in_fit: true
# define the soluble receptor selections
receptor_selections:
LibA-220302-pretending_S2M11_is_receptor-1:
neut_standard_name: neut_standard
prob_escape_filters: *prob_escape_filters_default
polyclonal_params: *polyclonal_params_default
escape_plot_kwargs: *escape_plot_kwargs_default
plot_hide_stats: *plot_hide_stats_default
no_antibody_sample: LibA-220302-no_antibody-1
antibody_samples:
LibA-220302-S2M11-0.3082-1:
concentration: 0.3082
use_in_fit: true
LibA-220302-S2M11-1.2328-1:
concentration: 1.2328
use_in_fit: false
LibA-220302-S2M11-4.9314-1:
concentration: 4.9314
use_in_fit: true
LibA-220302-pretending_S2M11_is_receptor-2:
neut_standard_name: neut_standard
prob_escape_filters: *prob_escape_filters_default
polyclonal_params: *polyclonal_params_default
escape_plot_kwargs: *escape_plot_kwargs_default
plot_hide_stats: *plot_hide_stats_default
no_antibody_sample: LibA-220302-no_antibody-2
antibody_samples:
LibA-220302-S2M11-0.3082-2:
concentration: 0.3082
use_in_fit: true
LibA-220302-S2M11-1.2328-2:
concentration: 1.2328
use_in_fit: false
LibA-220302-S2M11-4.9314-2:
concentration: 4.9314
use_in_fit: true
# --------------------------------------------------------------------------------------
# Configuration for averaging/plotting selections for an assay
# --------------------------------------------------------------------------------------
# Average/plot escape values from different selections for an assay using `<assay>_escape`.
# Each key is the name of the average being taken with the following values:
# - `selections`: list of selections for which we average mutation functional effects
# or if you only want to average some sites for a given selection then
# a dict keyed by the selection name and with the value being the sites
# to include from this selection. Sites should be specified as *sequential*
# sites as a list of site numbers or lists of inclusive ranges (so
# [1, [3, 5]] means [1, 3, 4, 5])
# - `icXX`: for the plot showing fold-change in ICXX (eg, IC90), what is XX (eg, 90)
# - `escape_plot_kwargs`: keyword arguments for `PolyclonalAverage.mut_escape_plot`
# - `plot_hide_stats`: dict giving data frames with stats for slider to hide mutations
avg_escape_plot_kwargs_default: &avg_escape_plot_kwargs_default
<<: *escape_plot_kwargs_default
addtl_slider_stats:
times_seen: 3
escape_std: 2
nt changes to codon: 3
addtl_slider_stats_as_max: [escape_std, nt changes to codon]
addtl_slider_stats_hide_not_filter: [nt changes to codon]
slider_binding_range_kwargs:
nt changes to codon:
min: 1
max: 3
step: 1
avg_type: median
per_model_tooltip: true
# Define defaults for each antibody/serum, used via the merge (<<) operator
avg_antibody_escape_default: &avg_antibody_escape_default
icXX: 90 # IC90
show_icXX_in_docs: false # Do we link ICXX plots/CSVs in docs? Missing equates to false.
escape_plot_kwargs:
<<: *avg_escape_plot_kwargs_default
plot_hide_stats: *plot_hide_stats_default
# Define the antibodies/sera escapes to average
avg_antibody_escape:
REGN10933:
<<: *avg_antibody_escape_default
selections:
- LibA-220210-REGN10933-1
- LibA-220210-REGN10933-2
- LibB-220302-REGN10933-1
S2M11:
<<: *avg_antibody_escape_default
selections:
- LibA-220302-S2M11-1
- LibA-220302-S2M11-2
REGN10933_by_region:
<<: *avg_antibody_escape_default
selections:
LibA-220210-REGN10933-1: [[1, 539]]
LibA-220210-REGN10933-2: [[1, 539]]
LibB-220302-REGN10933-1: [540, 541, [542, 1251]] # specified like this rather than [540, 1251] just for testing
# Define the receptor affinity experiments to average
avg_receptor_affinity_default: &avg_receptor_affinity_default
<<: *avg_antibody_escape_default
icXX: 50 # IC50
avg_receptor_affinity:
pretending_S2M11_is_receptor:
<<: *avg_receptor_affinity_default
selections:
- LibA-220302-pretending_S2M11_is_receptor-1
- LibA-220302-pretending_S2M11_is_receptor-2