Functions for simulation of quantitative microdialysis (qµD) experiments, as described in :
Shave, S., Pham, N.T., Śmieja, C.B. and Auer, M., 2020. Quantitative Microdialysis: Experimental Protocol and Software for Small Molecule Protein Affinity Determination and for Exclusion of Compounds with Poor Physicochemical Properties. Methods and Protocols, 3(3), p.55. https://doi.org/10.3390/mps3030055
The main simulation code is contained within microdialysis_equations.py and requires nothing but Numpy and Python. It is not intended to be a Python module, but rather, useable within different projects without installation. The demonstration programs require:
- Python >= 3.7
- Numpy >= 1.18.5
- matplotlib >= 3.2.1
- uncertainties >= 3.1.4
- autograd >= 1.3
Whilst microdialysis_equations.py contains code to integrate simulations into custom processes, the following demonstration programs are available, and also produce the plots used in the submitted publication.
This program allows single point simulation of qµD experiments. Looking through the code should allow the reader to familiarise themselves with the available qµD functions.
Program to simulate compound concentration in the red and white chambers as a function of KD. Produces figure 1 as shown in paper. 02_plot_KDvsConcentrationsAnimation.py produces an animated version of the plot with varying KD.
Example programs enabling the determination of KDs from experimental observations.
Example programs enabling the determination of KDs from multiple experimental observations. Standard deviations are managed by the Python Uncertaincies library.
Program to simulate pt as a function of KD. Produces figure 2 as shown in paper.
Derivatives of system KD determination with respect to lred, lwhite and pt. Used to produce table 1 in the manuscript and determine lred should be used for KD determination. However, practically, this will contain protein as well as compound, meaning that extra steps must be taken in the determination of compound concentration. We therefore recommend as standard, that KD determination proceeds using lwhite.
Produce a plot illustrating the effect of a 5% measurement error in KD determination for lred, lwhite and pt. Produces figure 3 as shown in paper.
Contains functions for simulation of qµD system behaviour.
def qud_lred(t0: float, l0: float, kdtl: float, redvol: float, whitevol: float, pc: float):
"""Calculate the compound concentration in the red chamber in a partially equlibrated system
Args:
t0 (float): Target concentration (in the red chamber)
l0 (float): Ligand concentration, over the entire volume of red and white chambers when fully equilibrated.
kdtl (float): Kd of target-ligand interaction
redvol (float): Volume of the red chamber
whitevol (float): Volume of the white chamber
pc (float): Pc - Ligand partition coefficient in the absence of protein (control)
Returns:
float: Ligand concentration in the red chamber
def qud_lwhite(t0: float, l0: float, kdtl: float, redvol: float, whitevol: float, pc: float):
"""Calculate the compound concentration in the white chamber in a partially equlibrated system
Args:
t0 (float): Target concentration (in the red chamber)
l0 (float): Ligand concentration, over the entire volume of red and white chambers when fully equilibrated.
kdtl (float): Kd of target-ligand interaction
redvol (float): Volume of the red chamber
whitevol (float): Volume of the white chamber
pc (float): Pc - Ligand partition coefficient in the absence of protein (control)
Returns:
float: Ligand concentration in the white chamber
"""
def qud_pt(t0: float, l0: float, kdtl: float, redvol: float, whitevol: float, pc: float):
"""Calculate the pt value in a partially equlibrated system
Args:
t0 (float): Target concentration (in the red chamber)
l0 (float): Ligand concentration, over the entire volume of red and white chambers when fully equilibrated.
kdtl (float): Kd of target-ligand interaction
redvol (float): Volume of the red chamber
whitevol (float): Volume of the white chamber
pc (float): Pc - Ligand partition coefficient in the absence of protein (control)
Returns:
float: pt value
"""
return (kdtl*pc*redvol - l0*pc*redvol + pc*redvol*t0 - kdtl*whitevol - l0*pc*whitevol + sqrt((-(kdtl*pc*redvol) + l0*pc*redvol - pc*redvol*t0 + kdtl*whitevol + l0*pc*whitevol)**2 - 4*kdtl*redvol*(-(l0*pc**2*redvol) - kdtl*pc*whitevol - l0*pc**2*whitevol - pc*t0*whitevol)))/(2.*kdtl*redvol)
def qud_Kd_from_pt(pt: float, t0: float, l0: float, redvol: float, whitevol: float, pc: float):
"""Calculate the protein-ligand interaction Kd from Pt in a partially equilibrated system
Args:
pt (float): Pt value (lred/lwhite)
t0 (float): Target concentration (in the red chamber)
l0 (float): Ligand concentration, over the entire volume of red and white chambers when fully equilibrated.
redvol (float): Volume of the red chamber
whitevol (float): Volume of the white chamber
pt (float): Pt - Ligand partition coefficient in the presence of protein
pc (float): Pc - Ligand partition coefficient in the absence of protein (control)
Returns:
float: Kd of the target-ligand interaction
"""
def qud_Kd_from_lred(lred: float, t0: float, l0: float, redvol: float, whitevol: float, pc: float):
"""Calculate the protein-ligand interaction Kd from ligand in red chamber in a partially equilibrated system
Args:
lred (float): Ligand concentration in the red chamber
t0 (float): Target concentration (in the red chamber)
l0 (float): Ligand concentration, over the entire volume of red and white chambers when fully equilibrated.
redvol (float): Volume of the red chamber
whitevol (float): Volume of the white chamber
pc (float): Pc - Ligand partition coefficient in the absence of protein (control)
Returns:
float: Kd of the target-ligand interaction
"""
def qud_Kd_from_lwhite(lwhite: float, t0: float, l0: float, redvol: float, whitevol: float, pc: float):
"""Calculate the protein-ligand interaction Kd from ligand in white chamber in a partially equilibrated system
Args:
lwhite (float): Ligand concentration in the white chamber
t0 (float): Target concentration (in the red chamber)
l0 (float): Ligand concentration, over the entire volume of red and white chambers when fully equilibrated.
redvol (float): Volume of the red chamber
whitevol (float): Volume of the white chamber
pc (float): Pc - Ligand partition coefficient in the absence of protein (control)
Returns:
float: Kd of the target-ligand interaction
"""
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.