CNrun
CNrun is a neuronal network model simulator, similar in purpose to NEURON except that individual neurons are not compartmentalised. It is extremely precise and slow. It was built from refactored code written by Thomas Nowotny.Features
- Supported unit types:
- Neurons
- HH, Hodgkin–Huxley by Traub and Miles (1991);
- HHRate, Rate-based model of the HH neuron;
- HH2, Hodgkin–Huxley by Traub & Miles with K leakage current;
- Poisson, Poisson oscillator, with configurable spike duration;
- DotPoisson, Duration-less spike (i.e., a spike lasting for one dt) Poisson oscillator;
- DotPulse, Dot Pulse generator;
- NMap, Map neuron, a very fast approximation of the HH neuron;
- Colpitts, Colpitts oscillator;
- VdPol, Van der Pol oscillator.
- Synapses
- AB, αβ synapse (Destexhe, Mainen, Sejnowsky, 1994);
- ABMinus, same, w/out the (1 — S) term;
- Rall, Rall synapse (Rall, 1967);
- Map, Map synapse (complementary to the NMap neuron).
- Neurons
- Reads network topology description from a NeuroML file (as, for example, generated by neuroConstruct), where the cell_type attribute determines the unit class (from the list above).
- Integration cycle using a Runge–Kutta 6-5-order method, with adjustable minimal and maximal time step.
-
Repeatability of the output of random number dependent units
(such as Poisson oscillator). CNRun uses the gsl (GNU
Scientific Library) rng facilities. You can set the seed and
the rng type with the environment
variables
GSL_RNG_TYPEandGSL_RNG_SEED(leave the latter unset for seeding from the current time’s microsecond value). -
Basic scripting capabilities, with support for variables,
‘;’ as delimiter,
exec(“subshell”) and readline with context-sensitive completion for commands, unit labels, parameters, variables and sources. -
Support for setting parameters of a single unit or group by
regex-matching the unit label:
-
singly, before or between simulation runs using
the
set_parm_*commands; - at regular intervals during the simulation, or at arbitrary timepoints (as, for example, saved from a previous run);
- gradually increasing over a period of time.
-
singly, before or between simulation runs using
the
-
Recording unit output:
- all (or the first only) state variables, continuously every dt or at specified intervals;
- spiking times.
Installation
-
Since mid-August, 2012 CNrun is available
in Debian/sid. Install it using
apt-get install cnrun. -
If you want to build from sources (say, to compile it using
-mtune=native -O3 -flto), make sure you have (the development packages of) these packages installed:gsl,boostandlibxml2. Get the latest version of CNrun sources here. -
Untar it and do
./configure && make install. Unless overridden by--prefix=/install/path, files will go into/usr/local(other sound alternatives for--prefixwould be~or/usr/local/stow/cnrun. -
Now you have an executable
cnrunin$prefix/bin.
Usage
-
Do
man cnrunand, in another terminal window, start cnrun. A README and an example setup can be found in/usr/local/share/doc/cnrun. -
By way of illustration, let’s look at the following example:
# create a model called "fafa" new_model fafa # add a couple of neurons add_neuron HH n1 add_neuron HH n2 # connect them reciprocally add_synapse AB syn1 n1 n2 add_synapse AB syn2 n2 n1 # make the synapses inhibitory # note that synapse are identified by their source and target neurons set_parm_synapse n. n. Esyn -80 # make them spontaneously active (by injecting a DC) set_parm_neuron n. Idc 0.1 # enable listening start_listen n. # run the simulation for 2 seconds advance_for 2000
Starting CNrun with option
-e scriptwill execute that script.Alternatively, have your NeuroML file ready and load it using
load_nml filename.Now you have two files,
n1.varandn2.varcontaining, in two tab-separated columns, a timestamp and the value of state variable E per record. This can readily be plotted using gnuplot. - If your generated var files are growing into hundreds of
megabytes, you might consider setting a larger listening dt
(say, with
listen_dt 1) and/or enabling options-L1to only log the first state variable, and-Lx, to produce binary logs (or use the commandlisten_mode 1+b+. In the latter case CNrun will output state variable data in native form, which will speed up gnuplot considerably at the expense of those files becoming unreadable. To plot binary data, useplot "your-file.varx" binary format "%lf%lf" with lines