-
Notifications
You must be signed in to change notification settings - Fork 2
/
pharmacodynamic.py
420 lines (355 loc) · 17.8 KB
/
pharmacodynamic.py
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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
"""Pharmacodynamic response models
Pharmacodynamic response models, including concentration-response,
inhibitor-response, and various receptor-response models that can be used for
empirical fitting of response data.
List of Functions:
* concentration_response
* dose_response
* inhibitor_response
receptor occupation:
* hill_langmuir_equation
receptor-response:
* hill_equation
* clark_equation
* operational_model
* delcastillo_katz_model
* buchwald_threeparameter_model
CNiFERs response:
* cnifers_response
"""
def concentration_response(effector_concentration, emin, emax, ec50, n):
"""Non-linear (sigmoidal) concentration-response equation.
Args:
effector_concentration (float, numpy.array): The input concentration of
an effector in concentration units.
emin (float): The minimimun/baseline response when c=0 in response units.
Bounds fot fitting: 0 <= emin <= inf
emax (float): The maximum resonse in response units.
Bounds fot fitting: 0 <= emax <= inf
ec50 (float): The concentration corresponding to a half-maximal
response in concentration units.
Bounds fot fitting: 0 <= ec50 <= inf
n (int, float): The Hill coefficient (or Hill slope).
Bounds for fitting: 0 <= n <= inf
Returns:
float, numpy.array : The response for the given concentration(s) in
response units.
"""
return emin + (emax - emin) / (1 + (ec50 / effector_concentration) ** n)
def dose_response(dose, emin, emax, ec50, n):
"""Non-linear (sigmoidal) dose-response equation.
Note that the dose-response equation is functionally identical to the
concentration-response response equation but with the (drug) concentration
replaced with a (drug) dose.
Args:
dose (float, numpy.array): The input dose in dose units.
emin (float): The minimimun/baseline response when d=0 in response units.
Bounds fot fitting: 0 <= emin <= inf
emax (float): The maximum resonse in response units.
Bounds fot fitting: 0 <= emax <= inf
ec50 (float): The dose corresponding to a half-maximal
response in dose units.
Bounds fot fitting: 0 <= ec50 <= inf
n (int, float): The Hill coefficient (or Hill slope).
Bounds for fitting: 0 <= n <= inf
Returns:
float, numpy.array : The response for the given dose(s) in
response units.
"""
return concentration_response(dose, emin, emax, ec50, n)
def inhibitor_response(inhibitor_concentration, emin, emax, ic50, n):
"""Non-linear (sigmoidal) inhibitor-response equation.
Note that the inhibitor-response equation is functionally identical to the
concentration-response response equation but with the (agonist)
concentration replaced with an inhibitor concentration and a negative Hill
coefficient.
Args:
inhibitor_concentration (float, numpy.array): The inhibitor
concentration in concentration units.
emin (float): The minimimun response value to which the respsonse
can be reduced to by the inhibitor; emin is in response units.
Bounds fot fitting: 0 <= emin <= inf
emax (float): The maximum/baseline resonse when ic=0 in response units.
Bounds fot fitting: 0 <= emax <= inf
ic50 (float): The inhibitor concentration corresponding to a
half-maximal (halway between emax and emin) response in
concentration units.
Bounds fot fitting: 0 <= ic50 <= inf
n (int, float): The Hill coefficient (or Hill slope).
Bounds for fitting: 0 <= n <= inf
Returns:
float, numpy.array : The response for the given inhibitor
concentration(s) in response units.
"""
return concentration_response(ic, emin, emax, ic50, -n)
def hill_langmuir_equation(ligand_concentration, kd):
"""Hill-Langmuir receptor occupation equation.
Args:
ligand_concentration (float, numpy.array): The input concentration of a
ligand in concentration units.
kd (float): The ligand-receptor dissociation constant (or its
effective value) in concentration units.
Bounds fot fitting: 0 <= kd <= inf
Returns:
float, numpy.array : The fractional receptor occupation for the given
ligand concentration; unitless, range [0,1].
"""
return ligand_concentration / (ligand_concentration + kd)
def hill_equation(ligand_concentration, emax, kd, n):
"""Hill receptor-response equation.
Args:
ligand_concentration (float, numpy.array): The input concentration of a
ligand in concentration units.
emax (float): The maximum response in response units.
Bounds fot fitting: 0 <= emax <= inf
kd (float): The ligand-receptor dissociation constant (or its
effective value) in concentration units.
Bounds fot fitting: 0 <= kd <= inf
n (int, float): The Hill coefficient (or Hill slope).
Bounds for fitting: 0 <= n <= inf
Returns:
float, numpy.array : The response for the given ligand concentration(s)
in response units.
"""
return emax * ligand_concentration ** n / (ligand_concentration ** n + kd ** n)
def clark_equation(ligand_concentration, emax, kd):
"""Clark equation for receptor-response.
The Clark equation corresponds to single-state receptor activation model
with a linear effect response:
L + R <--kd--> LR* ---> Effect,
such that Effect is directly proportional to the receptor occupation LR*.
Note that the Clark equation is equivalent to the Hill receptor-response
equation with n = 1.
Args:
ligand_concentration (float, numpy.array): The input concentration of a
ligand in concentration units.
emax (float): The maximum response in response units.
Bounds fot fitting: 0 <= emax <= inf
kd (float): The ligand-receptor dissociation constant in concentration
units. Bounds fot fitting: 0 <= kd <= inf
Returns:
float, numpy.array : The response for the given ligand concentration(s)
in response units.
References:
1. Clark, A.J., 1926. The reaction between acetyl choline and muscle
cells. The Journal of physiology, 61(4), pp.530-546.
https://doi.org/10.1113/jphysiol.1926.sp002314
2. Buchwald, P., 2017. A three‐parameter two‐state model of receptor
function that incorporates affinity, efficacy, and signal
amplification. Pharmacology research & perspectives, 5(3),
p.e00311. https://doi.org/10.1002/prp2.311
"""
return emax * ligand_concentration / (ligand_concentration + kd)
def operational_model(ligand_concentration, emax, kd, tau):
"""Operational (Black-Leff) model of receptor-response.
The operational model corresponds to single-state receptor activation model
with a (non-linear) hyperbolic effect response:
L + R <--kd--> LR* --tau-> Effect,
where the agonist ligand's effect is amplified to some extent, which is
accounted for by the efficacy term tau.
Note that the observed/effective dissociation constant and Emax values are:
Kobs = kd / (tau + 1)
Emax_obs = (emax * tau) / (tau + 1)
Args:
ligand_concentration (float, numpy.array): The input concentration of a
ligand in concentration units.
emax (float): The maximum response in response units.
Bounds fot fitting: 0 <= emax <= inf
kd (float): The ligand-receptor dissociation constant (or its
effective value) in concentration units.
Bounds fot fitting: 0 <= kd <= inf
tau (float): Efficacy of the agonist ligand.
Bounds for fitting: 0 <= tau <= inf
Returns:
float, numpy.array : The response for the given ligand concentration(s)
in response units.
References:
1. Black, J.W. and Leff, P., 1983. Operational models of
pharmacological agonism. Proceedings of the Royal society of London.
Series B. Biological sciences, 220(1219), pp.141-162.
https://doi.org/10.1098/rspb.1983.0093
2. Buchwald, P., 2017. A three‐parameter two‐state model of receptor
function that incorporates affinity, efficacy, and signal
amplification. Pharmacology research & perspectives, 5(3),
p.e00311. https://doi.org/10.1002/prp2.311
"""
return emax * tau * ligand_concentration / ((tau + 1) * ligand_concentration + kd)
def delcastillo_katz_model(ligand_concentration, emax, kd, tau):
"""Del Castillo-Katz model of receptor-response.
The Del Castillo-Katz model corresponds to a two-state receptor activation
model with a linear effect response:
L + R <--kd--> LR <--tau--> LR* ---> Effect,
Here tau represents the ratio of active receptor-complex to inactive
receptor-complex: tau = [LR*]/[LR]
Although the underlying receptor activation model and definition of tau
is different, the del Castillo-Katz model is functionally identical to the
Operational model and tau can still be thought of as encoding
the ligand's efficacy.
Note that the observed/effective dissociation constant and Emax values are:
Kobs = kd / (tau + 1)
Emax_obs = (emax * tau) / (tau + 1)
Args:
ligand_concentration (float, numpy.array): The input concentration of a
ligand in concentration units.
emax (float): The maximum response in response units.
Bounds fot fitting: 0 <= emax <= inf
kd (float): The ligand-receptor dissociation constant (or its
effective value) in concentration units.
Bounds fot fitting: 0 <= kd <= inf
tau (float): Efficacy of the agonist ligand.
Bounds for fitting: 0 <= tau <= inf
Returns:
float, numpy.array : The response for the given ligand concentration(s)
in response units.
References:
1. Castillo, J.D. and Katz, B., 1957. Interaction at end-plate
receptors between different choline derivatives. Proceedings of the
Royal Society of London. Series B-Biological Sciences, 146(924),
pp.369-381. https://doi.org/10.1098/rspb.1957.0018
2. Buchwald, P., 2017. A three‐parameter two‐state model of receptor
function that incorporates affinity, efficacy, and signal
amplification. Pharmacology research & perspectives, 5(3),
p.e00311. https://doi.org/10.1002/prp2.311
"""
return emax * tau * ligand_concentration / ((tau + 1) * ligand_concentration + kd)
def buchwald_threeparameter_model(ligand_concentration, emax, kd, epsilon, gamma):
"""Three-parameter two-state model of receptor-response by Buchwald.
The three-parameter two-state model of receptor-response by Buchwald
corresponds to a two-state receptor activation model that allows for
non-linear response via efficacy and amplification:
L + R <--kd--> LR <--epsilon--> LR* --gamma--> Effect,
Here epsilon encodes the efficacy of the ligand (similar to tau in the
del Castillo-Katz model) and gamma encodes amplification of
the ligand's effect. Note than when epsilon=1 and gamma=1 this model
reduces to the Clark equation.
Note that the observed/effective dissociation constant and Emax values are:
Kobs = kd / (epsilon*gamma + 1 - epsilon)
Emax_obs = (emax * epsilon * gamma) / (epsilon*gamma + 1 - epsilon)
Args:
ligand_concentration (float, numpy.array): The input concentration of an
ligand in concentration units.
emax (float): The maximum response in response units.
Bounds fot fitting: 0 <= emax <= inf
kd (float): The ligand-receptor dissociation constant (or its
effective value) in concentration units.
Bounds fot fitting: 0 <= kd <= inf
epsilon (float): Efficacy of the agonist ligand.
Bounds fot fitting: 0 <= kd <= 1
gamma (float): Amplification of agonist effect.
Bounds for fitting: 1 <= gamma <= inf
Returns:
float, numpy.array : The response for the given ligand concentration(s)
in response units.
References:
1. Buchwald, P., 2017. A three‐parameter two‐state model of receptor
function that incorporates affinity, efficacy, and signal
amplification. Pharmacology research & perspectives, 5(3),
p.e00311. https://doi.org/10.1002/prp2.311
"""
return (
emax
* epsilon
* gamma
* ligand_concentration
/ ((epsilon * gamma + 1 - epsilon) * ligand_concentration + kd)
)
def gaddum_equation(ligand_concentration, antagonist_concentration, emax, kd, ki):
"""Gaddum equation for receptor-response with a competitive antagonist.
The Gaddum equation corresponds to single-state receptor activation model
with a linear effect response:
L + R <--kd--> LR* ---> Effect,
and a competitive antagonist:
I + R <--ki--> IR ---X No effect,
Note that Effect is directly proportional to the receptor occupation
LR* as in the Clark equation. Here, the antagonist causing a right-shift
in the response function versus agonist curve.
Args:
ligand_concentration (float, numpy.array): The input concentration of an
ligand in concentration units.
antagonist_concentration (float, numpy.array): The input concentration
of the antagonist in concentration units.
emax (float): The maximum response in response units.
Bounds fot fitting: 0 <= emax <= inf
kd (float): The ligand-receptor dissociation constant in concentration
units. Bounds fot fitting: 0 <= kd <= inf
ki (float): The antagonist-receptor dissociation constant in
concentration units. Bounds fot fitting: 0 <= ki <= inf
Returns:
float, numpy.array : The response for the given ligand and antagonist
concentration(s) in response units.
References:
1. Gaddum, J.H., 1937. The quantitative effects of antagonistic drugs.
J. physiol, 89, pp.7P-9P.
2. Buchwald, P., 2017. A three‐parameter two‐state model of receptor
function that incorporates affinity, efficacy, and signal
amplification. Pharmacology research & perspectives, 5(3),
p.e00311. https://doi.org/10.1002/prp2.311
"""
return clark_equation(
ligand_concentration, emax, kd * (1 + (antagonist_concentration / ki))
)
def noncompetitive_antagonist(
ligand_concentration, antagonist_concentration, emax, kd, ki
):
"""Equation for receptor-response with a noncompetitive antagonist.
This function corresponds to Equation A5 in Buchwald.
The model is a single-state receptor activation model
with a linear effect response:
L + R <--kd--> LR* ---> Effect,
and a noncompetitive antagonist:
I + R <--ki--> IR ---X No effect,
L + IR <--ki--> LIR ---X No effect,
I + LR <--ki--> LIR ---X No effect,
Note that Effect is directly proportional to the receptor occupation
LR* as in the Clark equation. Here, the antagonist leads to a reduction
in Emax without causing a right-shift in the response-function versus
agonist curve.
Args:
ligand_concentration (float, numpy.array): The input concentration of a
ligand in concentration units.
antagonist_concentration (float, numpy.array): The input concentration
of the antagonist in concentration units.
emax (float): The maximum response in response units.
Bounds fot fitting: 0 <= emax <= inf
kd (float): The ligand-receptor dissociation constant in concentration
units. Bounds fot fitting: 0 <= kd <= inf
ki (float): The antagonist-receptor dissociation constant in
concentration units. Bounds fot fitting: 0 <= ki <= inf
Returns:
float, numpy.array : The response for the given ligand and antagonist
concentration(s) in response units.
References:
1. Buchwald, P., 2017. A three‐parameter two‐state model of receptor
function that incorporates affinity, efficacy, and signal
amplification. Pharmacology research & perspectives, 5(3),
p.e00311. https://doi.org/10.1002/prp2.311
"""
return clark_equation(ligand_concentration, emax, kd) * (
1 / (1 + (antagonist_concentration / Ki))
)
def cnifers_response(agonist_concentration, fret_ratio_max, ec50, n):
"""Hill-type response equation for CNiFERs FRET response to an agonist.
Args:
agonist_concentration (float, numpy.array): The input concentration of
an agonist in concentration units.
fret_ratio_max (float): The maximum FRET ratio of the resonse.
Bounds fot fitting: 0 <= fret_ratio_max <= inf
ec50 (float): The concentration corresponding to a half-maximal
response in concentration units.
Bounds fot fitting: 0 <= ec50 <= inf
n (int, float): The Hill coefficient (or Hill slope).
Bounds for fitting: 0 <= n <= inf
Returns:
float, numpy.array : The FRET ratio response for the given
agonist concentration(s).
References:
1. Lacin, E., Muller, A., Fernando, M., Kleinfeld, D. and Slesinger,
P.A., 2016. Construction of cell-based neurotransmitter fluorescent
engineered reporters (CNiFERs) for optical detection of
neurotransmitters in vivo. JoVE (Journal of Visualized Experiments),
(111), p.e53290. https://dx.doi.org/10.3791/53290
"""
fret_ratio = concentration_response(
agonist_concentration, emin=0.0, emax=fret_ratio_max, ec50=ec50, n=n
)
return fret_ratio