Skip to content

Commit

Permalink
Clean-up all mechanisms
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstenhater committed Dec 10, 2024
1 parent 28b3214 commit 2199a9d
Show file tree
Hide file tree
Showing 13 changed files with 188 additions and 229 deletions.
24 changes: 11 additions & 13 deletions mechanisms/allen/CaDynamics.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,26 @@ NEURON {
}

UNITS {
(mV) = (millivolt)
(mA) = (milliamp)
(molar) = (1/liter)
(mM) = (millimolar)
(um) = (micron)
(mV) = (millivolt)
(mA) = (milliamp)
(molar) = (1/liter)
(mM) = (millimolar)
(um) = (micron)
}

PARAMETER {
F = 96485.3321233100184 (coulomb/mole) : Faraday's constant
gamma = 0.05 () : percent of free calcium (not buffered)
decay = 80 (ms) : rate of removal of calcium
depth = 0.1 (um) : depth of shell
minCai = 1e-4 (mM)
F = 96485.3321233100184 (coulomb/mole) : Faraday's constant
gamma = 0.05 () : percent of free calcium (not buffered)
decay = 80 (ms) : rate of removal of calcium
depth = 0.1 (um) : depth of shell
minCai = 1e-4 (mM)
}

INITIAL {
cai = minCai
}

STATE {
cai (mM)
}
STATE { cai (mM) }

