Cell

Generic NEURON cell object. Provides template abstract methods and a generic design for NEURON cell models.

AUTHORS:

  • Thomas McTavish (2010-11-04).

  • Thomas McTavish (2011-11-06) Update for cleaner docstring and error reporting.

  • Thomas McTavish (2012-02-04) Added _resolve_attr to retrieve attributes,

    sub-attributes, and sub-elements via strings.

class neuronpy.nrnobjects.cell.Cell(nameprefix='', **kwargs)[source]

Generic cell template for NEURON cell objects.

Subclasses can override __init__() completely, or do some of their own initialization first, and then let Cell do its initializing, and then the subclass can finish. For example:

class ChildCell(Cell):
    def __init__(self):
        # Do some stuff
        Cell.__init__(self)
        # Do some more stuff

You might have to get fancy with arguments:

class ChildCell(Cell):
    def __init__(self, someparameter=someval, **kwargs):
        # Do some stuff
        self.someparameter = someparameter
        Cell.__init__(self, **kwargs)
        # Do some more stuff
build_subsets()[source]

Build section list iterators. This defines the ‘all’, SectionList, but subclasses may want to define others. If overriden, call Cell.build_subsets(self) to create the ‘all’ SectionList.

For example, in a subclass with two dendrites, self.dend[0] and self.dend[1] already defined, we can add them to a “dendlist” iterator:

Cell.build_subsets(self) # Make 'all' iterator
self.dendlist = nrn.SectionList()
self.dendlist.append(self.dend[0])
self.dendlist.append(self.dend[1])
build_topology()[source]

Connect the sections of the cell to build a tree. “0” ends are toward the soma and “1” ends are distal. For example, to connect the “0” end of a dendrite to the “1” end of the soma:

self.dend.connect(self.soma(1))  
connect2target(target, thresh=10)[source]

Make a new NetCon with this cell’s membrane potential at the soma as the source (i.e. the spike detector) onto the target passed in (i.e. a synapse on a cell). Subclasses may override with other spike detectors.

create_sections()[source]

Create the sections of the cell. Remember to do this in the form:

self.soma = nrn.Section(name='soma', cell=self)
create_synapses()[source]

Create synapses (such as ExpSyn) at various segments and add them to self.synlist.

For example, in a ball-and-stick cell with a soma and single dendrite, to add an exponentially decaying (tau = 2 ms) synapse in the middle of the dendrite:

syn = nrn.ExpSyn(self.dend(0.5))
syn.tau = 2
self.synlist.append(syn)
define_biophysics()[source]

Assign the membrane properties across the cell. For example:

for sec in self.all: # ‘all’ exists in parent object.
sec.Ra = 100 # Axial resistance in Ohm * cm sec.cm = 1 # Membrane capacitance in micro Farads / cm^2

# Insert active Hodgkin-Huxley current in the soma self.soma.insert(‘hh’) self.soma.gnabar_hh = 0.12 # Sodium conductance in S/cm2 self.soma.gkbar_hh = 0.036 # Potassium conductance in S/cm2 self.soma.gl_hh = 0.0003 # Leak conductance in S/cm2 self.soma.el_hh = -54.3 # Reversal potential in mV

define_geometry()[source]

Set the 3D geometry of the cell. The length, diameter, and number of segments should be set for each section as well as the section’s (x,y,z) coordinates, if necessary. For example:

self.soma.L = self.soma.diam = 12.6157 # microns
self.dend.L = 200                      # microns
self.dend.diam = 1                     # microns
self.dend.nseg = 5
is_art()[source]

Flag to check if we are an integrate-and-fire artificial cell.

rotateZ(theta)[source]

Rotate the cell about the Z axis.

set_position(x, y, z)[source]

Set the base location in 3D and move all other parts of the cell relative to that location.

Previous topic

Neuron Objects

Next topic

Utilities

This Page