;; Reference: Cerebellar cortex oscillatory robustness from Golgi cell gap jncs (Simoes de Souza and De Schutter 2011) (nemo-model Granule ( (input v celsius) (component (type defaults) (const V_t = -35) (const celsius = 30) (output celsius V_t) ) (component (type membrane-capacitance) (const C_m = (1)) (output C_m )) (component (type geometry) (name soma) (const L = 11.8) (const diam = 11.8) (output L diam )) (component (type decaying-pool) (name ca) (input (cai from ion-pools) (ica from ion-currents)) (const F = 96485.3) (const d = .2) (const cao = 2.) (const cai0 = 1e-4) (const beta = 1.5) (d (ca) = ((neg (ica) / (2 * F * d)) * 1e4 - (beta * ((if (ca < cai0) then cai0 else ca) - cai0))) (initial cai0)) (output ca cao) ) (component (type ionic-current) (name CaHVA ) (input (cai from ion-pools) (cao from ion-pools)) (component (type gate) ;; rate constants (Q10 = (pow (3 ((celsius - 20) / 10)))) (const Aalpha_s = 0.04944) (const Kalpha_s = 15.87301587302) (const V0alpha_s = -29.06) (const Abeta_s = 0.08298) (const Kbeta_s = -25.641) (const V0beta_s = -18.66) (const Aalpha_u = 0.0013) (const Kalpha_u = -18.183) (const V0alpha_u = -48) (const Abeta_u = 0.0013) (const Kbeta_u = 83.33) (const V0beta_u = -48) ;; rate functions (defun alpha_s (v Q10) (Q10 * Aalpha_s * exp((v - V0alpha_s) / Kalpha_s))) (defun beta_s (v Q10) (Q10 * Abeta_s * exp((v - V0beta_s) / Kbeta_s))) (defun alpha_u (v Q10) (Q10 * Aalpha_u * exp((v - V0alpha_u) / Kalpha_u))) (defun beta_u (v Q10) (Q10 * Abeta_u * exp((v - V0beta_u) / Kbeta_u))) (s_inf = ((alpha_s (v Q10))/(alpha_s (v Q10) + beta_s (v Q10)))) (tau_s = (1 / (alpha_s (v Q10) + beta_s (v Q10)) )) (u_inf = ((alpha_u (v Q10))/(alpha_u (v Q10) + beta_u (v Q10)) )) (tau_u = (1 / (alpha_u (v Q10) + beta_u (v Q10)) )) (hh-ionic-gate (CaHVA ;; ion name: exported variables will be of the form {ion}_{id} (initial-m s_inf) (initial-h u_inf) (m-power 2) (h-power 1) (m-inf s_inf) (m-tau tau_s) (h-inf u_inf) (h-tau tau_u) )) ) (component (type pore) (const gbar = 0.00046) (output gbar )) (component (type permeating-ion) (name ca) (const F = 96485.3) (const R = 8.31342) (e = ((1e3) * (R * (celsius + 273.15)) / (2 * F) * ln (cao / cai))) (output e) ) ) ;; end CaHVA current (component (type voltage-clamp) (name CaHVA) (const vchold = -71) (const vcbase = -69) (const vcinc = 10) (const vcsteps = 8) (const vchdur = 30) (const vcbdur = 100) (const cnhold = 1e-4) (const cnbase = 1e-4) (const cninc = 0) (const cnsteps = 1) (const cnout = 2) (output vchold vcbase vcinc vcsteps vchdur vcbdur cnhold cnbase cninc cnsteps cnout) ) (component (type ionic-current) (name KA ) (defun sigm (x y) (1 / (exp (x / y) + 1))) (component (type gate) ;; rate constants (Q10 = (pow (3 ((celsius - 25.5) / 10)))) (const Aalpha_a = 0.8147) (const Kalpha_a = -23.32708) (const V0alpha_a = -9.17203) (const Abeta_a = 0.1655) (const Kbeta_a = 19.47175) (const V0beta_a = -18.27914) (const Aalpha_b = 0.0368) (const Kalpha_b = 12.8433) (const V0alpha_b = -111.33209) (const Abeta_b = 0.0345) (const Kbeta_b = -8.90123) (const V0beta_b = -49.9537) (const V0_ainf = -38) (const K_ainf = -17) (const V0_binf = -78.8) (const K_binf = 8.4) ;; rate functions (defun alpha_a (v Q10) (Q10 * Aalpha_a * sigm((v - V0alpha_a) Kalpha_a))) (defun beta_a (v Q10) (Q10 * (Abeta_a / exp((v - V0beta_a) / Kbeta_a)))) (defun alpha_b (v Q10) (Q10 * Aalpha_b * sigm((v - V0alpha_b) Kalpha_b))) (defun beta_b (v Q10) (Q10 * Abeta_b * sigm((v - V0beta_b) Kbeta_b))) (a_inf = (1 / (1 + exp ((v - V0_ainf) / K_ainf)))) (tau_a = (1 / (alpha_a (v Q10) + beta_a (v Q10)) )) (b_inf = (1 / (1 + exp ((v - V0_binf) / K_binf)))) (tau_b = (1 / (alpha_b (v Q10) + beta_b (v Q10)) )) (hh-ionic-gate (KA ;; ion name: exported variables will be of the form {ion}_{id} (initial-m (1 / (1 + exp ((v - V0_ainf) / K_ainf))) ) (initial-h (1 / (1 + exp ((v - V0_binf) / K_binf))) ) (m-power 3) (h-power 1) (m-inf a_inf) (m-tau tau_a) (h-inf b_inf) (h-tau tau_b) )) ) (component (type pore) (const gbar = 0.0032) (output gbar )) (component (type permeating-ion) (name k) (const e = -84.69) (output e )) ) ;; end KA current (component (type voltage-clamp) (name KA) (const vchold = -71) (const vcbase = -69) (const vcinc = 10) (const vcsteps = 8) (const vchdur = 30) (const vcbdur = 100) (output vchold vcbase vcinc vcsteps vchdur vcbdur) ) (component (type ionic-current) (name KCa ) (input (cai from ion-pools)) (component (type gate) ;; rate constants (Q10 = (pow (3 ((celsius - 30) / 10)))) (const Aalpha_c = 2.5) (const Balpha_c = 1.5e-3) (const Kalpha_c = -11.765) (const Abeta_c = 1.5) (const Bbeta_c = 0.15e-3) (const Kbeta_c = -11.765) (cai1 = (if (cai < 1e-4) then 1e-4 else cai)) ;; rate functions (defun alpha_c (v cai Q10) (Q10 * Aalpha_c / (1 + (Balpha_c * exp(v / Kalpha_c) / cai )))) (defun beta_c (v cai Q10) (Q10 * Abeta_c / (1 + (cai / (Bbeta_c * exp (v / Kbeta_c))) ))) (c_inf = ((alpha_c (v cai Q10)) / (alpha_c (v cai Q10) + beta_c (v cai Q10)) )) (tau_c = (1 / (alpha_c (v cai Q10) + beta_c (v cai Q10)) )) (hh-ionic-gate (KCa ;; ion name: exported variables will be of the form {ion}_{id} (initial-m c_inf) (m-power 1) (h-power 0) (m-inf c_inf) (m-tau tau_c) )) ) (component (type pore) (const gbar = 0.04) (output gbar )) (component (type permeating-ion) (name k) (const e = -84.69) (output e )) (component (type modulating-ion) (name ca) ) ) ;; end KCa current (component (type voltage-clamp) (name KCa) (const vchold = -71) (const vcbase = -69) (const vcinc = 10) (const vcsteps = 8) (const vchdur = 30) (const vcbdur = 100) (const cnhold = 1e-4) (const cnbase = 1e-4) (const cninc = 1e3) (const cnsteps = 1) (const cnout = 2) (output vchold vcbase vcinc vcsteps vchdur vcbdur cnhold cnbase cninc cnsteps cnout) ) (component (type ionic-current) (name Kir ) (component (type gate) ;; rate constants (Q10 = (pow (3 ((celsius - 20) / 10)))) (const Aalpha_d = 0.13289) (const Kalpha_d = -24.3902) (const V0alpha_d = -83.94) (const Abeta_d = 0.16994) (const Kbeta_d = 35.714) (const V0beta_d = -83.94) ;; rate functions (defun alpha_d (v Q10) (Q10 * Aalpha_d * exp((v - V0alpha_d) / Kalpha_d))) (defun beta_d (v Q10) (Q10 * Abeta_d * exp((v - V0beta_d) / Kbeta_d) )) (d_inf = ((alpha_d (v Q10)) / (alpha_d (v Q10) + beta_d (v Q10)) )) (tau_d = (1 / (alpha_d (v Q10) + beta_d (v Q10)) )) (hh-ionic-gate (Kir ;; ion name: exported variables will be of the form {ion}_{id} (initial-m d_inf) (m-power 1) (h-power 0) (m-inf (d_inf)) (m-tau (tau_d)) )) ) (component (type pore) (const gbar = 0.0009) (output gbar )) (component (type permeating-ion) (name k) (const e = -84.69) (output e )) ) ;; end Kir current (component (type voltage-clamp) (name Kir) (const vchold = -71) (const vcbase = -69) (const vcinc = 10) (const vcsteps = 8) (const vchdur = 30) (const vcbdur = 100) (output vchold vcbase vcinc vcsteps vchdur vcbdur) ) (component (type ionic-current) (name KM ) (component (type gate) ;; rate constants (const Aalpha_n = 0.0033) (const Kalpha_n = 40) (const V0alpha_n = -30) (const Abeta_n = 0.0033) (const Kbeta_n = -20) (const V0beta_n = -30) (const V0_ninf = -35) (const B_ninf = 6) (Q10 = (pow (3 ((celsius - 22) / 10)))) ;; rate equations (defun alpha_n (v Q10) (Q10 * Aalpha_n * exp((v - V0alpha_n) / Kalpha_n) )) (defun beta_n (v Q10) (Q10 * Abeta_n * exp((v - V0beta_n) / Kbeta_n) )) (hh-ionic-gate (KM ;; ion name: exported variables will be of the form {ion}_{id} (initial-m (1 / (1 + exp((neg (v - V0_ninf)) / B_ninf)))) (m-power 1) (h-power 0) (m-tau (1 / (alpha_n(v Q10) + beta_n (v Q10)) )) (m-inf (1 / (1 + exp((neg (v - V0_ninf)) / B_ninf)))) )) ) (component (type pore) (const gbar = 0.00025) (output gbar )) (component (type permeating-ion) (name k) (const e = -84.69) (output e )) ) ;; end KM current (component (type voltage-clamp) (name KM) (const vchold = -71) (const vcbase = -69) (const vcinc = 10) (const vcsteps = 8) (const vchdur = 30) (const vcbdur = 100) (output vchold vcbase vcinc vcsteps vchdur vcbdur) ) (component (type ionic-current) (name KV ) (defun linoid (x y) (if ((abs (x / y)) < 1e-6) then (y * (1 - ((x / y) / 2))) else (x / (exp (x / y) - 1)) )) (component (type gate) ;; rate constants (Q10 = (pow (3 ((celsius - 6.3) / 10)))) (const Aalpha_n = -0.01) (const Kalpha_n = -10) (const V0alpha_n = -25) (const Abeta_n = 0.125) (const Kbeta_n = -80) (const V0beta_n = -35) ;; rate functions (defun alpha_n (v Q10) (Q10 * Aalpha_n * linoid ((v - V0alpha_n) Kalpha_n))) (defun beta_n (v Q10) (Q10 * Abeta_n * exp((v - V0beta_n) / Kbeta_n) )) (n_inf = ((alpha_n (v Q10)) / (alpha_n (v Q10) + beta_n (v Q10)) )) (tau_n = (1 / (alpha_n (v Q10) + beta_n (v Q10)) )) (hh-ionic-gate (KV ;; ion name: exported variables will be of the form {ion}_{id} (initial-m n_inf) (m-power 4) (h-power 0) (m-inf (n_inf)) (m-tau (tau_n)) )) ) (component (type pore) (const gbar = 0.003) (output gbar )) (component (type permeating-ion) (name k) (const e = -84.69) (output e )) ) ;; end KV current (component (type voltage-clamp) (name KV) (const vchold = -71) (const vcbase = -69) (const vcinc = 10) (const vcsteps = 8) (const vchdur = 30) (const vcbdur = 100) (output vchold vcbase vcinc vcsteps vchdur vcbdur) ) (component (type ionic-current) (name Lkg1) (component (type pore) (const gbar = (5.68e-5)) (output gbar)) (component (type permeating-ion) (name non-specific) (const e = -16.5) (output e )) ) ;; end leak current (component (type ionic-current) (name Lkg2) (component (type pore) (const ggaba = (3e-5)) (output ggaba)) (component (type permeating-ion) (name non-specific) (const egaba = -65) (output egaba )) ) ;; end leak current (component (type ionic-current) (name Na ) (component (type gate) ;; rate constants (Q10 = (pow (3 ((celsius - 20) / 10)))) (const Aalfa = 353.91) (const Valfa = 13.99) (const Abeta = 1.272) (const Vbeta = 13.99) (const Agamma = 150) (const Adelta = 40) (const Aepsilon = 1.75) (const Ateta = 0.0201) (const Vteta = 25) (const ACon = 0.005) (const ACoff = 0.5) (const AOon = 0.75) (const AOoff = 0.005) (const n1 = 5.422) (const n2 = 3.279) (const n3 = 1.83) (const n4 = 0.738) (gamma = (Q10 * Agamma)) (delta = (Q10 * Adelta)) (epsilon = (Q10 * Aepsilon)) (Con = (Q10 * ACon)) (Coff = (Q10 * ACoff)) (Oon = (Q10 * AOon)) (Ooff = (Q10 * AOoff)) (a = (pow ((Oon / Con) (1.0 / 4.0)))) (b = (pow ((Ooff / Coff) (1.0 / 4.0)))) ;; rate functions (defun alfa (v Q10) (Q10 * Aalfa * exp (v / Valfa))) (defun beta (v Q10) (Q10 * Abeta * exp (neg (v) / Vbeta))) (defun teta (v Q10) (Q10 * Ateta * exp (neg (v) / Vteta))) (reaction (Na_z (transitions (<-> C1 C2 (n1 * alfa (v Q10)) (n4 * beta (v Q10))) (<-> C2 C3 (n2 * alfa (v Q10)) (n3 * beta (v Q10))) (<-> C3 C4 (n3 * alfa (v Q10)) (n2 * beta (v Q10))) (<-> C4 C5 (n4 * alfa (v Q10)) (n1 * beta (v Q10))) (<-> C5 O gamma delta) (<-> O B epsilon (teta (v Q10))) (<-> I1 I2 (n1 * alfa (v Q10) * a) (n4 * beta (v Q10) * b)) (<-> I2 I3 (n2 * alfa (v Q10) * a) (n3 * beta (v Q10) * b)) (<-> I3 I4 (n3 * alfa (v Q10) * a) (n2 * beta (v Q10) * b)) (<-> I4 I5 (n4 * alfa (v Q10) * a) (n1 * beta (v Q10) * b)) (<-> I5 I6 gamma delta) (<-> C1 I1 Con Coff) (<-> C2 I2 (Con * a) (Coff * b)) (<-> C3 I3 (Con * pow (a 2)) (Coff * pow (b 2))) (<-> C4 I4 (Con * pow (a 3)) (Coff * pow (b 3))) (<-> C5 I5 (Con * pow (a 4)) (Coff * pow (b 4))) (O <-> I6 Oon Ooff)) (conserve ((1 = (C1 + C2 + C3 + C4 + C5 + O + B + I1 + I2 + I3 + I4 + I5 + I6)))) (open O) (power 1))) (output Na_z ) ) (component (type pore) (const gbar = 0.013) (output gbar )) (component (type permeating-ion) (name na) (const e = 87.39) (output e )) ) ;; end Na current (component (type voltage-clamp) (name Na) (const vchold = -71) (const vcbase = -60) (const vcinc = 10) (const vcsteps = 9) (const vchdur = 30) (const vcbdur = 100) (output vchold vcbase vcinc vcsteps vchdur vcbdur)) ) ;; Following are templates for various driver scripts used to run this model ( (".hoc" () #< Removing old automake cache ..." rm -rf autom4te.cache fi echo " -> Running aclocal ..." aclocal echo " -> Running libtoolize ..." if [ `uname -s` = Darwin ] ; then # libtoolize is glibtoolize on OSX LIBTOOLIZE=glibtoolize else LIBTOOLIZE=libtoolize fi libtool_major=`$LIBTOOLIZE --version | head -n1 | cut -d\) -f2 | cut -d\. -f1` $LIBTOOLIZE --force --copy --ltdl echo " -> Re-running aclocal ..." if test $libtool_major -le 2; then aclocal --force else aclocal --force -I $(pwd)/libltdl/m4 fi echo " -> Running autoconf ..." autoconf # autoheader must run before automake echo " -> Running autoheader ..." autoheader echo " -> Running automake ..." automake --foreign --add-missing --force-missing --copy echo "Done." EOF ) ("nestmodule_configure.ac" () #<_LTX_mod * * The dynamicloader can then load modulename and search for symbol "mod" in it. */ granulenest::GranuleModule granulemodule_LTX_mod; // -- DynModule functions ------------------------------------------------------ granulenest::GranuleModule::GranuleModule() { #ifdef LINKED_MODULE // register this module at the dynamic loader // this is needed to allow for linking in this module at compile time // all registered modules will be initialized by the main app's dynamic loader nest::DynamicLoaderModule::registerLinkedModule(this); #endif } granulenest::GranuleModule::~GranuleModule() { } const std::string granulenest::GranuleModule::name(void) const { return std::string("Granule Module"); // Return name of the module } const std::string granulenest::GranuleModule::commandstring(void) const { /* 1. Tell interpreter that we provide the C++ part of GranuleModule with the current revision number. 2. Instruct the interpreter to check that granulemodule-init.sli exists, provides at least version 1.0 of the SLI interface to GranuleModule, and to load it. */ return std::string( "/granulemodule /C++ ($Revision: 8512 $) provide-component " "/granulemodule /SLI (7165) require-component" ); } /* BeginDocumentation Name: StepPatternConnect - Connect sources and targets with a stepping pattern Synopsis: [sources] source_step [targets] target_step synmod StepPatternConnect -> n_connections Parameters: [sources] - Array containing GIDs of potential source neurons source_step - Make connection from every source_step'th neuron [targets] - Array containing GIDs of potential target neurons target_step - Make connection to every target_step'th neuron synmod - The synapse model to use (literal, must be key in synapsedict) n_connections - Number of connections made Description: This function subsamples the source and target arrays given with steps source_step and target_step, beginning with the first element in each array, and connects the selected nodes. Example: /first_src 0 /network_size get def /last_src /iaf_neuron 20 Create def % nodes 1 .. 20 /src [first_src last_src] Range def /last_tgt /iaf_neuron 10 Create def % nodes 21 .. 30 /tgt [last_src 1 add last_tgt] Range def src 6 tgt 4 /drop_odd_spike StepPatternConnect This connects nodes [1, 7, 13, 19] as sources to nodes [21, 25, 29] as targets using synapses of type drop_odd_spike, and returning 12 as the number of connections. The following command will print the connections (you must paste the SLI command as one long line): src { /s Set << /source s /synapse_type /static_synapse >> FindConnections { GetStatus /target get } Map dup length 0 gt { cout s <- ( -> ) <- exch <-- endl } if ; } forall 1 -> [21 25 29] 7 -> [21 25 29] 13 -> [21 25 29] 19 -> [21 25 29] Remark: This function is only provided as an example for how to write your own interface function. Author: Hans Ekkehard Plesser SeeAlso: Connect, ConvergentConnect, DivergentConnect */ void granulenest::GranuleModule::StepPatternConnect_Vi_i_Vi_i_lFunction::execute(SLIInterpreter *i) const { // Check if we have (at least) five arguments on the stack. i->assert_stack_load(5); // Retrieve source, source step, target, target step from the stack const TokenArray sources = getValue (i->OStack.pick(4)); // bottom const long src_step = getValue (i->OStack.pick(3)); const TokenArray targets = getValue (i->OStack.pick(2)); const long tgt_step = getValue (i->OStack.pick(1)); const Name synmodel_name = getValue(i->OStack.pick(0)); // top // Obtain synapse model index const Token synmodel = nest::NestModule::get_network().get_synapsedict().lookup(synmodel_name); if ( synmodel.empty() ) throw nest::UnknownSynapseType(synmodel_name.toString()); const nest::index synmodel_id = static_cast(synmodel); // Build a list of targets with the given step TokenArray selected_targets; for ( size_t t = 0 ; t < targets.size() ; t += tgt_step ) selected_targets.push_back(targets[t]); // Now connect all appropriate sources to this list of targets size_t Nconn = 0; // counts connections for ( size_t s = 0 ; s < sources.size() ; s += src_step ) { // We must first obtain the GID of the source as integer const nest::long_t sgid = getValue(sources[s]); // nest::network::divergent_connect() requires weight and delay arrays. We want to use // default values from the synapse model, so we pass empty arrays. nest::NestModule::get_network().divergent_connect(sgid, selected_targets, TokenArray(), TokenArray(), synmodel_id); Nconn += selected_targets.size(); } // We get here only if none of the operations above throws and exception. // Now we can safely remove the arguments from the stack and push Nconn // as our result. i->OStack.pop(5); i->OStack.push(Nconn); // Finally, we pop the call to this functions from the execution stack. i->EStack.pop(); } //------------------------------------------------------------------------------------- void granulenest::GranuleModule::init(SLIInterpreter *i, nest::Network*) { /* Register a neuron or device model. Give node type as template argument and the name as second argument. The first argument is always a reference to the network. Return value is a handle for later unregistration. */ //printf ("before register model\n"); nest::register_model(nest::NestModule::get_network(), "Granule"); // printf ("after register model\n"); /* Register a synapse type. Give synapse type as template argument and the name as second argument. The first argument is always a reference to the network. */ nest::register_prototype_connection(nest::NestModule::get_network(), "drop_odd_synapse"); /* Register a SLI function. The first argument is the function name for SLI, the second a pointer to the function object. If you do not want to overload the function in SLI, you do not need to give the mangled name. If you give a mangled name, you should define a type trie in the granulemodule-init.sli file. */ i->createcommand("StepPatternConnect_Vi_i_Vi_i_l", &stepPatternConnect_Vi_i_Vi_i_lFunction); } // GranuleModule::init() EOF ) ("nestmodule.h" () #<> SetStatus /neuron /Granule Create def /stepinput /step_current_generator Create def /vlog /voltmeter Create def /vlog_parameters << /interval dt /to_file true /to_memory false >> def vlog vlog_parameters SetStatus stepinput neuron Connect vlog neuron Connect /step_current_parameters << /amplitude_times [0.0 1000.0 2850.0] /amplitude_values [0.0 0.01875 0.0 ] >> def stepinput step_current_parameters SetStatus 3000.0 Simulate EOF ) ) ;; end template declarations )