BREAKPOINT {
SOLVE states METHOD cnexp
Expand Down
53 changes: 26 additions & 27 deletions mechanisms/allen/Ca_HVA.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
: Reference: Reuveni, Friedman, Amitai, and Gutnick, J.Neurosci. 1993
: Reference: Reuveni, Friedman, Amitai, and Gutnick,
: J. Neurosci. 1993

NEURON {
SUFFIX Ca_HVA
Expand All @@ -16,43 +17,41 @@ PARAMETER {
gbar = 0.00001 (S/cm2)
}

STATE {
m
h
}
STATE { m h }

BREAKPOINT {
SOLVE states METHOD cnexp
ica = gbar*m*m*h*(v-eca)
LOCAL g
g = gbar*m*m*h
ica = g*(v-eca)
}

DERIVATIVE states {
LOCAL mAlpha, mBeta, hAlpha, hBeta, mRat, hRat

mAlpha = 0.055*vtrap(-27 - v, 3.8)
mBeta = 0.94*exp((-75-v)/17)
mRat = mAlpha + mBeta

hAlpha = 0.000457*exp((-13-v)/50)
hBeta = 0.0065/(exp((-v-15)/28)+1)
hRat = hAlpha + hBeta

m' = mAlpha - m*mRat
h' = hAlpha - h*hRat
LOCAL mAlpha, mBeta, hAlpha, hBeta

mAlpha = m_alpha(v)
mBeta = m_beta(v)
hAlpha = h_alpha(v)
hBeta = h_beta(v)

m' = mAlpha - m*(mAlpha + mBeta)
h' = hAlpha - h*(hAlpha + hBeta)
}

INITIAL {
LOCAL mAlpha, mBeta, hAlpha, hBeta

mAlpha = 0.055*vtrap(-27 - v, 3.8)
mBeta = 0.94*exp((-75 - v)/17)
m = mAlpha/(mAlpha + mBeta)

hAlpha = 0.000457*exp((-13-v)/50)
hBeta = 0.0065/(exp((-v-15)/28) + 1)
mAlpha = m_alpha(v)
mBeta = m_beta(v)
hAlpha = h_alpha(v)
hBeta = h_beta(v)

m = mAlpha/(mAlpha + mBeta)
h = hAlpha/(hAlpha + hBeta)
}

FUNCTION vtrap(x, y) { : Traps for 0 in denominator of rate equations
vtrap = y*exprelr(x/y)
}
FUNCTION vtrap(x, y) { vtrap = y*exprelr(x/y) }
FUNCTION m_alpha(v) { m_alpha = 0.055*vtrap(-27 - v, 3.8) }
FUNCTION h_alpha(v) { h_alpha = 0.000457*exp(-(v + 13)/50) }
FUNCTION m_beta(v) { m_beta = 0.94*exp((-75 - v)/17) }
FUNCTION h_beta(v) { h_beta = 0.0065/(exp(-(v + 15)/28) + 1) }
45 changes: 22 additions & 23 deletions mechanisms/allen/Ca_LVA.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
: Comment: LVA ca channel. Note: mtau is an approximation from the plots
: Reference: Avery and Johnston 1996, tau from Randall 1997
: Comment: shifted by -10 mv to correct for junction potential
: Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21
: Comment: LVA ca channel.
: Note:
: - mtau is an approximation from the plots
: - shifted by -10 mv to correct for junction potential
: - corrected rates using q10 = 2.3, target temperature 34, orginal 21
: Reference: Avery and Johnston 1996, tau from Randall 1997

NEURON {
SUFFIX Ca_LVA
USEION ca READ eca WRITE ica
RANGE gbar
RANGE gbar, qt
}

UNITS {
Expand All @@ -20,35 +22,32 @@ PARAMETER {
celsius
}

ASSIGNED {
qt
}
ASSIGNED { qt }

STATE {
m
h
}
STATE { m h }

BREAKPOINT {
SOLVE states METHOD cnexp
ica = gbar*m*m*h*(v - eca)
LOCAL g
g = gbar*m*m*h
ica = g*(v - eca)
}

DERIVATIVE states {
LOCAL mInf, mRat, hInf, hRat

mInf = 1/(1 + exp((v + 40)/-6))
hInf = 1/(1 + exp((v + 90)/6.4))
mRat = qt/(5 + 20/(1 + exp((v + 35)/5)))
LOCAL mRat, hRat

mRat = qt/(5 + 20/(1 + exp((v + 35)/5)))
hRat = qt/(20 + 50/(1 + exp((v + 50)/7)))

m' = (mInf - m)*mRat
h' = (hInf - h)*hRat
m' = (m_inf(v) - m)*mRat
h' = (h_inf(v) - h)*hRat
}

INITIAL {
qt = 2.3^((celsius-21)/10)

m = 1/(1 + exp((v + 40)/-6))
h = 1/(1 + exp((v + 90)/6.4))
m = m_inf(v)
h = h_inf(v)
}

FUNCTION h_inf(v) { h_inf = 1/(1 + exp( (v + 90)/6.4)) }
FUNCTION m_inf(v) { m_inf = 1/(1 + exp(-(v + 40)/6)) }
45 changes: 21 additions & 24 deletions mechanisms/allen/Ih.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
: Reference: Kole,Hallermann,and Stuart, J. Neurosci. 2006
: Reference: Kole, Hallermann, and Stuart
: J. Neurosci. 2006

NEURON {
SUFFIX Ih
Expand All @@ -7,44 +8,40 @@ NEURON {
}

UNITS {
(S) = (siemens)
(S) = (siemens)
(mV) = (millivolt)
(mA) = (milliamp)
}

PARAMETER {
gbar = 0.00001 (S/cm2)
ehcn = -45.0 (mV)
gbar = 0.00001 (S/cm2)
ehcn = -45.0 (mV)
}

STATE {
m
}
STATE { m }

BREAKPOINT {
SOLVE states METHOD cnexp
ihcn = gbar*m*(v - ehcn)
LOCAL g
g = gbar*m
ihcn = g*(v - ehcn)
}

DERIVATIVE states {
LOCAL mAlpha, mBeta, mRat

mAlpha = 0.001*6.43*vtrap(v + 154.9, 11.9)
mBeta = 0.001*193*exp(v/33.1)
mRat = mAlpha + mBeta

m' = mAlpha - m*mRat
LOCAL ma, mb
ma = m_alpha(v)
mb = m_beta(v)
m' = ma - m*(ma + mb)
}

INITIAL {
LOCAL mAlpha, mBeta

mAlpha = 0.001 * 6.43 * vtrap(v + 154.9, 11.9)
mBeta = 0.001*193*exp(v/33.1)

m = mAlpha/(mAlpha + mBeta)
LOCAL ma, mb
ma = m_alpha(v)
mb = m_beta(v)
m = ma/(ma + mb)
}

FUNCTION vtrap(x, y) { : Traps for 0 in denominator of rate equations
vtrap = y*exprelr(x/y)
}
: Traps for 0 in denominator of rate equations
FUNCTION vtrap(x, y) { vtrap = y*exprelr(x/y) }
FUNCTION m_alpha(v) { m_alpha = 0.001 * 6.43 * vtrap(v + 154.9, 11.9) }
FUNCTION m_beta(v) { m_beta = 0.001*193*exp(v/33.1) }
17 changes: 9 additions & 8 deletions mechanisms/allen/Im.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
: Reference: Adams et al. 1982 - M-currents and other potassium currents in bullfrog sympathetic neurones
: Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21
: Reference: M-currents and other potassium currents in bullfrog sympathetic neurones
: Adams et al. 1982
: Comment: corrected rates using q10 = 2.3, target temperature 34, orginal 21

NEURON {
SUFFIX Im
USEION k READ ek WRITE ik
RANGE gbar
RANGE gbar, qt
}

UNITS {
(S) = (siemens)
(S) = (siemens)
(mV) = (millivolt)
(mA) = (milliamp)
}

PARAMETER {
gbar = 0.00001 (S/cm2)
v (mV)
celsius (degC)
v (mV)
celsius (degC)
}

ASSIGNED { qt }
Expand All @@ -27,7 +28,7 @@ BREAKPOINT {
SOLVE states METHOD cnexp
LOCAL g
g = gbar*m
ik = g*(v-ek)
ik = g*(v - ek)
}

DERIVATIVE states {
Expand All @@ -39,9 +40,9 @@ DERIVATIVE states {

INITIAL {
LOCAL a, b
qt = 2.3^(0.1*(celsius - 21))
a = alpha(v)
b = beta(v)
qt = 2.3^((celsius-21)/10)
m = a/(a + b)
}

Expand Down
31 changes: 13 additions & 18 deletions mechanisms/allen/Im_v2.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
NEURON {
SUFFIX Im_v2
USEION k READ ek WRITE ik
RANGE gbar
RANGE gbar, qt
}

UNITS {
Expand All @@ -17,37 +17,32 @@ PARAMETER {
gbar = 0.00001 (S/cm2)
}

STATE {
m
}
ASSIGNED { qt }
STATE { m }

BREAKPOINT {
SOLVE states METHOD cnexp
ik = gbar*m*(v - ek)
}

DERIVATIVE states {
LOCAL qt, mAlpha, mBeta, mInf, mRat, iab

qt = 2.3^((celsius - 30)/10)

mAlpha = 0.007 * exp(( 6 * 0.4 * (v + 48))/26.12)
mBeta = 0.007 * exp((-6 * (1 - 0.4) * (v + 48))/26.12)
LOCAL mAlpha, mBeta, mAlphaBeta

iab = 1/(mAlpha + mBeta)
mAlpha = m_alpha(v)
mBeta = m_beta(v)
mAlphaBeta = mAlpha + mBeta

mInf = mAlpha*iab
mRat = qt/(15 + iab)

m' = (mInf - m)*mRat
m' = qt*(mAlpha - m*mAlphaBeta)/(1 + 15*mAlphaBeta)
}

INITIAL {
LOCAL mAlpha, mBeta

mAlpha = 0.007*exp(( 6 * 0.4 * (v + 48))/26.12)
mBeta = 0.007*exp((-6 * (1 - 0.4) * (v + 48))/26.12)

mAlpha = m_alpha(v)
mBeta = m_beta(v)
m = mAlpha/(mAlpha + mBeta)
qt = 2.3^((celsius - 30)/10)
}

FUNCTION m_alpha(v) { m_alpha = 0.007*exp(( 6 * 0.4 * (v + 48))/26.12) }
FUNCTION m_beta(v) { m_beta = 0.007*exp((-6 * (1 - 0.4) * (v + 48))/26.12) }
Loading

0 comments on commit 2199a9d

Please sign in to comment.