Page 1 of 1

### Trying to Make/Debug an Input Current Mod File

Posted: Wed Aug 17, 2016 12:49 am
Hello,

I've been attempting to develop a mod file to re-create an input current similar to what was used in Pozzorini et al (2015). Unfortunately, I'm finding that this task is a bit outside of my wheelhouse as I have not yet needed to make mod files. As it stands, I'm not sure if I have mistakes in the main ODE or somewhere in the structure of the mod file code, or both (probably both). According to Pozzorini et al (2015), the input current should be as follows:

i(t+dt) = i(t) + ((io-i(t))*(dt/tau)) + sqrt(2*(sigma^2)*(dt/tau))*N(0,1)
sigma(t) = sigmao*(1+dsigma*sin(2*PI*freq*t))
...Where...
dt = 0.05 ms
tau = 3 ms
io = 520 pA
freq = 0.2 Hz
N(0,1) = Random sampling from a normal distribution of mean 0 and standard deviation 1.
sigmao = 320 pA
dsigma = 0.5 (dimensionless)

Here is what I have so far:

Code: Select all

``````COMMENT
Written according to equations and parameter values taken from:
Pozzorini C, Mensi S, Hagens O, Naud R, Koch C, Gerstner W. (2015). Automated High-Throughput Characterization of Single Neurons by Means of Simplified Spiking Models. PLoS. Comput. Biol. 11(6):e1004275.
ENDCOMMENT

NEURON {
POINT_PROCESS InputCurrentPoz
RANGE del, dur, tau, io, freq, sigmao, dsigma, sigma
NONSPECIFIC_CURRENT i
}

UNITS {
(nA) = (nanoamp)
}

PARAMETER {
del=0   (ms)
dur=0	(ms)
tau=3	(ms)
io=0.52	(nA)
freq=0.0002	(/ms)
sigmao=0.32	(nA)
dsigma=0.5
PI=3.14159265358979323846
dt (ms)
}

ASSIGNED {
i (nA)
sigma (nA)
}

BREAKPOINT {
at_time(del)
at_time(del + dur)

if (t < del) {
i=0
}else{
if (t < del+dur) {
i = i + ((io-i)*(dt/tau)) + sqrt(2*(sigma^2)*(dt/tau))*urand()
: sigma(t) = sigmao*(1+dsigma*sin(2*PI*freq*t))
sigma = sigma + 2*PI*sigmao*dsigma*(freq*dt)*cos(2*PI*(freq*t))
}else{
i = 0
}
}
}

FUNCTION urand() {
urand = scop_random()
}
``````
Unfortunately, when checking units it returns the following error, which I'm not quite sure how to fix since it should be adding up to being in nA and not dimensionless:

Code: Select all

``````Checking units of /Users/alexgm/Desktop/SkinnerLab/Usages/InputSimsForRedux/InputCurrentPoz.mod
1-18 coul2/sec2
The previous expression is not dimensionless at line 41 in file /InputCurrentPoz.mod
i = i + ((io-i)*(dt/tau)) + sqrt(2*(sigma^2)*(dt/tau)<<ERROR>>)*urand()
Press 'return' key to close
``````
And when simulating it in my multi-compartment model for 1000 ms the membrane potential jumps erratically (typically can jump above 1000 mV and below -1000 mV) and it returns the following:

Code: Select all

``````oc>run()
exp(700.188) out of range, returning exp(700)
exp(712.415) out of range, returning exp(700)
exp(709.561) out of range, returning exp(700)
exp(752.101) out of range, returning exp(700)
No more errno warnings during this execution
errno set 2033 times on last execution
``````
Unfortunately I'm having trouble figuring out how to debug this code and my progress on it has been depressingly slow. Any advice/help would be greatly appreciated, thanks.

References:
Pozzorini C, Mensi S, Hagens O, Naud R, Koch C, Gerstner W. (2015). Automated High-Throughput Characterization of Single Neurons by Means of Simplified Spiking Models. PLoS Comput Biol. 11(6):e1004275.

### Re: Trying to Make/Debug an Input Current Mod File

Posted: Mon Sep 05, 2016 10:07 pm
Hello again,

So I was recently directed to the following Github repository:
https://github.com/pozzorin/GIFFittingT ... HBP/NEURON

... which is in the Human Brain Project (HBP) branch of the GIF fitting python repository. Inside is the "gif.mod" file which, it seems, models the current inputs generated in RĂ¶ssert et al, 2016, a follow-up that applied the methods in Pozzorini et al, (2015) to the blue brain project to reduce their cortical column model.

So far, this code seems to work with my model, though I still need to make additional adjustments since the initial fits are quite poor. Of course, if anyone has comments/advice regarding my initial query, I'd be eager to hear it.