This is my first post, and I am looking forward to engaging in fruitful discussions in this excellent curated forum.
I have a problem.
Right now, I am trying to calculate the ATP consumption in the NEURON CA1 model I am using (https://www.sciencedirect.com/science/a ... 8021002975) by recording the current for different channel mechanisms that contribute to calcium and sodium flux across the cell membrane. For that, I am using open-source code from a Renaud Jolivet paper (https://journals.plos.org/ploscompbiol/ ... bi.1007226) to read out currents of interest. So far, I succeeded in tracking the sodium current of diverse mechanisms with specified ina currents in my mechanisms and disentangling the sodium part from my ih and leak currents. However, I am having a hard time to track the sodium part of my synaptic mechanisms (NMDAR & AMPAR).
This is the code I am using in HOC:
Code: Select all
//**************************************************************//
// New advance procedure to read out currents
//**************************************************************//
objref vec_sodium, vec_sodium_leak, vec_sodium_hd, vec_calcium, vec_sodium_comp, vec_sodium_ampa, vec_sodium_nmda
itot_na = 0
ina_leak = 0
ina_h = 0
ina_ampa = 0
ina_nmda = 0
ina_comp = 0
itot_ca = 0
vec_sodium = new Vector()
vec_sodium_leak = new Vector()
vec_sodium_hd = new Vector()
vec_sodium_comp = new Vector()
vec_sodium_ampa = new Vector()
vec_sodium_nmda = new Vector()
vec_calcium = new Vector()
vec_sodium.record(&itot_na)
vec_sodium_leak.record(&ina_leak)
vec_sodium_hd.record(&ina_h)
vec_sodium_comp.record(&ina_comp)
vec_sodium_ampa.record(&ina_ampa)
vec_sodium_nmda.record(&ina_nmda)
vec_calcium.record(&itot_ca)
proc read_compartment_current(){
if (ismembrane("na_ion")){
ina_comp = ina($1) * 1e-2 * area($1)
ina_leak = g_pas * (Ek - v_init) / (Ek - Ena) * ( v - Ena) * area($1)
ina_h = 0
if (ismembrane("hd")){
ina_h = ghdbar_hd * (Ek - Eh) / (Ek - Ena) * (v - Ena) * area($1)
}
ina_syn = 0
//if (ismembrane("ghkampa")){
//ina_syn = AMPAsyn.Pmax * Ek / (Ek - Ena) * (v - Ena) * area($1)
//AMPAsyn[j].Pmax * Ek / (Ek - Ena) * (v - Ena) * area($1)
//}
// INa, syns = gsyns *VK / (VK – VNa) * (V – VNa) with gsyns = gAMPA for AMPA type synapses
// or INa, nmda = gmax *VK / (VK – VNa) * (V – VNa) * 1/(1 + eta*mg*exp(-gamma*V))
// With eta=0.05 mg=2 gamma=0.06 from the NMDA kinetics or fitting for NMDA type synapses
itot_na = itot_na + ina_comp + ina_leak + ina_h + ina_syn
}
if (ismembrane("ca_ion")){
ica_comp = ica($1) * 1e-2 * area($1)
itot_ca = itot_ca + ica_comp
}
}
proc advance(){
fadvance()
itot_na = 0
itot_ca = 0
forall {
for (x) {
if (x==0 || x==1) { continue }
read_compartment_current(x)
}
}
}
Now to the core of my problem, as I am randomly distributing synapses on the dendritic tree, enumerated from 1 to 80, I don't know in which order they show up. Thus, I can't iterate through my list of point processes (example, AMPAsyn[j].Pmax) in numerical order during my iteration of the segments to look for the conductance to calculate the current. At least, this didn't work out for me. I forgot to mention, another caveat is that I also assign a range of conductances. Hence, I can't specify the current without looking it up in the respective segment. Instead, I would like to implement the sodium part calculation in the NMODL file itself, so I can call the current from the NMODL file directly without the need to iterate through the point processes, which seems not feasible to me with my configuration.
Unfortunately, I am a little bit overwhelmed with calling variables specified in NMODL in HOC.
For example, this is the code for my AMPAR mechanism (not much different from the NMDAR one):
Code: Select all
COMMENT
The kinetics part is obtained from Exp2Syn of NEURON.
Two state kinetic scheme synapse described by rise time taur, and
decay time constant taud. The normalized peak conductance is 1.
Decay time MUST be greater than rise time.
The solution of A->G->bath with rate constants 1/taur and 1/taud is
A = a*exp(-t/taur) and
G = a*taud/(taud-taur)*(-exp(-t/taur) + exp(-t/taud))
where taur < taud
If taud-taur -> 0 then we have a alphasynapse.
and if taur -> 0 then we have just single exponential decay.
The factor is evaluated in the initial block such that an event of
weight 1 generates a peak conductance of 1.
Because the solution is a sum of exponentials, the coupled equations
can be solved as a pair of independent equations by the more efficient
cnexp method.
GHK based ionic currents for AMPA current added by Rishikesh Narayanan.
ENDCOMMENT
NEURON {
POINT_PROCESS ghkampa
USEION na WRITE ina
USEION k WRITE ik
RANGE taur, taud
RANGE iampa
RANGE P, Pmax
}
UNITS {
(nA) = (nanoamp)
(mV) = (millivolt)
(uS) = (microsiemens)
(molar) = (1/liter)
(mM) = (millimolar)
FARADAY = (faraday) (coulomb)
R = (k-mole) (joule/degC)
}
PARAMETER {
taur=2 (ms) <1e-9,1e9>
taud = 10 (ms) <1e-9,1e9>
nai = 18 (mM) : Set for a reversal pot of +55mV
nao = 140 (mM)
ki = 140 (mM) : Set for a reversal pot of -90mV
ko = 5 (mM)
celsius (degC)
Pmax=1e-6 (cm/s)
}
ASSIGNED {
ina (nA)
ik (nA)
v (mV)
P (cm/s)
factor
iampa (nA)
Area (cm2)
}
STATE {
A (cm/s)
B (cm/s)
}
INITIAL {
LOCAL tp
if (taur/taud > .9999) {
taur = .9999*taud
}
A = 0
B = 0
tp = (taur*taud)/(taud - taur) * log(taud/taur)
factor = -exp(-tp/taur) + exp(-tp/taud)
factor = 1/factor
Area=1
}
BREAKPOINT {
SOLVE state METHOD cnexp
P=B-A
: Area is just for unit conversion of ghk output
ina = P*ghk(v, nai, nao,1)*Area
ik = P*ghk(v, ki, ko,1)*Area
iampa = ik + ina
}
DERIVATIVE state {
A' = -A/taur
B' = -B/taud
}
FUNCTION ghk(v(mV), ci(mM), co(mM),z) (0.001 coul/cm3) {
LOCAL arg, eci, eco
arg = (0.001)*z*FARADAY*v/(R*(celsius+273.15))
eco = co*efun(arg)
eci = ci*efun(-arg)
ghk = (0.001)*z*FARADAY*(eci - eco)
ina_syn = ina
}
FUNCTION efun(z) {
if (fabs(z) < 1e-4) {
efun = 1 - z/2
}else{
efun = z/(exp(z) - 1)
}
}
NET_RECEIVE(weight (uS)) { : No use to weight, can be used instead of Pmax,
: if you want NetCon access to the synaptic
: conductance.
state_discontinuity(A, A + Pmax*factor)
state_discontinuity(B, B + Pmax*factor)
}
I hope you can help me.
All the best,
Marvin