import bindcurve as bc
import numpy as np
import matplotlib.pyplot as plt
Plotting system components
In this tutorial, we will use the exact Kd models to plot concentrations of all components of the system.
Direct binding
In direct binding, it is assumed that a receptor is titrated to a constant concentration of labeled ligand. In other words, RT
is titrated while LsT
does not change. Thus, we can treat RT
as the independent variable, LsT
as a constant, and all other components of the system (R
, RLs
, Ls
) as dependent variables. Here, we will use the dir_specific
model to plot the situation. You can play around with the values of LsT
and Kds
to see how the predicted equilibrium in the system changes.
# Define minimum and maximum
= 0
ymin = 1
ymax
# Define experimental constants
= 10 # Total concentration of labeled ligand
LsT = 1 # Kd of labeled ligand
Kds
# Get a range of values for the titrated component
= np.logspace(np.log10(0.001), np.log10(10000), 1000)
RT
# Call the model and get concentrations of the system components
= bc.dir_specific(RT, ymin, ymax, LsT, Kds)
model, R, RLs, Ls
# Plot LsT as horizontal line (it is constant during experiment)
= LsT, linestyle="--", color="black", label="LsT (total conc. of labeled ligand)")
plt.axhline(y
# Plot concentrations of the system components
="R (free receptor)")
plt.plot(RT, R, label="RLs (complex)")
plt.plot(RT, RLs, label="Ls (free labeled ligand)")
plt.plot(RT, Ls, label
# Set up and show the plot
"dir_specific")
plt.title("RT (total conc. of receptor)")
plt.xlabel("Component concentration")
plt.ylabel("log")
plt.xscale("log")
plt.yscale(
plt.legend() plt.show()
Competitive binding
In competitive binding, it is assumed that the unlabeled ligand is titrated to a constant concentration of receptor and labeled ligand. In other words, LT
is titrated while RT
and LsT
do not change. Thus, we can treat LT
as the independent variable, RT
and LsT
as constants, and all other components of the system (R
, RLs
, RL
, Ls
, L
) as dependent variables. Here, we will use the comp_3st_specific
model to plot the situation. You can play around with the values of RT
, LsT
, Kds
and Kd
to see how the predicted equilibrium in the system changes.
# Define minimum and maximum
= 0
ymin = 1
ymax
# Define experimental constants
= 5 # Total concentration of receptor
RT = 10 # Total concentration of labeled ligand
LsT = 1 # Kd of labeled ligand
Kds = 1 # Kd of unlabeled ligand
Kd
# Get a range of values for the titrated component
= np.logspace(np.log10(0.001), np.log10(10000), 1000)
LT
# Call the model and get concentrations of the system components
= bc.comp_3st_specific(LT, ymin, ymax, RT, LsT, Kds, Kd)
model, R, RLs, RL, Ls, L
# Plot LsT as horizontal line (it is constant during experiment)
= RT, linestyle="--", color="grey", label="RT (total conc. of receptor")
plt.axhline(y = LsT, linestyle="--", color="black", label="LsT (total conc. of labeled ligand)")
plt.axhline(y
# Plot concentrations of the system components
="R (free receptor)")
plt.plot(LT, R, label="RLs (complex of labeled ligand)")
plt.plot(LT, RLs, label="RL (complex of unlabeled ligand)")
plt.plot(LT, RL, label="Ls (free labeled ligand)")
plt.plot(LT, Ls, label="L (free unlabeled ligand)")
plt.plot(LT, L, label
# Set up and show the plot
"comp_3st_specific")
plt.title("LT (total conc. of unlabeled ligand)")
plt.xlabel("Component concentration")
plt.ylabel("log")
plt.xscale("log")
plt.yscale(= 8)
plt.legend(fontsize plt.show()