Skip to content

membrane_currents.m

Calvin Eiber edited this page Jun 30, 2021 · 1 revision

models.membrane_currents computes the membrane currents and conduction velocities for an axon population (specified in axons~/axons *.mat, generated using models.axon_population) using NEURON and models.axon_model. These membrane currents are used as inputs for the nerve recording simulations (models.nerve_recording and models.axon_sfap).

In addition to 'name', value syntax, models.membrane_currents accepts an options structure; the fields of options.axons are treated as additional input arguments (see tools.opts_to_args).

the outputs from models.membrane_currents are saved in .mat files organized under sub~/axons/[name]/

models.membrane_currents is part of package +models

Syntax:

  • -file 'axons.mat' : specify input axon populations (default: newest axons.mat)
  • -out : specify output folders location (default: axons~/(population)/(Gaines, Sundt, MRG)/)
  • -no-parallel : run in debug mode (without using the parallel pool).
  • -arg {extra-args} : extra arguments passed to models.axon_model
  • -fix-Gaines, -fix-Sundt, -fix-MRG : re-run just one class (note: if other classes are defined using models.axon_populations, the model name for those classes are what is used here. If multiple -fix options are set, multiple classes are simulated.

Operational notes:

models.membrane_currents takes some time to run: on a Windows 10 computer with 16 cores and 64 GB of RAM, running this simulation with the default settings (24 x 3 axon models) takes approximately 90 minutes. A relatively short amount of time after starting this model step, you should see in the console:

Loading ~\primary\sub-1\axons\axons (pelvic-axons).mat (example)
runing I_m NEURON model (Gaines) ... 
[006] Spike at: 0.11 uA (these will come out in random order)

After a little while, you'll eventually get:

...
[019] Spike at: 0.05 uA
        1 file(s) moved. 
        1 file(s) moved. 
        ...

This is normal. In the process of computing the membrane currents, NEURON exports the membrane currents for every segment and time sample, resulting in large files which take time to be read and processed by ViNERS. models.axon_model generates substantially smaller, more efficient output files from this raw output, which are used in later steps.

On Windows, if NEURON runs into an error it will stop and wait for user input. With models.axon_model this manifests as the program getting stuck. Thus, if models.membrane_currents is just sitting there doing nothing for a very long time (more than a few minutes elapse between pressing 'run' and the appearance of the first [002] Spike at: 0.11 uA or similar), try cancelling (ctrl-C) and running models.membrane_currents('-debug','-no-parallel'). This will show the NEURON console in a duplicate process, allowing you to see what error has occurred. The most common source of error is due to nrnmech.dll was not correctly copied from ~/source/nrnmech/. This will be the case if the console window is showing you something like:

        1
Reading stimulus files
begin model setup
        1
C:/nrn/bin/nrniv.exe: node_sensory is not a MECHANISM
 in C:\Users\ceiber\AppData\Local\Temp\pn-mdl-6244\/nrn-00.hoc near line 141
                insert node_sensory // mod file declaring nodal channel properties

This should look like:

       1
Reading stimulus files
begin model setup
        1
from ../models import analysis
        1
Doing internal threshold
Writing file C:/Users/ceiber/AppData/Local/Temp/pn-mdl-6244//NEURON_vm0.dat
Changed dt
Clone this wiki locally