Skip to content

Instantly share code, notes, and snippets.

@VahidGh
Last active August 29, 2015 14:11
Show Gist options
  • Save VahidGh/c0f520317e50ea623cf6 to your computer and use it in GitHub Desktop.
Save VahidGh/c0f520317e50ea623cf6 to your computer and use it in GitHub Desktop.
Hodgkin-Huxley Model For L-Type Voltage-dependent Ca2+ Channel EGL-19
import scipy as sp
import pylab as plt
from scipy.integrate import odeint
from scipy import stats
import scipy.linalg as lin
## Hodgkin-Huxley Model For L-Type Voltage-dependent Ca2+ Channel EGL-19
## Jospin M. et.al V.S. Boyle and Cohen
# Constants
g_Ca1 = 220.0 # maximum conducances, in mS/cm^2
g_Ca = 199
#g_Ca = 127
a_Ca = 0.283
E_Ca1 = 49.1 # Nernst reversal potentials, in mV
E_Ca = 50.0
#E_Ca = 59.0
E_half_Ca = 0.9
#E_half_Ca = 6.4
E_half_e = -3.4
E_half_f = 25.2
Ca_half_h = 64.1e-9
k_Ca = 4.9 #mV
#k_Ca = 7.9 #mV
k_e = 6.7
k_f = -5.0 # The value in the Boyle & Cohen paper: 5 !!!
k_h = -0.01 #mM
Ca_Con = 2.39e-6
t_e = 0.1 #ms
t_f = 151
V_0 = -40
# Channel currents (in mA/cm^2)
def I_Ca_boyle(V,e,f): return g_Ca1 * e**2 * f * (1 + (h - 1) * a_Ca) * (V - E_Ca1) / 1000
def I_Ca(V): return g_Ca * (V - E_Ca) / ((1 + sp.exp((E_half_Ca - V) / k_Ca)) * 1000)
# The voltage to integrate over
V = sp.arange(V_0, 80, 1)
# Gating Kinetics
def X_inf(V, V_half_x, k_x): return 1 / (1 + sp.exp((V_half_x - V) / k_x))
e_0 = X_inf(V_0,E_half_e,k_e)
f_0 = X_inf(V_0,E_half_f,k_f)
h = X_inf(Ca_Con, Ca_half_h, k_h)
# Integrate!
def dXdt(X, V):
e , f = X
#calculate activation variables
dedt = (X_inf(V, E_half_e, k_e) - e) / t_e
dfdt = (X_inf(V, E_half_f, k_f) - f) / t_f
return dedt, dfdt
X = odeint(dXdt, [e_0, f_0], V)
e = X[:,0]
f = X[:,1]
icab = I_Ca_boyle(V,e,f)
ica = I_Ca(V)
plt.figure()
plt.plot(V, ica, 'r', label='$I_{Ca}$')
plt.plot(V, icab, 'y', label='$I_{Ca}-Boyle$')
plt.ylabel('I (A/F)')
plt.xlabel('Em (mV)')
plt.legend()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment