Cell classes¶
Cell definitions for models.
This class includes a number of different cell definitions and default conductances for point models.
-
class
cnmodel.cells.Cell[source]¶ Base class for all cell types.
-
add_axon(c_m=1.0, R_a=150, axonsf=1.0, nodes=5, debug=False, dia=None, len=None, seg=None)[source]¶ Add an axon to the soma with an initial segment (tapered), and multiple nodes of Ranvier The size of the axon is determined by self.axonsf, which in turn is set by the species The somaarea is used to scale the density of ion channels in the initial segment
-
add_section(sec, sec_type)[source]¶ Add a section (or list of sections) to this cell. This adds the section to self.all_sections[sec_type] and also allows the cell to be accessed from the section using cells.cell_from_section().
Notes:
sec_type must be one of the keys already in self.all_sections.
This method does not connect sections together; that must be done manually.
-
cell_initialize(showinfo=False, vrange=None, **kwargs)[source]¶ Initialize this cell to it’s “rmp” under current conditions All sections in the cell are set to the same value
-
channel_manager(modelType='RM03')[source]¶ Every cell class should have a channel manager if it is set up to handle morphology. This function should be overridden in the class with an appropriate routine that builds the dictionary needed to decorate the cell. See the bushy cell class for an example.
Parameters: modelType (string (default: 'RM03')) – A string that identifies what type of model the channel manager will implement. This may be used to define different kinds of channels, or channel densities and compartmental placement for different cells.
-
check_all_mechs()[source]¶ Check that all mechanisms are the same as when we initially created the cell
-
compute_rmrintau(auto_initialize=True, vrange=None)[source]¶ Run the model for 2 msec after initialization - then compute the inverse of the sum of the conductances to get Rin at rest compute Cm*Rin to get tau at rest
Parameters: auto_initialize (boolean (default: True)) – If true, forces initialization of cell in NEURON befor the computation. Returns: A dictionary containing Return type: Rin (Mohm), tau (ms) and Vm (mV)
-
connect(post_cell, pre_opts=None, post_opts=None, **kwds)[source]¶ Create a new synapse connecting this cell to a postsynaptic cell. The synapse is automatically created using pre_cell.make_terminal(post_cell, **pre_opts) and post_cell.make_psd(terminal, **post_opts).
By default, the cells decide which sections to connect. This can be overridden by specifying ‘section’ in pre_opts and/or post_opts.
Parameters: - post_cell (NEURON section (required)) – The postsynaptic cell that will receive the connection.
- pre_opts (dictionary of options for the presynaptic cell (default: None)) – see the synapses class for valid options and format.
- post_opts (diction of options for the postsynaptic cell (default: None)) – see synapses class for valid options and format.
- **kwds ((optional)) – argmuments that are passed to the synapses class.
Returns: Return type: the synapse object
-
find_i0(vrange=None, showinfo=False)[source]¶ find the root of the system of equations in vrange. Finds RMP fairly accurately as zero current level for current conductances.
Parameters: - vrange (list of 2 floats (default: [-70, -55])) – The voltage range over which the root search will be performed.
- showinfo (boolean (default: False)) – a flag to print out which roots were found and which mechanisms were in the cell
Returns: Return type: The voltage at which I = 0 in the vrange specified
-
get_mechs(section)[source]¶ return a list of the mechanisms that are present in a section a mechanism is required to have a gbar variable. This routine should be called at the end of every cell creation routine.
-
i_currents(V)[source]¶ For the steady-state case, return the total current at voltage V Used to find the zero current point vrange brackets the interval Implemented here are the basic known mechanisms. If you add or need more mechanisms, they either need to be accomadated in this routine, or this routine needs to be implemented (overridden) in the specific cell class.
-
make_psd(terminal, **kwds)[source]¶ Create a PSD suitable for synaptic input from pre_sec. This routine is a placeholder and should be overridden in the specific cell class with code that performs the required actions for that class.
Parameters: - terminal (the terminal that connects to the PSD (required)) –
- **kwds (parameters passed to the terminal) –
-
make_terminal(post_cell, **kwds)[source]¶ Create a synaptic terminal release mechanism suitable for output from this cell to post_sec This routine is a placeholder and should be replace in the specific cell class with code that performs the required actions for that class.
Parameters: - post_cell (the target terminal cell (required)) –
- **kwds (parameters passed to the terminal) –
-
print_mechs(section)[source]¶ print the mechanisms that are inserted into the specified section, and their densities (in uS/cm^2)
-
save_all_mechs()[source]¶ get and save all of the initial mechanisms and their maximal conductances when the cell is created. We use this to get and check values later when the run is actually done. Note: some cell constructions may require that save_all_mechs be done again after the initial “build”. In this case, setting the cell’s initial_mechanisms property to None must be done to allow a new configuration of mechanisms to be saved.
-
set_d_lambda(freq=100, d_lambda=0.1)[source]¶ Sets nseg in each section to an odd value so that its segments are no longer than d_lambda x the AC length constant at frequency freq in that section. The defaults are reasonable values for most models Be sure to specify your own Ra and cm before calling geom_nseg()
To understand why this works, and the advantages of using an odd value for nseg, see Hines, M.L. and Carnevale, N.T. NEURON: a tool for neuroscientists. The Neuroscientist 7:123-135, 2001. This is a python version of the hoc code.
Parameters: - freq (float, default=100. (Hz)) – Frequency in Hz to use in computing nseg.
- d_lambda (float, default=0.1) – fraction of AC length constant for minimum segment length
-
set_morphology(morphology_file=None)[source]¶ Set the cell’s morphological structure from a file that defines sections (for example, a morphology file read by neuronvis), or from a morphology object that has already been retrieved/created.
Parameters: morphology_file (string or morphology object (default: None)) – File name/path for the morphology file (for example, .hoc or .swc file) Alternatively, this can be a morphology object returned by the morphology class. Returns: Return type: nothing
-
set_soma_size_from_Cm(cap)[source]¶ Use soma capacitance to set the cell size. Area of the open cylinder is same as a sphere of the same diameter. Compute area and save total capacitance as well
-
set_soma_size_from_Diam(diam)[source]¶ Use diameter to set the cell size. Area of the open cylinder is same as a sphere of the same diameter. Compute area and total capacitance as well
-
soma¶ First (or only) section in the “soma” section group.
-
Individual cell subclasses¶
cnmodel.cells.bushy¶
-
class
cnmodel.cells.bushy.Bushy[source] Bases:
cnmodel.cells.cell.Cell-
classmethod
create(model='RM03', **kwds)[source]
-
make_psd(terminal, psd_type, **kwds)[source] Connect a presynaptic terminal to one post section at the specified location, with the fraction of the “standard” conductance determined by gbar. The default condition is designed to pass the unit test (loc=0.5)
Parameters: - terminal (Presynaptic terminal (NEURON object)) –
- psd_type (either simple or multisite PSD for bushy cell) –
- kwds (dictionary of options.) – Two are currently handled: postsite : expect a list consisting of [sectionno, location (float)] AMPAScale : float to scale the ampa currents
-
make_terminal(post_cell, term_type, **kwds)[source]
-
type= 'bushy'
-
classmethod
-
class
cnmodel.cells.bushy.BushyRothman(morphology=None, decorator=None, nach=None, ttx=False, species='guineapig', modelType=None, debug=False, temperature=None)[source] Bases:
cnmodel.cells.bushy.Bushy- VCN bushy cell models.
- Rothman and Manis, 2003abc (Type II, Type II-I) Xie and Manis, 2013
Create a bushy cell, using the default parameters for guinea pig from R&M2003, as a type II cell. Additional modifications to the cell can be made by calling methods below.
Parameters: - morphology (string (default: None)) – Name of a .hoc file representing the morphology. This file is used to constructe an electrotonic (cable) model. If None (default), then a “point” (really, single cylinder) model is made, exactly according to RM03.
- decorator (Python function (default: None)) – decorator is a function that “decorates” the morphology with ion channels according to a set of rules. If None, a default set of channels is inserted into the first soma section, and the rest of the structure is “bare”.
- nach (string (default: None)) – nach selects the type of sodium channel that will be used in the model. A channel mechanism by that name must exist. The default channel is set to ‘nacn’ (R&M03)
- temperature (float (default: 22)) – temperature to run the cell at.
- ttx (Boolean (default: False)) – If ttx is True, then the sodium channel conductance is set to 0 everywhere in the cell. This flag duplicates the effects of tetrodotoxin in the model. Currently, the flag is not implemented.
- species (string (default 'guineapig')) – species defines the pattern of ion channel densities that will be inserted, according to prior measurements in various species. Note that if a decorator function is specified, this argument is ignored as the decorator will specify the channel density.
- modelType (string (default: None)) – modelType specifies the subtype of the cell model that will be used (e.g., “II”, “II-I”, etc). modelType is passed to the decorator, or to species_scaling to adjust point (single cylinder) models.
- debug (boolean (default: False)) – When True, there will be multiple printouts of progress and parameters.
Returns: Return type: Nothing
-
add_axon()[source] Add a default axon from the generic cell class to the bushy cell (see cell class).
-
add_dendrites(debug=False)[source] Add a simple dendrite to the bushy cell.
-
add_pumps()[source] Insert mechanisms for potassium ion management, sodium ion management, and a sodium-potassium pump at the soma.
-
adjust_na_chans(soma, sf=1.0, gbar=1000.0, debug=False)[source] adjust the sodium channel conductance
Parameters: - soma (neuron section object) – A soma object whose sodium channel complement will have its conductances adjusted depending on the channel type
- gbar (float (default: 1000.)) – The maximal conductance for the sodium channel
- debug (boolean (false):) – Verbose printing
Returns: Return type: Nothing
-
channel_manager(modelType='RM03')[source] This routine defines channel density maps and distance map patterns for each type of compartment in the cell. The maps are used by the ChannelDecorator class (specifically, its private _biophys function) to decorate the cell membrane. These settings are only used if the decorator is called; otherwise for point cells, the species_scaling routine defines the channel densities.
Parameters: modelType (string (default: 'RM03')) – A string that defines the type of the model. Currently, 3 types are implemented: RM03: Rothman and Manis, 2003 somatic densities for guinea pig XM13: Xie and Manis, 2013, somatic densities for mouse mGBC: experimental mouse globular bushy cell with dendrites, axon, hillock and initial segment, for use with fully reconstructed neurons. Returns: Return type: Nothing Notes
This routine defines the following variables for the class:
- conductances (gBar)
- a channelMap (dictonary of channel densities in defined anatomical compartments)
- a current injection range for IV’s (used for testing)
- a distance map, which defines how each conductance in a selected compartment changes with distance from the soma. The current implementation includes both linear and exponential gradients, the minimum conductance at the end of the gradient, and the space constant or slope for the gradient.
-
get_cellpars(dataset, species='guineapig', celltype='II')[source]
-
species_scaling(species='guineapig', modelType='II', silent=True)[source] Adjust all of the conductances and the cell size according to the species requested. This scaling should be used ONLY for point models, as no other compartments are scaled.
This scaling routine also sets the temperature for the model to a default value. Some models can be run at multiple temperatures, and so a default from one of the temperatures is used. The calling cell.set_temperature(newtemp) will change the conductances and reinitialize the cell to the new temperature settings.
Parameters: - species (string (default: 'guineapig')) – name of the species to use for scaling the conductances in the base point model Must be one of mouse, cat, guineapig
- modelType (string (default: 'II')) – definition of model type from RM03 models, type II or type II-I
- silent (boolean (default: True)) – run silently (True) or verbosely (False)
cnmodel.cells.cartwheel¶
-
class
cnmodel.cells.cartwheel.Cartwheel[source] Bases:
cnmodel.cells.cell.Cell-
classmethod
create(model='CW', **kwds)[source]
-
make_psd(terminal, psd_type, **kwds)[source] Connect a presynaptic terminal to one post section at the specified location, with the fraction of the “standard” conductance determined by gbar. The default condition is designed to pass the unit test (loc=0.5)
Parameters: - terminal (Presynaptic terminal (NEURON object)) –
- psd_type (either simple or multisite PSD for bushy cell) –
- kwds (dictionary of options.) – Two are currently handled: postsize : expect a list consisting of [sectionno, location (float)] AMPAScale : float to scale the ampa currents
-
make_terminal(post_cell, term_type, **kwds)[source]
-
classmethod
-
class
cnmodel.cells.cartwheel.CartwheelDefault(morphology=None, decorator=None, ttx=False, nach=None, species='mouse', modelType=None, debug=False)[source] Bases:
cnmodel.cells.cartwheel.Cartwheel,cnmodel.cells.cell.CellDCN cartwheel cell model.
Create cartwheel cell model, based on a Purkinje cell model from Raman. There are no variations available for this model.
Parameters: - morphology (string (default: None)) – Name of a .hoc file representing the morphology. This file is used to constructe an electrotonic (cable) model. If None (default), then a “point” (really, single cylinder) model is made, exactly according to RM03.
- decorator (Python function (default: None)) – decorator is a function that “decorates” the morphology with ion channels according to a set of rules. If None, a default set of channels is inserted into the first soma section, and the rest of the structure is “bare”.
- nach (string (default: None)) – nach selects the type of sodium channel that will be used in the model. A channel mechanism by that name must exist. The default is naRsg, a resurgent sodium channel model.
- ttx (Boolean (default: False)) – If ttx is True, then the sodium channel conductance is set to 0 everywhere in the cell. This flag duplicates the effects of tetrodotoxin in the model. Currently, the flag is not implemented.
- species (string (default 'rat')) – species defines the pattern of ion channel densities that will be inserted, according to prior measurements in various species. Note that if a decorator function is specified, this argument is ignored as the decorator will specify the channel density.
- modelType (string (default: None)) – modelType specifies the subtype of the cell model that will be used. modelType is passed to the decorator, or to species_scaling to adjust point (single cylinder) models. Only type “I” is recognized for the cartwheel cell model.
- debug (boolean (default: False)) – When True, there will be multiple printouts of progress and parameters.
Returns: Return type: Nothing
-
get_cellpars(dataset, species='guineapig', celltype='II')[source]
-
ghk(v, ci, co, z)[source] GHK flux equation, used to calculate current density through calcium channels rather than standard Nernst equation.
Parameters: - v (float, mV) – voltage for GHK calculation
- ci (float, mM) – internal ion concentration
- co (float, mM) – external ion concentraion
- z (float, no units) – valence
Returns: flux
Return type: A/m^2
-
i_currents(V)[source] For the steady-state case, return the total current at voltage V Used to find the zero current point. Overrides i_currents in cells.py, because this model uses conductances that are not specified in the default cell mode.
Parameters: V (float, mV (no default)) – Voltage at which the current for each conductance is computed. Returns: I – The sum of the currents at steady-state for all of the conductances. Return type: float, nA
-
species_scaling(silent=True, species='mouse', modelType='I')[source] Adjust all of the conductances and the cell size according to the species requested. This scaling should be used ONLY for point models, as no other compartments are scaled.
Parameters: - species (string (default: 'rat')) – name of the species to use for scaling the conductances in the base point model Must be one of mouse, cat, guineapig
- modelType (string (default: 'I')) – definition of model type from RM03 models, type II or type II-I
- silent (boolean (default: True)) – run silently (True) or verbosely (False)
Note
For the cartwheel cell model, there is only a single scaling recognized.
cnmodel.cells.dstellate¶
-
class
cnmodel.cells.dstellate.DStellate[source] Bases:
cnmodel.cells.cell.Cell-
classmethod
create(model='RM03', **kwds)[source]
-
make_psd(terminal, psd_type, **kwds)[source] Connect a presynaptic terminal to one post section at the specified location, with the fraction of the “standard” conductance determined by gbar. The default condition is designed to pass the unit test (loc=0.5)
Parameters: - terminal (Presynaptic terminal (NEURON object)) –
- psd_type (either simple or multisite PSD for bushy cell) –
- kwds (dictionary of options.) – Two are currently handled: postsize : expect a list consisting of [sectionno, location (float)] AMPAScale : float to scale the ampa currents
-
make_terminal(post_cell, term_type, **kwds)[source]
-
type= 'dstellate'
-
classmethod
-
class
cnmodel.cells.dstellate.DStellateRothman(morphology=None, decorator=None, nach=None, ttx=False, species='guineapig', modelType=None, debug=False)[source] Bases:
cnmodel.cells.dstellate.DStellateVCN D-stellate model: as a type I-II from Rothman and Manis, 2003
initialize a radial stellate (D-stellate) cell, using the default parameters for guinea pig from R&M2003, as a type I-II cell. Modifications to the cell can be made by calling methods below. These include:
- changing the sodium channel
- Changing “species” to mouse or cat (scales conductances)
- Shifting model type
Parameters: - morphology (string (default: None)) – Name of a .hoc file representing the morphology. This file is used to constructe an electrotonic (cable) model. If None (default), then a “point” (really, single cylinder) model is made, exactly according to RM03.
- decorator (Python function (default: None)) – decorator is a function that “decorates” the morphology with ion channels according to a set of rules. If None, a default set of channels is inserted into the first soma section, and the rest of the structure is “bare”.
- nach (string (default: None)) – nach selects the type of sodium channel that will be used in the model. A channel mechanism by that name must exist. A value of None will set the channel to a default for the model (nacn).
- ttx (Boolean (default: False)) – If ttx is True, then the sodium channel conductance is set to 0 everywhere in the cell. This flag duplicates the effects of tetrodotoxin in the model. Currently, the flag is not implemented.
- species (string (default 'guineapig')) – species defines the pattern of ion channel densities that will be inserted, according to prior measurements in various species. Note that if a decorator function is specified, this argument is ignored as the decorator will specify the channel density.
- modelType (string (default: None)) – modelType specifies the subtype of the cell model that will be used (e.g., “II”, “II-I”, etc). modelType is passed to the decorator, or to species_scaling to adjust point (single cylinder) models.
- debug (boolean (default: False)) – When True, there will be multiple printouts of progress and parameters.
Returns: Return type: Nothing
-
add_axon()[source] Add a default axon from the generic cell class to the bushy cell (see cell class).
-
add_dendrites()[source] Add simple unbranched dendrites to basic Rothman Type I-II model. The dendrites have some kht and ih current
-
adjust_na_chans(soma, sf=1.0, gbar=1000.0, debug=False)[source] adjust the sodium channel conductance
Parameters: - soma (soma object (no default)) – soma object whose sodium channel complement will have it’s conductances adjusted depending on the channel type
- gbar (float (default: 1000.)) – The conductance to be set for the sodium channel
- debug (boolean (default: False)) – Flag for printing the conductance value and Na channel model
Returns: Return type: Nothing
-
species_scaling(species='guineapig', modelType='I-II', silent=True)[source] Adjust all of the conductances and the cell size according to the species requested.
Parameters: - species (string (default: 'guineapig')) – A string specifying the species used for scaling. Recognized values are ‘mouse’, ‘guineapig’, and ‘cat’ (cat is just a larger version of the guineapig)
- modelType (string (default: 'I-II')) – A string specifying the version of the model to use. Current choices are ‘I-II’ (others need to be implemented)
- silent (boolean (default: True)) – Flag for printing debugging information.
-
class
cnmodel.cells.dstellate.DStellateEager(nach='na', ttx=False, species='guineapig', modelType='I-II', debug=False)[source] Bases:
cnmodel.cells.dstellate.DStellateThis is a model of the VCN D-Stellate cells as proposed by Eager, M.A., Grayden, D.B., Burkitt, A.N., and Meffin, H., “A neural circuit model of the ventral cochlear nucleus”, Internet: http://citeseerx.ist.pus.edu/viewdoc/download?doi=10.1.79.9620.pdf&rep =rep&type=pdf also cited as: Proceedings of the 10th Australian International Conference on Speech Science and Technology, pp. 539-544, 2004. It is based on the Rothman and Manis (2003c) model, with small modifications. Their model includes dendrites and an axon, which are added in this version
Initialize the VCN D-stellate model of Eager et al. Some model parameters may be modified.
Parameters: - nach (string (default: 'na')) – Set the sodium channel model. Choices are ‘na’, ‘nav11’, ‘jsrna’
- ttx (boolean (default: False)) – ttx sets the sodium channel conductance to 0
- species (string (default: 'guineapig')) – species to use for conductance scaling
- modelType (string (default: 'I-II')) – RM03 model type to use for conductances.
- debug (boolean (default: False)) – Flag to use to enable print statements for debugging purposes.
-
add_axon()[source] Adds an axon to the Eager. et al model Cell.add_axon(self, nodes=1, c_m=self.c_m, R_a=self.R_a, axonsf=self.axonsf, dia=3.0, len=70, seg=2) The Eager et al model just uses one cable, 70 microns long and 3 microns in dameter.
Parameters: None – Returns: Return type: Nothing
-
add_dendrites()[source] Adds dendrites to the Eager model. The Eager model uses simple passive dendrites.
Parameters: None – Returns: Return type: Nothing
-
adjust_na_chans(soma, gbar=1000.0, debug=False)[source] adjust the sodium channel conductance
Parameters: - soma (soma object (no default)) – soma object whose sodium channel complement will have it’s conductances adjusted depending on the channel type
- gbar (float (default: 1000.)) – The conductance to be set for the sodium channel
- debug (boolean (default: False)) – Flag for printing the conductance value and Na channel model
Returns: Return type: Nothing
-
species_scaling(species='guineapig', modelType='I-II', silent=True)[source] Adjust all of the conductances and the cell size according to the species requested.
Parameters: - species (string (default: 'guineapig')) – A string specifying the species used for scaling. Recognized values are ‘mouse’, ‘guineapig’, and ‘cat’ (cat is just a larger version of the guineapig)
- modelType (string (default: 'I-II')) – A string specifying the version of the model to use. Current choices are ‘I-II’ (others need to be implemented)
- silent (boolean (default: True)) – Flag for printing debugging information.
cnmodel.cells.hh¶
-
class
cnmodel.cells.hh.HH(debug=False, message=None)[source] Bases:
cnmodel.cells.cell.CellStandard Hodgkin-Huxley mechanisms from NEURON
cnmodel.cells.octopus¶
-
class
cnmodel.cells.octopus.Octopus[source] Bases:
cnmodel.cells.cell.Cell-
classmethod
create(modelType='RM03', **kwds)[source]
-
make_psd(terminal, psd_type, **kwds)[source] Connect a presynaptic terminal to one post section at the specified location, with the fraction of the “standard” conductance determined by gbar. The default condition is to try to pass the default unit test (loc=0.5)
Parameters: - terminal (Presynaptic terminal (NEURON object)) –
- psd_type (either simple or multisite PSD for bushy cell) –
- kwds (dict of options. Two are currently handled:) –
- postsize (expect a list consisting of [sectionno, location (float)]) –
- AMPAScale (float to scale the ampa currents) –
-
type= 'octopus'
-
classmethod
-
class
cnmodel.cells.octopus.OctopusRothman(morphology=None, decorator=None, nach=None, ttx=False, species='guineapig', modelType=None, debug=False)[source] Bases:
cnmodel.cells.octopus.Octopus,cnmodel.cells.cell.CellVCN octopus cell model (point cell). Rothman and Manis, 2003abc (Type II, with high gklt and hcno - octopus cell h current).
initialize the octopus cell, using the default parameters for guinea pig from R&M2003, as a type II cell with modified conductances. Modifications to the cell can be made by calling methods below.
Parameters: - morphology (string (default: None)) – a file name to read the cell morphology from. If a valid file is found, a cell is constructed as a cable model from the hoc file. If None (default), the only a point model is made, exactly according to RM03.
- decorator (Python function (default: None)) – decorator is a function that “decorates” the morphology with ion channels according to a set of rules. If None, a default set of channels aer inserted into the first soma section, and the rest of the structure is “bare”.
- nach (string (default: None)) – nach selects the type of sodium channel that will be used in the model. A channel mechanism by that name must exist. None implies the default channel (jsrna for this model).
- ttx (Boolean (default: False)) – If ttx is True, then the sodium channel conductance is set to 0 everywhere in the cell. Currently, this is not implemented.
- species (string (default 'guineapig')) – species defines the channel density that will be inserted for different models. Note that if a decorator function is specified, this argument is ignored.
- modelType (string (default: None)) – modelType specifies the type of the model that will be used (e.g., “II”, “II-I”, etc). modelType is passed to the decorator, or to species_scaling to adjust point models.
- debug (boolean (default: False)) – debug is a boolean flag. When set, there will be multiple printouts of progress and parameters.
Returns: Return type: Nothing
-
adjust_na_chans(soma, sf=1.0, gbar=1000.0, debug=False)[source] adjust the sodium channel conductance
Parameters: - soma (neuron section object) – a soma object whose sodium channel complement will have it’s conductances adjusted depending on the channel type
- gbar (float (default: 1000.)) – the maximal conductance for the sodium channel
- debug (boolean (false):) – verbose printing
Returns: Return type: Nothing
-
species_scaling(species='guineapig', modelType='II-o', silent=True)[source] Adjust all of the conductances and the cell size according to the species requested. Used ONLY for point models.
Parameters: - species (string (default: 'guineapig')) – name of the species to use for scaling the conductances in the base point model Must be guineapig
- modelType (string (default: 'II-o')) – definition of model type from RM03 models, currently limited to type II-o
- silent (boolean (default: True)) – run silently (True) or verbosely (False)
-
class
cnmodel.cells.octopus.OctopusSpencer(morphology=None, decorator=None, nach='jsrna', ttx=False, species='guineapig', modelType=None, debug=False)[source] Bases:
cnmodel.cells.octopus.Octopus,cnmodel.cells.cell.CellVCN octopus cell model (with dendrites). Based on Spencer et al Front. Comput. Neurosci., 22 October 2012 https://doi.org/10.3389/fncom.2012.00083
initialize the octopus cell, using the parameters Spencer et al. 2012 Modifications to the cell can be made by calling methods below.
Parameters: - morphology (string (default: None)) – a file name to read the cell morphology from. If a valid file is found, a cell is constructed as a cable model from the hoc file. If None (default), the only a point model is made, exactly according to RM03.
- decorator (Python function (default: None)) – decorator is a function that “decorates” the morphology with ion channels according to a set of rules. If None, a default set of channels aer inserted into the first soma section, and the rest of the structure is “bare”.
- nach (string (default: 'na')) – nach selects the type of sodium channel that will be used in the model. A channel mechanism by that name must exist.
- ttx (Boolean (default: False)) – If ttx is True, then the sodium channel conductance is set to 0 everywhere in the cell. Currently, this is not implemented.
- species (string (default 'guineapig')) – species defines the channel density that will be inserted for different models. Note that if a decorator function is specified, this argument is ignored.
- modelType (string (default: None)) – modelType specifies the type of the model that will be used (e.g., “II”, “II-I”, etc). modelType is passed to the decorator, or to species_scaling to adjust point models.
- debug (boolean (default: False)) – debug is a boolean flag. When set, there will be multiple printouts of progress and parameters.
Returns: Return type: Nothing
-
channel_manager(modelType='Spencer')[source] This routine defines channel density maps and distance map patterns for each type of compartment in the cell. The maps are used by the ChannelDecorator class (specifically, it’s private _biophys function) to decorate the cell membrane.
Parameters: modelType (string (default: 'Spencer')) – A string that defines the type of the model. Currently, 1 type is implemented: Spencer : Spencer et al Front. Comput. Neurosci. 2012 Returns: Return type: Nothing Notes
This routine defines the following variables for the class: # conductances (gBar) # a channelMap (dictonary of channel densities in defined anatomical compartments) # a current injection range for IV’s (when testing) # a distance map, which defines how selected conductances in selected compartments will change with distance. This includes both linear and exponential gradients, the minimum conductance at the end of the gradient, and the space constant or slope for the gradient.
-
species_scaling(species='mouse', modelType='Spencer', silent=True)[source] Adjust all of the conductances and the cell size according to the species requested. Used ONLY for point models.
Parameters: - species (string (default: 'guineapig')) – name of the species to use for scaling the conductances in the base point model Must be guineapig
- modelType (string (default: 'II-o')) – definition of model type from RM03 models, currently limited to type II-o
- silent (boolean (default: True)) – run silently (True) or verbosely (False)
cnmodel.cells.pyramidal¶
-
class
cnmodel.cells.pyramidal.Pyramidal[source] Bases:
cnmodel.cells.cell.Cell-
classmethod
create(model='POK', **kwds)[source]
-
make_psd(terminal, psd_type, **kwds)[source] Connect a presynaptic terminal to one post section at the specified location, with the fraction of the “standard” conductance determined by gbar. The default condition is to try to pass the default unit test (loc=0.5)
Parameters: - terminal (Presynaptic terminal (NEURON object)) –
- psd_type (either simple or multisite PSD for bushy cell) –
- kwds (dict of options. Two are currently handled:) –
- postsize (expect a list consisting of [sectionno, location (float)]) –
- AMPAScale (float to scale the ampa currents) –
-
type= 'pyramidal'
-
classmethod
-
class
cnmodel.cells.pyramidal.PyramidalKanold(morphology=None, decorator=None, nach=None, ttx=False, species='rat', modelType=None, debug=False)[source] Bases:
cnmodel.cells.pyramidal.Pyramidal,cnmodel.cells.cell.CellDCN pyramidal cell Kanold and Manis, 1999, 2001, 2005
initialize a pyramidal cell, based on the Kanold-Manis (2001) pyramidal cell model. Modifications to the cell can be made by calling methods below. These include converting to a model with modified size and conductances (experimental).
Parameters: - morphology (string (default: None)) – a file name to read the cell morphology from. If a valid file is found, a cell is constructed as a cable model from the hoc file. If None (default), the only a point model is made, exactly according to RM03.
- decorator (Python function (default: None)) – decorator is a function that “decorates” the morphology with ion channels according to a set of rules. If None, a default set of channels is inserted into the first soma section, and the rest of the structure is “bare”.
- nach (string (default: None)) – nach selects the type of sodium channel that will be used in the model. A channel mechanim by that name must exist. None implies the default channel, ‘napyr’.
- ttx (Boolean (default: False)) – If ttx is True, then the sodium channel conductance is set to 0 everywhere in the cell. Currently, this is not implemented.
- species (string (default 'guineapig')) – species defines the channel density that will be inserted for different models. Note that if a decorator function is specified, this argument is ignored (overridden by decorator).
- modelType (string (default: None)) – modelType specifies the type of the model that will be used (e.g., “II”, “II-I”, etc). modelType is passed to the decorator, or to species_scaling to adjust point models.
- debug (boolean (default: False)) – debug is a boolean flag. When set, there will be multiple printouts of progress and parameters.
Returns: Return type: Nothing
-
add_dendrites()[source] Add simple unbranched dendrite. The dendrites have some kd, kif and ih current
-
get_cellpars(dataset, species='guineapig', celltype='II')[source]
-
i_currents(V)[source] For the steady-state case, return the total current at voltage V Used to find the zero current point vrange brackets the interval Overrides i_currents in cells.py because we have a different set of currents to compute.
-
species_scaling(species='rat', modelType='I', silent=True)[source] Adjust all of the conductances and the cell size according to the species requested. Used ONLY for point models.
Parameters: - species (string (default: 'rat')) – name of the species to use for scaling the conductances in the base point model Must be ‘rat’
- modelType (string (default: 'I')) – definition of model type from Kanold and Manis, 2001 choices are ‘I’ or ‘POK’ (canonical model) or ‘II’, a modified model with more physiological surface area and KCNQ channels
- silent (boolean (default: True)) – run silently (True) or verbosely (False)
cnmodel.cells.sgc¶
-
class
cnmodel.cells.sgc.SGC(cf=None, sr=None)[source] Bases:
cnmodel.cells.cell.Cell-
cf Center frequency
-
classmethod
create(model='I', species='mouse', **kwds)[source]
-
make_terminal(post_cell, term_type, **kwds)[source] Create a StochasticTerminal and configure it according to the postsynaptic cell type.
-
sr Spontaneous rate group. 1=low, 2=mid, 3=high
-
type= 'sgc'
-
-
class
cnmodel.cells.sgc.SGC_TypeI(morphology=None, decorator=None, nach=None, ttx=False, species='guineapig', modelType='bm', cf=None, sr=None, debug=False)[source] Bases:
cnmodel.cells.sgc.SGCSpiral ganglion cell model
Initialize a spiral ganglion Type I cell, based on a bushy cell model. Modifications to the cell can be made by calling the methods below. These include converting to a model with modified size and conductances (experimental), and and changing the sodium channel conductances.
Parameters: - morphology (string (default: None)) – a file name to read the cell morphology from. If a valid file is found, a cell is constructed as a cable model from the hoc file. If None (default), the only a point model is made, exactly according to RM03.
- decorator (Python function (default: None)) – decorator is a function that “decorates” the morphology with ion channels according to a set of rules. If None, a default set of channels aer inserted into the first soma section, and the rest of the structure is “bare”.
- nach (string (default: 'na')) – nach selects the type of sodium channel that will be used in the model. A channel mechanim by that name must exist. The default is jsrna (Rothman et al., 1993)
- ttx (Boolean (default: False)) – If ttx is True, then the sodium channel conductance is set to 0 everywhere in the cell. Currently, this is not implemented.
- species (string (default 'guineapig')) – species defines the channel density that will be inserted for different models. Note that if a decorator function is specified, this argument is ignored.
- modelType (string (default: None)) – modelType specifies the type of the model that will be used. SGC model know about “a” (apical) and “bm” (basal-middle) models, based on Liu et al., JARO, 2014. modelType is passed to the decorator, or to species_scaling to adjust point models.
- cf (float (default: None)) – The CF for the auditory nerve fiber that this SGC represents.
- sr (string (default: None)) – The spontaneous rate group to which this fiber belongs. “LS”, “MS”, and “HS” are known values.
- debug (boolean (default: False)) – debug is a boolean flag. When set, there will be multiple printouts of progress and parameters.
Returns: Return type: Nothing
-
adjust_na_chans(soma, gbar=1000.0, debug=False)[source] adjust the sodium channel conductance :param soma: a soma object whose sodium channel complement will have it’s conductances adjusted depending on the channel type :return nothing:
-
get_cellpars(dataset, species='guineapig', celltype='sgc-a')[source]
-
i_currents(V)[source] For the steady-state case, return the total current at voltage V Used to find the zero current point vrange brackets the interval Implemented here are the basic RM03 mechanisms This function should be replaced for specific cell types.
-
species_scaling(silent=True, species='guineapig', modelType='a')[source] Adjust all of the conductances and the cell size according to the species requested. Used ONLY for point models.
Parameters: - species (string (default: 'guineapig')) – name of the species to use for scaling the conductances in the base point model Must be one of mouse or guineapig
- modelType (string (default: 'a')) – definition of HCN model type from Liu et al. JARO 2014: ‘a’ for apical model ‘bm’ for basal-middle model
- silent (boolean (default: True)) – run silently (True) or verbosely (False)
Returns: Return type: Nothing
Notes
The ‘guineapig’ model uses the mouse HCN channel model, verbatim. This may not be appropriate, given that the other conductances are scaled up.
-
class
cnmodel.cells.sgc.DummySGC(cf=None, sr=None, simulator=None)[source] Bases:
cnmodel.cells.sgc.SGCSGC class with no cell body; this cell only replays a predetermined spike train.
Parameters: - cf (float (default: None)) – Required: the characteristic frequency for the SGC
- sr (int (default None)) – required : Selects the spontaneous rate group from the Zilany et al (2010) model. 1 = LSR, 2 = MSR, 3 = HSR
- simulator ('cochlea' | 'matlab' | None (default None)) – Sets the simulator interface that will be used. All models currently use the Zilany et al. model, but the simulator can be run though a Python-interface directly to the Matlab code as publicy available, (simulator=’matlab’), or can be run through Rudnicki & Hemmert’s Python interface to the simulator’s C code (simulator=’cochlea’).
-
generate_spiketrain(stim, seed, simulator=None)[source]
-
set_sound_stim(stim, seed, simulator=None)[source] Set the sound stimulus used to generate this cell’s spike train.
-
set_spiketrain(times)[source] Set the times of spikes (in seconds) to be replayed by the cell.
cnmodel.cells.tstellate¶
-
class
cnmodel.cells.tstellate.TStellate[source] Bases:
cnmodel.cells.cell.Cell-
classmethod
create(model='RM03', **kwds)[source]
-
make_psd(terminal, psd_type, **kwds)[source] Connect a presynaptic terminal to one post section at the specified location, with the fraction of the “standard” conductance determined by gbar. The default condition is to try to pass the default unit test (loc=0.5)
Scaling is corrected by initial release probability now.
Parameters: - terminal (Presynaptic terminal (NEURON object)) –
- psd_type (either simple or multisite PSD for bushy cell) –
- kwds (dict of options.) – Available options: postsize : expect a list consisting of [sectionno, location (float)] AMPAScale : float to scale the ampa currents
-
type= 'tstellate'
-
classmethod
-
class
cnmodel.cells.tstellate.TStellateRothman(morphology=None, decorator=None, nach=None, ttx=False, species='guineapig', modelType=None, debug=False)[source] Bases:
cnmodel.cells.tstellate.TStellateVCN T-stellate base model. Rothman and Manis, 2003abc (Type I-c, Type I-t)
Initialize a planar stellate (T-stellate) cell, using the default parameters for guinea pig from R&M2003, as a type I cell. Modifications to the cell can be made by calling methods below. These include: Converting to a type IA model (add transient K current) (species: guineapig-TypeIA). Changing “species” to mouse or cat (scales conductances)
Parameters: - morphology (string (default: None)) – a file name to read the cell morphology from. If a valid file is found, a cell is constructed as a cable model from the hoc file. If None (default), the only a point model is made, exactly according to RM03.
- decorator (Python function (default: None)) – decorator is a function that “decorates” the morphology with ion channels according to a set of rules. If None, a default set of channels aer inserted into the first soma section, and the rest of the structure is “bare”.
- nach (string (default: None)) – nach selects the type of sodium channel that will be used in the model. A channel mechanism by that name must exist. The default is ‘nacn’, from R&M2003.
- ttx (Boolean (default: False)) – If ttx is True, then the sodium channel conductance is set to 0 everywhere in the cell. Currently, this is not implemented.
- species (string (default 'guineapig')) – species defines the channel density that will be inserted for different models. Note that if a decorator function is specified, this argument is ignored.
- modelType (string (default: None)) – modelType specifies the type of the model that will be used (e.g., “I-c”, “I-t”). modelType is passed to the decorator, or to species_scaling to adjust point models.
- debug (boolean (default: False)) – debug is a boolean flag. When set, there will be multiple printouts of progress and parameters.
Returns: Return type: Nothing
-
add_axon()[source]
-
add_dendrites()[source] Add simple unbranched dendrites to basic Rothman Type I models. The dendrites have some kht and ih current
-
adjust_na_chans(soma, sf=1.0, gbar=1000.0, debug=False)[source] Adjust the sodium channel conductance, depending on the type of conductance
Parameters: - soma (NEURON section object (required)) – This identifies the soma object whose sodium channel complement will have it’s conductances adjusted depending on the sodium channel type
- gbar (float (default: 1000.)) – The “maximal” conductance to be set in the model.
- debug (boolean (default: False)) – A flag the prints out messages to confirm the operations applied.
Returns: Return type: Nothing
-
channel_manager(modelType='RM03')[source] This routine defines channel density maps and distance map patterns for each type of compartment in the cell. The maps are used by the ChannelDecorator class (specifically, called from it’s private _biophys function) to decorate the cell membrane with channels.
Parameters: modelType (string (default: 'RM03')) – A string that defines the type of the model. Currently, 3 types are implemented: RM03: Rothman and Manis, 2003 somatic densities for guinea pig XM13: Xie and Manis, 2013, somatic densities for mouse XM13PasDend: XM13, but with only passive dendrites, no channels. Returns: Return type: Nothing Notes
This routine defines the following variables for the class:
- conductances (gBar)
- a channelMap (dictonary of channel densities in defined anatomical compartments)
- a current injection range for IV’s (when testing)
- a distance map, which defines how selected conductances in selected compartments
- will change with distance. This includes both linear and exponential gradients, the minimum conductance at the end of the gradient, and the space constant or slope for the gradient.
-
get_cellpars(dataset, species='guineapig', celltype='I-c')[source]
-
species_scaling(species='guineapig', modelType='I-c', silent=True)[source] Adjust all of the conductances and the cell size according to the species requested. Used ONLY for point models.
This scaling routine also sets the temperature for the model to a default value. Some models can be run at multiple temperatures, and so a default from one of the temperatures is used. The calling cell.set_temperature(newtemp) will change the conductances and reinitialize the cell to the new temperature settings.
Parameters: - species (string (default: 'guineapig')) – name of the species to use for scaling the conductances in the base point model Must be one of mouse, cat, guineapig
- modelType (string (default: 'I-c')) – definition of model type from RM03 models, type I-c or type I-t
- silent (boolean (default: True)) – run silently (True) or verbosely (False)
-
class
cnmodel.cells.tstellate.TStellateNav11(morphology=None, decorator=None, nach='nav11', ttx=False, species='mouse', modelType=None, debug=False)[source] Bases:
cnmodel.cells.tstellate.TStellateVCN T-stellate cell (Mouse) from Xie and Manis, 2013. Using nav11 sodium channel model.
Initialize a planar stellate (T-stellate) cell as a point model, using the default parameters for mouse from Xie and Manis, 2013. Modifications to the cell can be made by calling methods below. Changing “species”: This routine only supports “mouse” Note: in the original model, the temperature scaling applied only to the rate constants, and not to the conductance. Therefore, the conductances here need to be adjusted to compensate for the way the mechanisms are currently implemented (so that they scale correctly to the values used in Xie and Manis, 2013). This is done by setting q10g (the q10 for conductances) to 1 before setting up the rest of the model parameters. For those conducantances in which a Q10 for conductance is implemented, the value is typically 2.
Parameters: - morphology (string (default: None)) – a file name to read the cell morphology from. If a valid file is found, a cell is constructed as a cable model from the hoc file. If None (default), the only a point model is made, exactly according to RM03.
- decorator (Python function (default: None)) – decorator is a function that “decorates” the morphology with ion channels according to a set of rules. If None, a default set of channels aer inserted into the first soma section, and the rest of the structure is “bare”.
- nach (string (default: 'nav11')) – nach selects the type of sodium channel that will be used in the model. A channel mechanims by that name must exist.
- ttx (Boolean (default: False)) – If ttx is True, then the sodium channel conductance is set to 0 everywhere in the cell. Currently, this is not implemented.
- species (string (default 'mouse')) – species defines the channel density that will be inserted for different models. Note that if a decorator function is specified, this argument is ignored.
- modelType (string (default: None)) – modelType specifies the type of the model that will be used (e.g., “II”, “II-I”, etc). modelType is passed to the decorator, or to species_scaling to adjust point models.
- debug (boolean (default: False)) – debug is a boolean flag. When set, there will be multiple printouts of progress and parameters.
Returns: Return type: Nothing
-
adjust_na_chans(soma, gbar=800.0, debug=False)[source] Adjust the sodium channel conductance, depending on the type of conductance
Parameters: - soma (NEURON section object (required)) – This identifies the soma object whose sodium channel complement will have it’s conductances adjusted depending on the sodium channel type
- gbar (float (default: 800.)) – The “maximal” conductance to be set in the model.
- debug (boolean (default: False)) – A flag the prints out messages to confirm the operations applied.
Returns: Return type: Nothing
-
channel_manager(modelType='XM13')[source] This routine defines channel density maps and distance map patterns for each type of compartment in the cell. The maps are used by the ChannelDecorator class (specifically, called from it’s private _biophys function) to decorate the cell membrane with channels.
Parameters: modelType (string (default: 'XM13')) – A string that defines the type of the model. Currently, 3 types are implemented: XM13: Xie and Manis, 2013, somatic densities for mouse XM13PasDend: XM13, but with only passive dendrites, no channels. Returns: Return type: Nothing Notes
This routine defines the following variables for the class:
- conductances (gBar)
- a channelMap (dictonary of channel densities in defined anatomical compartments)
- a current injection range for IV’s (when testing)
- a distance map, which defines how selected conductances in selected compartments
- will change with distance. This includes both linear and exponential gradients, the minimum conductance at the end of the gradient, and the space constant or slope for the gradient.
-
species_scaling(species='mouse', modelType='I-c', silent=True)[source] Adjust all of the conductances and the cell size according to the species requested. Used ONLY for point models.
Parameters: - species (string (default: 'guineapig')) – name of the species to use for scaling the conductances in the base point model Must be one of mouse, cat, guineapig
- modelType (string (default: 'I-c')) – definition of model type from RM03 models, type I-c or type I-t
- silent (boolean (default: True)) – run silently (True) or verbosely (False)
cnmodel.cells.tuberculoventral¶
-
class
cnmodel.cells.tuberculoventral.Tuberculoventral(morphology=None, decorator=None, nach=None, ttx=False, species='mouse', modelType=None, debug=False)[source] Bases:
cnmodel.cells.tuberculoventral.TuberculoventralTuberculoventral Neuron (DCN) base model Adapted from T-stellate model, using target parameters from Kuo et al. J. Neurophys. 2012
Initialize a DCN Tuberculoventral cell, using the default parameters for guinea pig from R&M2003, as a type I cell. Modifications to the cell can be made by calling methods below. These include: Converting to a type IA model (add transient K current) (species: guineapig-TypeIA). Changing “species” to mouse or cat (scales conductances)
Parameters: - morphology (string (default: None)) – a file name to read the cell morphology from. If a valid file is found, a cell is constructed as a cable model from the hoc file. If None (default), the only a point model is made, exactly according to RM03.
- decorator (Python function (default: None)) – decorator is a function that “decorates” the morphology with ion channels according to a set of rules. If None, a default set of channels aer inserted into the first soma section, and the rest of the structure is “bare”.
- nach (string (default: 'na')) – nach selects the type of sodium channel that will be used in the model. A channel mechanims by that name must exist.
- ttx (Boolean (default: False)) – If ttx is True, then the sodium channel conductance is set to 0 everywhere in the cell. Currently, this is not implemented.
- species (string (default 'guineapig')) – species defines the channel density that will be inserted for different models. Note that if a decorator function is specified, this argument is ignored.
- modelType (string (default: None)) – modelType specifies the type of the model that will be used (e.g., “II”, “II-I”, etc). modelType is passed to the decorator, or to species_scaling to adjust point models.
- debug (boolean (default: False)) – debug is a boolean flag. When set, there will be multiple printouts of progress and parameters.
Returns: Return type: Nothing
-
adjust_na_chans(soma, gbar=1000.0, debug=False)[source] Adjust the sodium channel conductance, depending on the type of conductance
Parameters: - soma (NEURON section object (required)) – This identifies the soma object whose sodium channel complement will have it’s conductances adjusted depending on the sodium channel type
- gbar (float (default: 1000.)) – The “maximal” conductance to be set in the model.
- debug (boolean (default: False)) – A flag the prints out messages to confirm the operations applied.
Returns: Return type: Nothing
-
channel_manager(modelType='TVmouse')[source] This routine defines channel density maps and distance map patterns for each type of compartment in the cell. The maps are used by the ChannelDecorator class (specifically, it’s private _biophys function) to decorate the cell membrane.
Parameters: modelType (string (default: 'RM03')) – A string that defines the type of the model. Currently, 3 types are implemented: RM03: Rothman and Manis, 2003 somatic densities for guinea pig XM13: Xie and Manis, 2013, somatic densities for mouse XM13PasDend: XM13, but with only passive dendrites, no channels. Returns: Return type: Nothing Notes
This routine defines the following variables for the class:
- conductances (gBar)
- a channelMap (dictonary of channel densities in defined anatomical compartments)
- a current injection range for IV’s (when testing)
- a distance map, which defines how selected conductances in selected compartments
- will change with distance. This includes both linear and exponential gradients, the minimum conductance at the end of the gradient, and the space constant or slope for the gradient.
-
get_cellpars(dataset, species='mouse', celltype='TVmouse')[source]
-
species_scaling(species='guineapig', modelType='TVmouse', silent=True)[source] Adjust all of the conductances and the cell size according to the species requested. Used ONLY for point models.
Parameters: - species (string (default: 'guineapig')) – name of the species to use for scaling the conductances in the base point model Must be one of mouse, cat, guineapig
- modelType (string (default: 'I-c')) – definition of model type from RM03 models, type I-c or type I-t
- silent (boolean (default: True)) – run silently (True) or verbosely (False)