|
Project Information
Featured
|
NewsAs of December 2010, the Q-Matrix project has moved to DC_PyPs. pyqmatrix is obsolete and will be scheduled for deletion in the near future. IntroductionThis Python module implements the Q-Matrix approach by Colquhoun & Hawkes (1977) to solve kinetic schemes that describe the gating of voltage- or drug-operated ion channels. InstallationStandalone Python moduleA pure Python module that only depends on numpy can be obtained from the Downloads page. Move the file (qmatpy-x.y.z.py) to a place where your Python interpreter will find it and rename to qmatpy.py for convenience. C++ codeThe C++ code may run a little bit faster on some systems. You can check out the latest version from the repository. Building requires LAPACK, Blitz++, swig and the Python development libraries. Example usageThe following illustrates the example given in the Q-Matrix cookbook (Colqhoun & Hawkes, 1995b). First, the rates need to be initialized at a given agonist concentration. import numpy as np
import qmatpy as qm
def init_Q(c_agonist):
beta_1 = 15.0
beta_2 = 15000.0
alpha_1 = 3000.0
alpha_2 = 500.0
k_m1 = 2000.0
k_m2 = 2000.0
k_p1 = 5.0e07 * c_agonist
k_star_p2 = 5.0e08 * c_agonist
k_p2 = 5.0e08 * c_agonist
k_star_m2 = 1.0/3.0Then, the Q-Matrix is expressed as a 2D numpy array: Q = np.array([[ 0, k_star_p2, 0, alpha_1, 0],
[ 2.0*k_star_m2, 0, alpha_2, 0, 0],
[ 0, beta_2, 0, 2.0*k_m2, 0],
[ beta_1, 0, k_p2, 0, k_m1],
[ 0, 0, 0, 2.0*k_p1, 0]])Update the diagonal elements of Q and return the initialized matrix: qm.init_matrix(Q)
return QInitialize matrix for 100 nM agonist concentration: Q_100 = init_Q(100e-9) Calculate the steady-state probabilities for the given agonist concentration: p_inf_100 = qm.p_inf(Q_100) Calculate rates (lambda) and amplitude terms (A) for Q: lambda_100, A_100 = qm.mat_solve(Q_100) print(lambda_100) # compare with solution in Colquhoun & Hawkes, 1995b This could now be used to calculate the time course of state probabilities for an arbitrary concentration step (e.g. from 10 to 100 nM): Q_10 = init_Q(10e-9) p_inf_10 = qm.p_inf(Q_10) t = np.arange(0,1000.0,0.01) p_t = qm.p(t, p_inf_10, p_inf_100, lambda_100, A_100) ReferencesColquhoun D, Hawkes AG (1977) Relaxation and fluctuations of membrane currents that flow through drug-operated channels. Proc R Soc Lond B Biol Sci 199:231-62. Colquhoun D, Hawkes AG (1995a) The principles of the stochastic interpretation of ion channel mechanisms. In: Single-channel recording. 2nd ed. (Eds: Sakmann B, Neher E) Plenum Press, New York, pp. 397-482. Colquhoun D, Hawkes AG (1995b) A Q-Matrix Cookbook. In: Single-channel recording. 2nd ed. (Eds: Sakmann B, Neher E) Plenum Press, New York, pp. 589-633. |