Page 1 of 1
Hyperpolarizing current to every soma in a network - how?
Posted: Wed Aug 31, 2011 10:53 am
by vladimirov
Hi,
I wonder if there is an elegant way to apply a small hyperpolarizing current to all neurons (somas) of a large network. If I have a network of >10,000 neurons, it looks pretty weird to simulate as many IClamps each stuck into a soma and having the same current. Is there any way to simulate it in a smarter way?
Thank you!
Re: Hyperpolarizing current to every soma in a network - how
Posted: Wed Aug 31, 2011 12:51 pm
by ted
The alternative would be to create a density mechanism that does the same thing. This might be less costly in terms of storage requirements than using thousands of point processes.
Code: Select all
NEURON {
SUFFIX bias
NONSPECIFIC_CURRENT i
RANGE i, amp
}
UNITS {
(mA) = (milliamp)
}
PARAMETER {
amp = 0 (mA/cm2)
}
ASSIGNED {
i (mA/cm2)
}
BREAKPOINT {
i = amp
}
Insert this into every section where you need it.
Use an FInitializeHandler to control turning it on and off.
Code: Select all
// put these lines near the top of your code, for the sake of convenience
START = time at which you want the current to start
DUR = how long you want it to last
AMP = amplitude of current
. . .
// put these lines near your simulation control code
objref fih
fih = new FInitializeHandler("init_bias()")
proc int_bias() {
forall if (ismembrane("bias")) amp_bias(0.5) = 0 // turn bias off
cvode.event("toggle_bias(START)") // to turn on at t = START
}
proc toggle_bias() {
forall if (ismembrane("bias")) {
if (amp_bias(0.5) == 0) { // turn it on
amp_bias(0.5) = AMP
cvode.event("toggle_bias(t + DUR)") // to turn off at t + DUR
} else { // turn it off
amp_bias(0.5) = 0
}
}
// we've changed a parameter abruptly
// so we really should re-initialize cvode
// if cvode is not being used, just call fcurrent()
if (cvode.active()) {
cvode.re_init()
} else {
fcurrent()
}
}
Be sure to test this on a toy net with just a few cells, in case I made a mistake somewhere.
One caveat: this mechanism will deliver a current density into every segment of each section to which it is attached. Total current injected into each segment will be proportional to segment area. A POINT_PROCESS delivers an absolute current, and only into the segment to which it is attached. If this is a problem for you, let me know and I will suggest how to get exactly the effect you want.
Re: Hyperpolarizing current to every soma in a network - how
Posted: Wed Aug 31, 2011 2:48 pm
by vladimirov
Wow, thank you very much, Ted. I think this solves my problem. Your mod file works fine. Here is how I use it:
Code: Select all
cell.soma insert bias
area_soma=PI*cell.soma.diam*cell.soma.L*1e-8 // [mcm->cm2]
AMP=0.1*1e-6 //[nA->mA], note that hyperpolarizing current is + (opposite to electrode current sign)
cell.soma amp_bias=AMP/area_soma
This gives same depolarization as injecting -0.1 nA current by an electrode, as expected.
Thanks a lot!
Re: Hyperpolarizing current to every soma in a network - how
Posted: Thu Sep 01, 2011 10:15 am
by ted
That does work.