copying to personal repo
This commit is contained in:
25
cnmodel/__init__.py
Executable file
25
cnmodel/__init__.py
Executable file
@@ -0,0 +1,25 @@
|
||||
__author__ = "Paul B. Manis and Luke Campagnola"
|
||||
__version__ = "0.32a"
|
||||
|
||||
try:
|
||||
import faulthandler
|
||||
|
||||
faulthandler.enable()
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
import logging
|
||||
|
||||
logging.basicConfig(level=logging.INFO, format="[%(process)s] %(message)s")
|
||||
import os
|
||||
|
||||
dirname = os.path.abspath(os.path.dirname(__file__))
|
||||
libpath = os.path.join(dirname, "..")
|
||||
import neuron
|
||||
|
||||
try:
|
||||
neuron.h.MultiSiteSynapse
|
||||
except AttributeError:
|
||||
neuron.load_mechanisms(libpath)
|
||||
# flag to allow unit tests to store / overwrite test results
|
||||
AUDIT_TESTS = False
|
||||
23
cnmodel/cells/__init__.py
Normal file
23
cnmodel/cells/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
Cell definitions for models.
|
||||
|
||||
This class includes a number of different cell definitions and default
|
||||
conductances for point models.
|
||||
"""
|
||||
|
||||
from .bushy import *
|
||||
from .tstellate import *
|
||||
from .dstellate import *
|
||||
from .cartwheel import *
|
||||
from .pyramidal import *
|
||||
from .sgc import *
|
||||
from .octopus import *
|
||||
from .tuberculoventral import *
|
||||
from .msoprincipal import *
|
||||
from .hh import *
|
||||
|
||||
from .cell import Cell
|
||||
|
||||
|
||||
def cell_from_section(sec):
|
||||
return Cell.from_section(sec)
|
||||
967
cnmodel/cells/bushy.py
Normal file
967
cnmodel/cells/bushy.py
Normal file
@@ -0,0 +1,967 @@
|
||||
from __future__ import print_function
|
||||
from neuron import h
|
||||
from collections import OrderedDict
|
||||
from .cell import Cell
|
||||
from .. import synapses
|
||||
from ..util import nstomho
|
||||
from ..util import Params
|
||||
import numpy as np
|
||||
from .. import data
|
||||
import pprint
|
||||
|
||||
pp = pprint.PrettyPrinter(indent=4, width=60)
|
||||
|
||||
__all__ = ["Bushy", "BushyRothman"]
|
||||
|
||||
|
||||
class Bushy(Cell):
|
||||
|
||||
type = "bushy"
|
||||
|
||||
@classmethod
|
||||
def create(cls, model="RM03", **kwds):
|
||||
if model == "RM03":
|
||||
return BushyRothman(**kwds)
|
||||
else:
|
||||
raise ValueError("Bushy model %s is unknown", model)
|
||||
|
||||
def make_psd(self, terminal, psd_type, **kwds):
|
||||
"""
|
||||
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
|
||||
|
||||
"""
|
||||
if (
|
||||
"postsite" in kwds
|
||||
): # use a defined location instead of the default (soma(0.5)
|
||||
postsite = kwds["postsite"]
|
||||
loc = postsite[1] # where on the section?
|
||||
uname = (
|
||||
"sections[%d]" % postsite[0]
|
||||
) # make a name to look up the neuron section object
|
||||
post_sec = self.hr.get_section(uname) # Tell us where to put the synapse.
|
||||
else:
|
||||
loc = 0.5
|
||||
post_sec = self.soma
|
||||
|
||||
if psd_type == "simple":
|
||||
if terminal.cell.type in ["sgc", "dstellate", "tuberculoventral"]:
|
||||
weight = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="weight",
|
||||
)
|
||||
tau1 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau1",
|
||||
)
|
||||
tau2 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau2",
|
||||
)
|
||||
erev = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="erev",
|
||||
)
|
||||
return self.make_exp2_psd(
|
||||
post_sec,
|
||||
terminal,
|
||||
weight=weight,
|
||||
loc=loc,
|
||||
tau1=tau1,
|
||||
tau2=tau2,
|
||||
erev=erev,
|
||||
)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make simple PSD for %s => %s"
|
||||
% (terminal.cell.type, self.type)
|
||||
)
|
||||
|
||||
elif psd_type == "multisite":
|
||||
if terminal.cell.type == "sgc":
|
||||
# Max conductances for the glu mechanisms are calibrated by
|
||||
# running `synapses/tests/test_psd.py`. The test should fail
|
||||
# if these values are incorrect
|
||||
self.AMPAR_gmax = (
|
||||
data.get(
|
||||
"sgc_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="AMPAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.NMDAR_gmax = (
|
||||
data.get(
|
||||
"sgc_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="NMDAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.Pr = data.get(
|
||||
"sgc_synapse", species=self.species, post_type=self.type, field="Pr"
|
||||
)
|
||||
self.NMDAR_vshift = data.get(
|
||||
"sgc_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="NMDAR_vshift",
|
||||
)
|
||||
# adjust gmax to correct for initial Pr
|
||||
self.AMPAR_gmax = self.AMPAR_gmax / self.Pr
|
||||
self.NMDAR_gmax = self.NMDAR_gmax / self.Pr
|
||||
|
||||
# original values (now in synapses.py):
|
||||
# self.AMPA_gmax = 3.314707700918133*1e3 # factor of 1e3 scales to pS (.mod mechanisms) from nS.
|
||||
# self.NMDA_gmax = 0.4531929783503451*1e3
|
||||
if "AMPAScale" in kwds: # normally, this should not be done!
|
||||
self.AMPAR_gmax = (
|
||||
self.AMPAR_gmax * kwds["AMPAScale"]
|
||||
) # allow scaling of AMPA conductances
|
||||
if "NMDAScale" in kwds:
|
||||
self.NMDAR_gmax = self.NMDAR_gmax * kwds["NMDAScale"] # and NMDA...
|
||||
return self.make_glu_psd(
|
||||
post_sec,
|
||||
terminal,
|
||||
self.AMPAR_gmax,
|
||||
self.NMDAR_gmax,
|
||||
loc=loc,
|
||||
nmda_vshift=self.NMDAR_vshift,
|
||||
)
|
||||
elif terminal.cell.type == "dstellate":
|
||||
return self.make_gly_psd(post_sec, terminal, psdtype="glyslow", loc=loc)
|
||||
elif terminal.cell.type == "tuberculoventral":
|
||||
return self.make_gly_psd(post_sec, terminal, psdtype="glyslow", loc=loc)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make PSD for %s => %s" % (terminal.cell.type, self.type)
|
||||
)
|
||||
else:
|
||||
raise ValueError("Unsupported psd type %s" % psd_type)
|
||||
|
||||
def make_terminal(self, post_cell, term_type, **kwds):
|
||||
if term_type == "simple":
|
||||
return synapses.SimpleTerminal(self.soma, post_cell, **kwds)
|
||||
|
||||
elif term_type == "multisite":
|
||||
if post_cell.type in ["mso"]:
|
||||
nzones = data.get(
|
||||
"bushy_synapse",
|
||||
species=self.species,
|
||||
post_type=post_cell.type,
|
||||
field="n_rsites",
|
||||
)
|
||||
delay = data.get(
|
||||
"bushy_synapse",
|
||||
species=self.species,
|
||||
post_type=post_cell.type,
|
||||
field="delay",
|
||||
)
|
||||
else:
|
||||
raise NotImplementedError(
|
||||
"No knowledge as to how to connect Bushy cell to cell type %s"
|
||||
% type(post_cell)
|
||||
)
|
||||
pre_sec = self.soma
|
||||
return synapses.StochasticTerminal(
|
||||
pre_sec,
|
||||
post_cell,
|
||||
nzones=nzones,
|
||||
spike_source=self.spike_source,
|
||||
delay=delay,
|
||||
**kwds,
|
||||
)
|
||||
else:
|
||||
raise ValueError("Unsupported terminal type %s" % term_type)
|
||||
|
||||
|
||||
class BushyRothman(Bushy):
|
||||
"""
|
||||
VCN bushy cell models.
|
||||
Rothman and Manis, 2003abc (Type II, Type II-I)
|
||||
Xie and Manis, 2013
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
morphology=None,
|
||||
decorator=None,
|
||||
nach=None,
|
||||
ttx=False,
|
||||
species="guineapig",
|
||||
modelType=None,
|
||||
modelName=None,
|
||||
debug=False,
|
||||
temperature=None,
|
||||
):
|
||||
"""
|
||||
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.
|
||||
|
||||
modelName: string (default: None)
|
||||
modelName specifies the source conductance pattern (RM03, XM13, etc).
|
||||
modelName is passed to the decorator, or to species_scaling to adjust point (single cylinder) models.
|
||||
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
|
||||
"""
|
||||
super(BushyRothman, self).__init__()
|
||||
self.i_test_range = {
|
||||
"pulse": (-1, 1, 0.05)
|
||||
} # note that this might get reset with decorator according to channels
|
||||
# Changing the default values will cause the unit tests to fail!
|
||||
if modelType == None:
|
||||
modelType = "II"
|
||||
if species == "guineapig":
|
||||
modelName = "RM03"
|
||||
temp = 22.0
|
||||
if nach == None:
|
||||
nach = "na"
|
||||
if species == "mouse":
|
||||
temp = 34.0
|
||||
if modelName is None:
|
||||
modelName = "XM13"
|
||||
if nach is None:
|
||||
nach = "na"
|
||||
self.debug = debug
|
||||
self.status = {
|
||||
"species": species,
|
||||
"cellClass": self.type,
|
||||
"modelType": modelType,
|
||||
"modelName": modelName,
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"hillock": False,
|
||||
"initialsegment": False,
|
||||
"myelinatedaxon": False,
|
||||
"unmyelinatedaxon": False,
|
||||
"na": nach,
|
||||
"ttx": ttx,
|
||||
"name": self.type,
|
||||
"morphology": morphology,
|
||||
"decorator": decorator,
|
||||
"temperature": temperature,
|
||||
}
|
||||
|
||||
self.spike_threshold = -40
|
||||
self.vrange = [-70.0, -55.0] # set a default vrange for searching for rmp
|
||||
if self.debug:
|
||||
print(
|
||||
"model type, model name, species: ", modelType, modelName, species, nach
|
||||
)
|
||||
|
||||
self.c_m = 0.9e-6 # default in units of F/cm^2
|
||||
|
||||
self._valid_temperatures = (temp,)
|
||||
if self.status["temperature"] == None:
|
||||
self.status["temperature"] = temp
|
||||
|
||||
if morphology is None:
|
||||
"""
|
||||
instantiate a basic soma-only ("point") model
|
||||
"""
|
||||
if self.debug:
|
||||
print("<< Bushy model: Creating point cell >>")
|
||||
soma = h.Section(
|
||||
name="Bushy_Soma_%x" % id(self)
|
||||
) # one compartment of about 29000 um2
|
||||
soma.nseg = 1
|
||||
self.add_section(soma, "soma")
|
||||
else:
|
||||
"""
|
||||
instantiate a structured model with the morphology as specified by
|
||||
the morphology file
|
||||
"""
|
||||
if self.debug:
|
||||
print(
|
||||
"<< Bushy model: Creating cell with morphology from %s >>"
|
||||
% morphology
|
||||
)
|
||||
self.set_morphology(morphology_file=morphology)
|
||||
|
||||
# decorate the morphology with ion channels
|
||||
if decorator is None: # basic model, only on the soma, does not use tables.
|
||||
self.mechanisms = ["klt", "kht", "ihvcn", "leak", nach]
|
||||
for mech in self.mechanisms:
|
||||
self.soma.insert(mech)
|
||||
self.soma.ena = self.e_na
|
||||
self.soma.ek = self.e_k
|
||||
self.soma().ihvcn.eh = self.e_h
|
||||
self.soma().leak.erev = self.e_leak
|
||||
self.c_m = 0.9
|
||||
self.species_scaling(
|
||||
silent=True, species=species, modelType=modelType
|
||||
) # set the default type II cell parameters
|
||||
else: # decorate according to a defined set of rules on all cell compartments, with tables.
|
||||
self.decorate()
|
||||
self.save_all_mechs() # save all mechanisms inserted, location and gbar values...
|
||||
self.get_mechs(self.soma)
|
||||
if debug:
|
||||
print(" << Created cell >>")
|
||||
|
||||
def get_cellpars(self, dataset, species="guineapig", modelType="II"):
|
||||
"""
|
||||
Read data for ion channels and cell parameters from the tables
|
||||
"""
|
||||
# cell_type = self.map_celltype(cell_type)
|
||||
# print('getcellpars: dataset, species, mmodeltype: ', dataset, species, modelType)
|
||||
# print('model name: ', self.status['modelName'])
|
||||
cellcap = data.get(
|
||||
dataset, species=species, model_type=modelType, field="soma_Cap"
|
||||
)
|
||||
chtype = data.get(
|
||||
dataset, species=species, model_type=modelType, field="na_type"
|
||||
)
|
||||
pars = Params(cap=cellcap, natype=chtype)
|
||||
# print('pars cell/chtype: ')
|
||||
if self.debug:
|
||||
pars.show()
|
||||
if self.status["modelName"] == "RM03":
|
||||
for g in [
|
||||
"%s_gbar" % pars.natype,
|
||||
"kht_gbar",
|
||||
"klt_gbar",
|
||||
"ih_gbar",
|
||||
"leak_gbar",
|
||||
]:
|
||||
pars.additem(
|
||||
g, data.get(dataset, species=species, model_type=modelType, field=g)
|
||||
)
|
||||
if self.status["modelName"] == "XM13":
|
||||
for g in [
|
||||
"%s_gbar" % pars.natype,
|
||||
"kht_gbar",
|
||||
"klt_gbar",
|
||||
"ihvcn_gbar",
|
||||
"leak_gbar",
|
||||
]:
|
||||
pars.additem(
|
||||
g, data.get(dataset, species=species, model_type=modelType, field=g)
|
||||
)
|
||||
if self.status["modelName"] == "mGBC":
|
||||
for g in [
|
||||
"%s_gbar" % pars.natype,
|
||||
"kht_gbar",
|
||||
"klt_gbar",
|
||||
"ihvcn_gbar",
|
||||
"leak_gbar",
|
||||
]:
|
||||
pars.additem(
|
||||
g, data.get(dataset, species=species, model_type=modelType, field=g)
|
||||
)
|
||||
|
||||
return pars
|
||||
|
||||
def species_scaling(self, species="guineapig", modelType="II", silent=True):
|
||||
"""
|
||||
This is called for POINT CELLS ONLY
|
||||
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)
|
||||
|
||||
"""
|
||||
# print '\nSpecies scaling: %s %s' % (species, type)
|
||||
knownspecies = ["mouse", "guineapig", "cat"]
|
||||
|
||||
soma = self.soma
|
||||
# cellType = self.map_celltype(modelType)
|
||||
|
||||
if species == "mouse":
|
||||
# use conductance levels determined from Cao et al., J. Neurophys., 2007. as
|
||||
# model description in Xie and Manis 2013. Note that
|
||||
# conductances were not scaled for temperature (rates were)
|
||||
# so here we reset the default Q10's for conductance (g) to 1.0
|
||||
if modelType not in ["II", "II-I"]:
|
||||
raise ValueError(
|
||||
"\nModel type %s is not implemented for mouse bushy cells"
|
||||
% modelType
|
||||
)
|
||||
if self.debug:
|
||||
print(
|
||||
" Setting conductances for mouse bushy cell (%s), Xie and Manis, 2013"
|
||||
% modelType
|
||||
)
|
||||
if modelname == "XM13":
|
||||
dataset = "XM13_channels"
|
||||
elif modelname == "XM13nacncoop":
|
||||
dataset = "XM13_channels_nacncoop"
|
||||
elif modelname.startswith("mGBC"):
|
||||
dataset = "mGBC_channels"
|
||||
else:
|
||||
raise ValueError(
|
||||
f"ModelName {modelname:s} not recognized for mouse bushy cells"
|
||||
)
|
||||
self.vrange = [-68.0, -55.0] # set a default vrange for searching for rmp
|
||||
self.i_test_range = {"pulse": (-1.0, 1.0, 0.05)}
|
||||
self._valid_temperatures = (34.0,)
|
||||
if self.status["temperature"] is None:
|
||||
self.status["temperature"] = 34.0
|
||||
|
||||
pars = self.get_cellpars(dataset, species=species, modelType=modelType)
|
||||
self.set_soma_size_from_Cm(pars.cap)
|
||||
self.status["na"] = pars.natype
|
||||
self.adjust_na_chans(soma, sf=1.0)
|
||||
soma().kht.gbar = nstomho(pars.kht_gbar, self.somaarea)
|
||||
soma().klt.gbar = nstomho(pars.klt_gbar, self.somaarea)
|
||||
soma().ihvcn.gbar = nstomho(pars.ihvcn_gbar, self.somaarea)
|
||||
soma().leak.gbar = nstomho(pars.leak_gbar, self.somaarea)
|
||||
self.axonsf = 0.57
|
||||
|
||||
elif species == "guineapig":
|
||||
if self.debug:
|
||||
print(
|
||||
" Setting conductances for guinea pig %s bushy cell, Rothman and Manis, 2003"
|
||||
% modelType
|
||||
)
|
||||
self._valid_temperatures = (22.0, 38.0)
|
||||
if self.status["temperature"] is None:
|
||||
self.status["temperature"] = 22.0
|
||||
self.i_test_range = {"pulse": (-0.4, 0.4, 0.02)}
|
||||
sf = 1.0
|
||||
if (
|
||||
self.status["temperature"] == 38.0
|
||||
): # adjust for 2003 model conductance levels at 38
|
||||
sf = 2 # Q10 of 2, 22->38C. (p3106, R&M2003c)
|
||||
# note that kinetics are scaled in the mod file.
|
||||
dataset = "RM03_channels"
|
||||
pars = self.get_cellpars(dataset, species=species, modelType=modelType)
|
||||
self.set_soma_size_from_Cm(pars.cap)
|
||||
self.status["na"] = pars.natype
|
||||
self.adjust_na_chans(soma, sf=sf)
|
||||
soma().kht.gbar = nstomho(pars.kht_gbar, self.somaarea)
|
||||
soma().klt.gbar = nstomho(pars.klt_gbar, self.somaarea)
|
||||
soma().ihvcn.gbar = nstomho(pars.ih_gbar, self.somaarea)
|
||||
soma().leak.gbar = nstomho(pars.leak_gbar, self.somaarea)
|
||||
|
||||
self.axonsf = 0.57
|
||||
|
||||
else:
|
||||
errmsg = (
|
||||
'Species "%s" or model type "%s" is not recognized for Bushy cells.'
|
||||
% (species, modelType)
|
||||
)
|
||||
errmsg += "\n Valid species are: \n"
|
||||
for s in knownspecies:
|
||||
errmsg += " %s\n" % s
|
||||
errmsg += "-" * 40
|
||||
raise ValueError(errmsg)
|
||||
|
||||
self.status["species"] = species
|
||||
self.status["modelType"] = modelType
|
||||
self.check_temperature()
|
||||
# self.cell_initialize(vrange=self.vrange) # no need to do this just yet.
|
||||
if not silent:
|
||||
print(" set cell as: ", species)
|
||||
print(" with Vm rest = %6.3f" % self.vm0)
|
||||
|
||||
# def channel_manager(self, modelType='RM03', cell_type='bushy-II'):
|
||||
# """
|
||||
# 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
|
||||
# -------
|
||||
# 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.
|
||||
#
|
||||
# """
|
||||
#
|
||||
#
|
||||
# dataset = '%s_channels' % modelType
|
||||
# decorationmap = dataset + '_compartments'
|
||||
# # print('dataset: {0:s} decorationmap: {1:s}'.format(dataset, decorationmap))
|
||||
# cellpars = self.get_cellpars(dataset, species=self.status['species'], celltype=cell_type)
|
||||
# refarea = 1e-3*cellpars.cap / self.c_m
|
||||
#
|
||||
# table = data.get_table_info(dataset)
|
||||
# chscale = data.get_table_info(decorationmap)
|
||||
# pars = {}
|
||||
# # retrive the conductances from the data set
|
||||
# for g in table['field']:
|
||||
# x = data.get(dataset, species=self.status['species'], cell_type=cell_type,
|
||||
# field=g)
|
||||
# if not isinstance(x, float):
|
||||
# continue
|
||||
# if '_gbar' in g:
|
||||
# pars[g] = x/refarea
|
||||
# else:
|
||||
# pars[g] = x
|
||||
#
|
||||
# self.channelMap = OrderedDict()
|
||||
# for c in chscale['compartment']:
|
||||
# self.channelMap[c] = {}
|
||||
# for g in pars.keys():
|
||||
# if g not in chscale['parameter']:
|
||||
# # print ('Parameter %s not found in chscale parameters!' % g)
|
||||
# continue
|
||||
# scale = data.get(decorationmap, species=self.status['species'], cell_type=cell_type,
|
||||
# compartment=c, parameter=g)
|
||||
# if '_gbar' in g:
|
||||
# self.channelMap[c][g] = pars[g]*scale
|
||||
# else:
|
||||
# self.channelMap[c][g] = pars[g]
|
||||
#
|
||||
# self.irange = np.linspace(-0.6, 1, 9)
|
||||
|
||||
def get_distancemap(self):
|
||||
return {
|
||||
"dend": {
|
||||
"klt": {"gradient": "exp", "gminf": 0.0, "lambda": 50.0},
|
||||
"kht": {"gradient": "exp", "gminf": 0.0, "lambda": 50.0},
|
||||
"nav11": {"gradient": "exp", "gminf": 0.0, "lambda": 50.0},
|
||||
}, # linear with distance, gminf (factor) is multiplied by gbar
|
||||
"dendrite": {
|
||||
"klt": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
"kht": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
"nav11": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
}, # linear with distance, gminf (factor) is multiplied by gbar
|
||||
"apic": {
|
||||
"klt": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
"kht": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
"nav11": {"gradient": "exp", "gminf": 0.0, "lambda": 200.0},
|
||||
}, # gradients are: flat, linear, exponential
|
||||
}
|
||||
# self.check_temperature()
|
||||
# return
|
||||
#
|
||||
|
||||
#
|
||||
#
|
||||
# if modelType == 'RM03':
|
||||
# #
|
||||
# # Create a model based on the Rothman and Manis 2003 conductance set from guinea pig
|
||||
# #
|
||||
# self.c_m = 0.9E-6 # default in units of F/cm^2
|
||||
# self._valid_temperatures = (22., 38.)
|
||||
# sf = 1.0
|
||||
# if self.status['temperature'] == None:
|
||||
# self.status['temperature'] = 22.
|
||||
# if self.status['temperature'] == 38:
|
||||
# sf = 3.03
|
||||
# dataset = 'RM03_channels'
|
||||
# pars = self.get_cellpars(dataset, species=self.status['species'], celltype='bushy-II')
|
||||
# refarea = 1e-3*pars.cap / self.c_m
|
||||
# self.gBar = Params(nabar=sf*pars.soma_na_gbar/refarea, # 1000.0E-9/refarea,
|
||||
# khtbar=sf*pars.soma_kht_gbar/refarea,
|
||||
# kltbar=sf*pars.soma_klt_gbar/refarea,
|
||||
# ihbar=sf*pars.soma_ih_gbar/refarea,
|
||||
# leakbar=sf*pars.soma_leak_gbar/refarea,
|
||||
# )
|
||||
# print 'RM03 gbar:\n', self.gBar.show()
|
||||
#
|
||||
# self.channelMap = {
|
||||
# 'axon': {'nacn': self.gBar.nabar, 'klt': self.gBar.kltbar, 'kht': self.gBar.khtbar, 'ihvcn': 0.,
|
||||
# 'leak': self.gBar.leakbar / 2.},
|
||||
# 'hillock': {'nacn': self.gBar.nabar, 'klt': self.gBar.kltbar, 'kht': self.gBar.khtbar, 'ihvcn': 0.,
|
||||
# 'leak': self.gBar.leakbar, },
|
||||
# 'initseg': {'nacn': self.gBar.nabar, 'klt': self.gBar.kltbar, 'kht': self.gBar.khtbar,
|
||||
# 'ihvcn': self.gBar.ihbar / 2., 'leak': self.gBar.leakbar, },
|
||||
# 'soma': {'nacn': self.gBar.nabar, 'klt': self.gBar.kltbar, 'kht': self.gBar.khtbar,
|
||||
# 'ihvcn': self.gBar.ihbar, 'leak': self.gBar.leakbar, },
|
||||
# 'dend': {'nacn': self.gBar.nabar, 'klt': self.gBar.kltbar * 0.5, 'kht': self.gBar.khtbar * 0.5,
|
||||
# 'ihvcn': self.gBar.ihbar / 3., 'leak': self.gBar.leakbar * 0.5, },
|
||||
# 'apic': {'nacn': self.gBar.nabar, 'klt': self.gBar.kltbar * 0.2, 'kht': self.gBar.khtbar * 0.2,
|
||||
# 'ihvcn': self.gBar.ihbar / 4., 'leak': self.gBar.leakbar * 0.2, },
|
||||
# }
|
||||
# # self.irange = np.linspace(-1., 1., 21)
|
||||
# self.distMap = {'dend': {'klt': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# 'kht': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# 'nacn': {'gradient': 'exp', 'gminf': 0., 'lambda': 100.}}, # linear with distance, gminf (factor) is multiplied by gbar
|
||||
# 'apic': {'klt': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# 'kht': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# 'nacn': {'gradient': 'exp', 'gminf': 0., 'lambda': 100.}}, # gradients are: flat, linear, exponential
|
||||
# }
|
||||
#
|
||||
# elif modelType == 'XM13':
|
||||
# #
|
||||
# # Create a model for a mouse bushy cell from Xie and Manis, 2013
|
||||
# # based on Cao and Oertel mouse conductance values
|
||||
# # and Rothman and Manis kinetics.
|
||||
# self.c_m = 0.9E-6 # default in units of F/cm^2
|
||||
# self._valid_temperatures = (34., )
|
||||
# if self.status['temperature'] == None:
|
||||
# self.status['temperature'] = 34.
|
||||
# dataset = 'XM13_channels'
|
||||
# pars = self.get_cellpars(dataset, species=self.status['species'], celltype='bushy-II')
|
||||
# refarea = 1e-3*pars.cap / self.c_m
|
||||
# # self.gBar = Params(nabar=pars.soma_nav11_gbar/refarea, # 1000.0E-9/refarea,
|
||||
# # khtbar=pars.soma_kht_gbar/refarea,
|
||||
# # kltbar=pars.soma_klt_gbar/refarea,
|
||||
# # ihbar=pars.soma_ihvcn_gbar/refarea,
|
||||
# # leakbar=pars.soma_leak_gbar/refarea,
|
||||
# # )
|
||||
# # print 'XM13 gbar:\n', self.gBar.show()
|
||||
# # # create channel map:
|
||||
# decorationmap = 'XM13_channels_bycompartment'
|
||||
#
|
||||
# table = data.get_table_info(dataset)
|
||||
# pars = {}
|
||||
# for g in table['field']:
|
||||
# x = data.get(dataset, species=self.status['species'], cell_type='bushy-II',
|
||||
# field=g)
|
||||
# if not isinstance(x, float):
|
||||
# continue
|
||||
# pars[g] = (1./refarea)*data.get(dataset, species=self.status['species'], cell_type='bushy-II',
|
||||
# field=g)
|
||||
# chscale = data.get_table_info(decorationmap)
|
||||
# self.channelMap1 = OrderedDict()
|
||||
# # print chscale['parameter']
|
||||
# for c in chscale['compartment']:
|
||||
# self.channelMap1[c] = {}
|
||||
# for g in pars.keys():
|
||||
# # print g
|
||||
# if g[5:] not in chscale['parameter']:
|
||||
# continue
|
||||
# scale = data.get(decorationmap, species=self.status['species'], cell_type='bushy-II',
|
||||
# compartment=c, parameter=g[5:])
|
||||
# self.channelMap1[c][g] = pars[g]*scale
|
||||
#
|
||||
# #
|
||||
# # self.channelMap = {
|
||||
# # 'unmyelinatedaxon': {'nav11': self.gBar.nabar*1, 'klt': self.gBar.kltbar * 1.0, 'kht': self.gBar.khtbar, 'ihvcn': 0.,
|
||||
# # 'leak': self.gBar.leakbar * 0.25},
|
||||
# # 'hillock': {'nav11': self.gBar.nabar*2, 'klt': self.gBar.kltbar, 'kht': self.gBar.khtbar*2.0, 'ihvcn': 0.,
|
||||
# # 'leak': self.gBar.leakbar, },
|
||||
# # 'initialsegment': {'nav11': self.gBar.nabar*3.0, 'klt': self.gBar.kltbar*1, 'kht': self.gBar.khtbar*2,
|
||||
# # 'ihvcn': self.gBar.ihbar * 0.5, 'leak': self.gBar.leakbar, },
|
||||
# # 'soma': {'nav11': self.gBar.nabar*1.0, 'klt': self.gBar.kltbar, 'kht': self.gBar.khtbar,
|
||||
# # 'ihvcn': self.gBar.ihbar, 'leak': self.gBar.leakbar, },
|
||||
# # 'dend': {'nav11': self.gBar.nabar * 0.25, 'klt': self.gBar.kltbar *0.5, 'kht': self.gBar.khtbar *0.5,
|
||||
# # 'ihvcn': self.gBar.ihbar *0.5, 'leak': self.gBar.leakbar * 0.5, },
|
||||
# # 'primarydendrite': {'nav11': self.gBar.nabar * 0.25, 'klt': self.gBar.kltbar *0.5, 'kht': self.gBar.khtbar *0.5,
|
||||
# # 'ihvcn': self.gBar.ihbar *0.5, 'leak': self.gBar.leakbar * 0.5, },
|
||||
# # 'apic': {'nav11': self.gBar.nabar * 0.25, 'klt': self.gBar.kltbar * 0.25, 'kht': self.gBar.khtbar * 0.25,
|
||||
# # 'ihvcn': self.gBar.ihbar *0.25, 'leak': self.gBar.leakbar * 0.25, },
|
||||
# # }
|
||||
# import pprint
|
||||
# # print 'original map:\n'
|
||||
# # for k in self.channelMap.keys():
|
||||
# # print('Region: %s' % k)
|
||||
# # if k in self.channelMap1.keys():
|
||||
# # print 'overlapping Region: %s' % k
|
||||
# # for ch in self.channelMap[k].keys():
|
||||
# # # print ch
|
||||
# # # print self.channelMap1[k].keys()
|
||||
# # # print self.channelMap[k].keys()
|
||||
# # if 'soma_' + ch + '_gbar' in self.channelMap1[k].keys():
|
||||
# # cx = u'soma_' + ch + u'_gbar'
|
||||
# # # print ch, cx
|
||||
# # print( ' {0:>4s} = {1:e} {2:e} {3:<5s}'.format(ch, self.channelMap[k][ch], self.channelMap1[k][cx],
|
||||
# # str(np.isclose(self.channelMap[k][ch], self.channelMap1[k][cx]))))
|
||||
#
|
||||
# # print 'original: ', self.channelMap['soma']
|
||||
# self.channelMap = self.channelMap1 # use the data table
|
||||
# # except need to remove soma_ from keys
|
||||
# for k in self.channelMap.keys():
|
||||
# for n in self.channelMap[k].keys():
|
||||
# new_key = n.replace('_gbar', '')
|
||||
# # new_key = n
|
||||
# new_key = new_key.replace('soma_', '')
|
||||
# # strip 'soma_' from key
|
||||
# #print 'newkey: ', new_key, n
|
||||
# self.channelMap[k][new_key] = self.channelMap[k].pop(n)
|
||||
#
|
||||
# print 'final map: ', self.channelMap['soma']
|
||||
#
|
||||
# self.irange = np.linspace(-0.6, 1, 9)
|
||||
# self.distMap = {'dend': {'klt': {'gradient': 'exp', 'gminf': 0., 'lambda': 50.},
|
||||
# 'kht': {'gradient': 'exp', 'gminf': 0., 'lambda': 50.},
|
||||
# 'nav11': {'gradient': 'exp', 'gminf': 0., 'lambda': 50.}}, # linear with distance, gminf (factor) is multiplied by gbar
|
||||
# 'dendrite': {'klt': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# 'kht': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# 'nav11': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.}}, # linear with distance, gminf (factor) is multiplied by gbar
|
||||
# 'apic': {'klt': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# 'kht': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# 'nav11': {'gradient': 'exp', 'gminf': 0., 'lambda': 200.}}, # gradients are: flat, linear, exponential
|
||||
# }
|
||||
#
|
||||
# elif modelType == 'mGBC':
|
||||
# # bushy from Xie and Manis, 2013, based on Cao and Oertel mouse conductances,
|
||||
# # BUT modified ad hoc for SBEM reconstructions.
|
||||
# dataset = 'mGBC_channels'
|
||||
#
|
||||
# self._valid_temperatures = (34.,)
|
||||
# if self.status['temperature'] == None:
|
||||
# self.status['temperature'] = 34.
|
||||
# pars = self.get_cellpars(dataset, species=self.status['species'], celltype='bushy-II')
|
||||
# refarea = 1e-3*pars.cap / self.c_m
|
||||
# print (pars.cap, pars.soma_kht_gbar, refarea) # refarea should be about 30e-6
|
||||
#
|
||||
# self.gBar = Params(nabar=pars.soma_na_gbar/refarea, # 1000.0E-9/refarea,
|
||||
# khtbar=pars.soma_kht_gbar/refarea,
|
||||
# kltbar=pars.soma_klt_gbar/refarea,
|
||||
# ihbar=pars.soma_ih_gbar/refarea,
|
||||
# leakbar=pars.soma_leak_gbar/refarea,
|
||||
# )
|
||||
# print 'mGBC gbar:\n', self.gBar.show()
|
||||
# sodiumch = 'jsrna'
|
||||
# self.channelMap = {
|
||||
# 'axon': {sodiumch: self.gBar.nabar*1., 'klt': self.gBar.kltbar * 1.0, 'kht': self.gBar.khtbar, 'ihvcn': 0.,
|
||||
# 'leak': self.gBar.leakbar * 0.25},
|
||||
# 'unmyelinatedaxon': {sodiumch: self.gBar.nabar*3.0, 'klt': self.gBar.kltbar * 2.0,
|
||||
# 'kht': self.gBar.khtbar*3.0, 'ihvcn': 0.,
|
||||
# 'leak': self.gBar.leakbar * 0.25},
|
||||
# 'myelinatedaxon': {sodiumch: self.gBar.nabar*0, 'klt': self.gBar.kltbar * 1e-2,
|
||||
# 'kht': self.gBar.khtbar*1e-2, 'ihvcn': 0.,
|
||||
# 'leak': self.gBar.leakbar * 0.25*1e-3},
|
||||
# 'hillock': {sodiumch: self.gBar.nabar*4.0, 'klt': self.gBar.kltbar*1.0, 'kht': self.gBar.khtbar*3.0,
|
||||
# 'ihvcn': 0., 'leak': self.gBar.leakbar, },
|
||||
# 'initseg': {sodiumch: self.gBar.nabar*3.0, 'klt': self.gBar.kltbar*2, 'kht': self.gBar.khtbar*2,
|
||||
# 'ihvcn': self.gBar.ihbar * 0.5, 'leak': self.gBar.leakbar, },
|
||||
# 'soma': {sodiumch: self.gBar.nabar*0.65, 'klt': self.gBar.kltbar, 'kht': self.gBar.khtbar*1.5,
|
||||
# 'ihvcn': self.gBar.ihbar, 'leak': self.gBar.leakbar, },
|
||||
# 'dend': {sodiumch: self.gBar.nabar * 0.2, 'klt': self.gBar.kltbar *1, 'kht': self.gBar.khtbar *1,
|
||||
# 'ihvcn': self.gBar.ihbar *0.5, 'leak': self.gBar.leakbar * 0.5, },
|
||||
# 'dendrite': {sodiumch: self.gBar.nabar * 0.2, 'klt': self.gBar.kltbar *1, 'kht': self.gBar.khtbar *1,
|
||||
# 'ihvcn': self.gBar.ihbar *0.5, 'leak': self.gBar.leakbar * 0.5, },
|
||||
# 'apic': {sodiumch: self.gBar.nabar * 0.25, 'klt': self.gBar.kltbar * 0.25, 'kht': self.gBar.khtbar * 0.25,
|
||||
# 'ihvcn': self.gBar.ihbar *0.25, 'leak': self.gBar.leakbar * 0.25, },
|
||||
# }
|
||||
# self.irange = np.arange(-1.5, 2.1, 0.25 )
|
||||
# self.distMap = {'dend': {'klt': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# 'kht': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# sodiumch: {'gradient': 'linear', 'gminf': 0., 'lambda': 100.}}, # linear with distance, gminf (factor) is multiplied by gbar
|
||||
# 'dendrite': {'klt': {'gradient': 'linear', 'gminf': 0., 'lambda': 20.},
|
||||
# 'kht': {'gradient': 'linear', 'gminf': 0., 'lambda': 20.},
|
||||
# sodiumch: {'gradient': 'linear', 'gminf': 0., 'lambda': 20.}}, # linear with distance, gminf (factor) is multiplied by gbar
|
||||
# 'apic': {'klt': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# 'kht': {'gradient': 'linear', 'gminf': 0., 'lambda': 100.},
|
||||
# sodiumch: {'gradient': 'exp', 'gminf': 0., 'lambda': 200.}}, # gradients are: flat, linear, exponential
|
||||
# }
|
||||
# else:
|
||||
# raise ValueError('model type %s is not implemented' % modelType)
|
||||
# self.check_temperature()
|
||||
|
||||
def adjust_na_chans(self, soma, sf=1.0, gbar=1000.0):
|
||||
"""
|
||||
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
|
||||
|
||||
Returns
|
||||
-------
|
||||
Nothing :
|
||||
|
||||
"""
|
||||
|
||||
if self.status["ttx"]:
|
||||
gnabar = 0.0
|
||||
else:
|
||||
gnabar = nstomho(gbar, self.somaarea) * sf
|
||||
nach = self.status["na"]
|
||||
if nach == "jsrna":
|
||||
soma().jsrna.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if self.debug:
|
||||
print("jsrna gbar: ", soma().jsrna.gbar)
|
||||
elif nach == "nav11":
|
||||
soma().nav11.gbar = gnabar
|
||||
soma.ena = 50 # self.e_na
|
||||
# print('gnabar: ', soma().nav11.gbar, ' vs: 0.0192307692308')
|
||||
soma().nav11.vsna = 4.3
|
||||
if self.debug:
|
||||
print("bushy using inva11")
|
||||
if nach == "nacncoop":
|
||||
soma().nacncoop.gbar = gnabar
|
||||
soma().nacncoop.KJ = 2000.0
|
||||
soma().nacncoop.p = 0.25
|
||||
somae().nacncoop.vsna = 0.0
|
||||
soma.ena = self.e_na
|
||||
if debug:
|
||||
print("nacncoop gbar: ", soma().nacncoop.gbar)
|
||||
elif nach in ["na", "nacn"]:
|
||||
soma().na.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
# soma().na.vsna = 0.
|
||||
if self.debug:
|
||||
print("na gbar: ", soma().na.gbar)
|
||||
else:
|
||||
raise ValueError(
|
||||
"Sodium channel %s is not recognized for Bushy cells", nach
|
||||
)
|
||||
|
||||
def add_axon(self):
|
||||
"""
|
||||
Add a default axon from the generic cell class to the bushy cell (see cell class).
|
||||
"""
|
||||
Cell.add_axon(self, self.c_m, self.R_a, self.axonsf)
|
||||
|
||||
def add_pumps(self):
|
||||
"""
|
||||
Insert mechanisms for potassium ion management, sodium ion management, and a
|
||||
sodium-potassium pump at the soma.
|
||||
"""
|
||||
soma = self.soma
|
||||
soma.insert("k_conc")
|
||||
|
||||
ki0_k_ion = 140
|
||||
soma().ki = ki0_k_ion
|
||||
soma().ki0_k_conc = ki0_k_ion
|
||||
soma().beta_k_conc = 0.075
|
||||
|
||||
soma.insert("na_conc")
|
||||
nai0_na_ion = 5
|
||||
soma().nai = nai0_na_ion
|
||||
soma().nai0_na_conc = nai0_na_ion
|
||||
soma().beta_na_conc = 0.075
|
||||
|
||||
soma.insert("nakpump")
|
||||
soma().nakpump.inakmax = 8
|
||||
soma().nao = 145
|
||||
soma().ko = 5
|
||||
soma().nakpump.Nai_inf = 5
|
||||
soma().nakpump.Ki_inf = 140
|
||||
soma().nakpump.ATPi = 5
|
||||
self.status["pumps"] = True
|
||||
|
||||
def add_dendrites(self):
|
||||
"""
|
||||
Add a simple dendrite to the bushy cell.
|
||||
"""
|
||||
if self.debug:
|
||||
print("Adding dendrite to Bushy model")
|
||||
section = h.Section
|
||||
primarydendrite = section(cell=self.soma)
|
||||
primarydendrite.connect(self.soma)
|
||||
primarydendrite.nseg = 10
|
||||
primarydendrite.L = 100.0
|
||||
primarydendrite.diam = 2.5
|
||||
primarydendrite.insert("klt")
|
||||
primarydendrite.insert("ihvcn")
|
||||
primarydendrite().klt.gbar = self.soma().klt.gbar / 2.0
|
||||
primarydendrite().ihvcn.gbar = self.soma().ihvcn.gbar / 2.0
|
||||
|
||||
primarydendrite.cm = self.c_m
|
||||
primarydendrite.Ra = self.R_a
|
||||
nsecd = range(0, 5)
|
||||
secondarydendrite = []
|
||||
for ibd in nsecd:
|
||||
secondarydendrite.append(section(cell=self.soma))
|
||||
for ibd in nsecd:
|
||||
secondarydendrite[ibd].connect(primarydendrite)
|
||||
secondarydendrite[ibd].diam = 1.0
|
||||
secondarydendrite[ibd].L = 15.0
|
||||
secondarydendrite[ibd].cm = self.c_m
|
||||
secondarydendrite[ibd].Ra = self.R_a
|
||||
self.primarydendrite = primarydendrite
|
||||
self.secondarydendrite = secondarydendrite
|
||||
self.status["dendrite"] = True
|
||||
if self.debug:
|
||||
print("Bushy: added dendrites")
|
||||
h.topology()
|
||||
self.add_section(maindend, "primarydendrite")
|
||||
self.add_section(secdend, "secondarydendrite")
|
||||
447
cnmodel/cells/cartwheel.py
Normal file
447
cnmodel/cells/cartwheel.py
Normal file
@@ -0,0 +1,447 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
from neuron import h
|
||||
|
||||
from .cell import Cell
|
||||
from .. import data
|
||||
from .. import synapses
|
||||
from ..util import Params
|
||||
from ..util import nstomho
|
||||
|
||||
__all__ = ["Cartwheel", "CartwheelDefault"]
|
||||
|
||||
|
||||
class Cartwheel(Cell):
|
||||
|
||||
type = "cartwheel"
|
||||
|
||||
@classmethod
|
||||
def create(cls, model="CW", **kwds):
|
||||
if model == "CW":
|
||||
return CartwheelDefault(**kwds)
|
||||
else:
|
||||
raise ValueError("Carthweel model is unknown", model)
|
||||
|
||||
def make_psd(self, terminal, psd_type, **kwds):
|
||||
"""
|
||||
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
|
||||
|
||||
"""
|
||||
self.pre_sec = terminal.section
|
||||
pre_cell = terminal.cell
|
||||
post_sec = self.soma
|
||||
|
||||
if psd_type == "simple":
|
||||
if terminal.cell.type in [
|
||||
"sgc",
|
||||
"dstellate",
|
||||
"tuberculoventral",
|
||||
"cartwheel",
|
||||
]:
|
||||
weight = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="weight",
|
||||
)
|
||||
tau1 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau1",
|
||||
)
|
||||
tau2 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau2",
|
||||
)
|
||||
erev = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="erev",
|
||||
)
|
||||
return self.make_exp2_psd(
|
||||
post_sec,
|
||||
terminal,
|
||||
weight=weight,
|
||||
loc=loc,
|
||||
tau1=tau1,
|
||||
tau2=tau2,
|
||||
erev=erev,
|
||||
)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make simple PSD for %s => %s"
|
||||
% (terminal.cell.type, self.type)
|
||||
)
|
||||
|
||||
else:
|
||||
raise ValueError(
|
||||
"Unsupported psd type %s for cartwheel cell (inputs not implemented yet)"
|
||||
% psd_type
|
||||
)
|
||||
|
||||
def make_terminal(self, post_cell, term_type, **kwds):
|
||||
if term_type == "simple":
|
||||
return synapses.SimpleTerminal(self.soma, post_cell, **kwds)
|
||||
elif term_type == "multisite":
|
||||
if post_cell.type in ["tuberculoventral", "pyramidal"]:
|
||||
nzones = data.get(
|
||||
"cartwheel_synapse",
|
||||
species=self.species,
|
||||
post_type=post_cell.type,
|
||||
field="n_rsites",
|
||||
)
|
||||
delay = data.get(
|
||||
"cartwheel_synapse",
|
||||
species=self.species,
|
||||
post_type=post_cell.type,
|
||||
field="delay",
|
||||
)
|
||||
else:
|
||||
raise NotImplementedError(
|
||||
"No knowledge as to how to connect cartwheel cell to cell type %s"
|
||||
% type(post_cell)
|
||||
)
|
||||
pre_sec = self.soma
|
||||
return synapses.StochasticTerminal(
|
||||
pre_sec,
|
||||
post_cell,
|
||||
nzones=nzones,
|
||||
spike_source=self.spike_source,
|
||||
delay=delay,
|
||||
**kwds
|
||||
)
|
||||
else:
|
||||
raise ValueError("Unsupported terminal type %s" % term_type)
|
||||
|
||||
|
||||
class CartwheelDefault(Cartwheel, Cell):
|
||||
"""
|
||||
DCN cartwheel cell model.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
morphology=None,
|
||||
decorator=None,
|
||||
ttx=False,
|
||||
nach=None,
|
||||
species="mouse",
|
||||
modelType=None,
|
||||
debug=False,
|
||||
):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
"""
|
||||
super(CartwheelDefault, self).__init__()
|
||||
if modelType == None:
|
||||
modelType = "I"
|
||||
if nach == None:
|
||||
nach = "naRsg"
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"na": nach,
|
||||
"species": species,
|
||||
"modelType": modelType,
|
||||
"ttx": ttx,
|
||||
"name": "Cartwheel",
|
||||
"morphology": morphology,
|
||||
"decorator": decorator,
|
||||
"temperature": None,
|
||||
}
|
||||
|
||||
self.i_test_range = {"pulse": (-0.2, 0.2, 0.02)}
|
||||
# self.spike_threshold = 0
|
||||
self.vrange = [-75.0, -52.0] # set a default vrange for searching for rmp
|
||||
|
||||
if morphology is None:
|
||||
"""
|
||||
instantiate a basic soma-only ("point") model
|
||||
"""
|
||||
soma = h.Section(
|
||||
name="Cartwheel_Soma_%x" % id(self)
|
||||
) # one compartment of about 29000 um2
|
||||
# cm = 1
|
||||
soma.nseg = 1
|
||||
self.add_section(soma, "soma")
|
||||
else:
|
||||
"""
|
||||
instantiate a structured model with the morphology as specified by
|
||||
the morphology file
|
||||
"""
|
||||
self.set_morphology(morphology_file=morphology)
|
||||
|
||||
# decorate the morphology with ion channels
|
||||
if decorator is None: # basic model, only on the soma
|
||||
# v_potassium = -80 # potassium reversal potential
|
||||
# v_sodium = 50 # sodium reversal potential
|
||||
|
||||
self.mechanisms = [
|
||||
"naRsg",
|
||||
"bkpkj",
|
||||
"hpkj",
|
||||
"kpkj",
|
||||
"kpkj2",
|
||||
"kpkjslow",
|
||||
"kpksk",
|
||||
"lkpkj",
|
||||
"cap",
|
||||
]
|
||||
for mech in self.mechanisms:
|
||||
self.soma.insert(mech)
|
||||
self.soma.insert("cadiff")
|
||||
self.species_scaling(
|
||||
silent=True, species=species, modelType=modelType
|
||||
) # set the default type II cell parameters
|
||||
else: # decorate according to a defined set of rules on all cell compartments
|
||||
self.decorate()
|
||||
self.save_all_mechs() # save all mechanisms inserted, location and gbar values...
|
||||
self.get_mechs(self.soma)
|
||||
|
||||
if debug:
|
||||
print(
|
||||
"<< Cartwheel: Modified version of Raman Purkinje cell model created >>"
|
||||
)
|
||||
|
||||
def get_cellpars(self, dataset, species="guineapig", celltype="II"):
|
||||
somaDia = data.get(
|
||||
dataset, species=species, cell_type=celltype, field="soma_Dia"
|
||||
)
|
||||
chtype = data.get(
|
||||
dataset, species=species, cell_type=celltype, field="soma_na_type"
|
||||
)
|
||||
pcabar = data.get(
|
||||
dataset, species=species, cell_type=celltype, field="soma_pcabar"
|
||||
)
|
||||
pars = Params(soma_Dia=somaDia, soma_natype=chtype, soma_pcabar=pcabar)
|
||||
for g in [
|
||||
"soma_narsg_gbar",
|
||||
"soma_kpkj_gbar",
|
||||
"soma_kpkj2_gbar",
|
||||
"soma_kpkjslow_gbar",
|
||||
"soma_kpksk_gbar",
|
||||
"soma_lkpkj_gbar",
|
||||
"soma_bkpkj_gbar",
|
||||
"soma_hpkj_gbar",
|
||||
"soma_hpkj_eh",
|
||||
"soma_lkpkj_e",
|
||||
"soma_e_k",
|
||||
"soma_e_na",
|
||||
"soma_e_ca",
|
||||
]:
|
||||
pars.additem(
|
||||
g, data.get(dataset, species=species, cell_type=celltype, field=g)
|
||||
)
|
||||
return pars
|
||||
|
||||
def species_scaling(self, silent=True, species="mouse", modelType="I"):
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
if species is not "mouse":
|
||||
raise ValueError('Cartwheel species: only "mouse" is recognized')
|
||||
if modelType is not "I":
|
||||
raise ValueError('Cartwheel modelType: only "I" is recognized')
|
||||
self._valid_temperatures = (34.0,)
|
||||
if self.status["temperature"] is None:
|
||||
self.set_temperature(34.0)
|
||||
|
||||
pars = self.get_cellpars("CW_channels", species=species, celltype="cartwheel")
|
||||
self.set_soma_size_from_Diam(pars.soma_Dia)
|
||||
self.soma().bkpkj.gbar = nstomho(pars.soma_bkpkj_gbar, self.somaarea)
|
||||
self.soma().hpkj.gbar = nstomho(pars.soma_hpkj_gbar, self.somaarea)
|
||||
self.soma().kpkj.gbar = nstomho(pars.soma_kpkj_gbar, self.somaarea)
|
||||
self.soma().kpkj2.gbar = nstomho(pars.soma_kpkj2_gbar, self.somaarea)
|
||||
self.soma().kpkjslow.gbar = nstomho(pars.soma_kpkjslow_gbar, self.somaarea)
|
||||
self.soma().kpksk.gbar = nstomho(pars.soma_kpksk_gbar, self.somaarea)
|
||||
self.soma().lkpkj.gbar = nstomho(pars.soma_lkpkj_gbar, self.somaarea)
|
||||
self.soma().naRsg.gbar = nstomho(pars.soma_narsg_gbar, self.somaarea)
|
||||
self.soma().cap.pcabar = pars.soma_pcabar
|
||||
self.soma().ena = pars.soma_e_na # 50
|
||||
self.soma().ek = pars.soma_e_k # -80
|
||||
self.soma().lkpkj.e = pars.soma_lkpkj_e # -65
|
||||
self.soma().hpkj.eh = pars.soma_hpkj_eh # -43
|
||||
self.soma().eca = pars.soma_e_ca # 50
|
||||
|
||||
self.status["na"] = pars.soma_natype
|
||||
self.status["species"] = species
|
||||
self.status["modelType"] = modelType
|
||||
self.check_temperature()
|
||||
if not silent:
|
||||
print("set cell as: ", species)
|
||||
print(" with Vm rest = %f" % self.vm0)
|
||||
|
||||
# print 'set up'
|
||||
|
||||
def i_currents(self, V):
|
||||
"""
|
||||
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 : float, nA
|
||||
The sum of the currents at steady-state for all of the conductances.
|
||||
"""
|
||||
for part in self.all_sections.keys():
|
||||
for sec in self.all_sections[part]:
|
||||
sec.v = V
|
||||
h.celsius = self.status["temperature"]
|
||||
h.finitialize()
|
||||
self.ix = {}
|
||||
|
||||
if "naRsg" in self.mechanisms:
|
||||
self.ix["naRsg"] = self.soma().naRsg.gna * (V - self.soma().ena)
|
||||
if "cap" in self.mechanisms:
|
||||
a = self.soma().cap.pcabar * self.soma().cap.minf
|
||||
self.ix["cap"] = a * self.ghk(V, self.soma().cao, self.soma().cai, 2)
|
||||
if "kpkj" in self.mechanisms:
|
||||
self.ix["kpkj"] = self.soma().kpkj.gk * (V - self.soma().ek)
|
||||
if "kpkj2" in self.mechanisms:
|
||||
self.ix["kpkj2"] = self.soma().kpkj2.gk * (V - self.soma().ek)
|
||||
if "kpkjslow" in self.mechanisms:
|
||||
self.ix["kpkjslow"] = self.soma().kpkjslow.gk * (V - self.soma().ek)
|
||||
if "kpksk" in self.mechanisms:
|
||||
self.ix["kpksk"] = self.soma().kpksk.gk * (V - self.soma().ek)
|
||||
if "bkpkj" in self.mechanisms:
|
||||
self.ix["bkpkj"] = self.soma().bkpkj.gbkpkj * (V - self.soma().ek)
|
||||
if "hpkj" in self.mechanisms:
|
||||
self.ix["hpkj"] = self.soma().hpkj.gh * (V - self.soma().hpkj.eh)
|
||||
# leak
|
||||
if "lkpkj" in self.mechanisms:
|
||||
self.ix["lkpkj"] = self.soma().lkpkj.gbar * (V - self.soma().lkpkj.e)
|
||||
return np.sum([self.ix[i] for i in self.ix])
|
||||
|
||||
def ghk(self, v, ci, co, z):
|
||||
"""
|
||||
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 : A/m^2
|
||||
|
||||
"""
|
||||
F = 9.6485e4 # (coul)
|
||||
R = 8.3145 # (joule/degC)
|
||||
T = h.celsius + 273.19 # Kelvin
|
||||
E = (1e-3) * v # convert mV to V
|
||||
Ci = ci + (self.soma().cap.monovalPerm) * (
|
||||
self.soma().cap.monovalConc
|
||||
) # : Monovalent permeability
|
||||
if (
|
||||
np.fabs(1 - np.exp(-z * (F * E) / (R * T))) < 1e-6
|
||||
): # denominator is small -> Taylor series
|
||||
ghk = (
|
||||
(1e-6)
|
||||
* z
|
||||
* F
|
||||
* (Ci - co * np.exp(-z * (F * E) / (R * T)))
|
||||
* (1 - (z * (F * E) / (R * T)))
|
||||
)
|
||||
else:
|
||||
ghk = (
|
||||
(1e-6)
|
||||
* z ** 2.0
|
||||
* (E * F ** 2.0)
|
||||
/ (R * T)
|
||||
* (Ci - co * np.exp(-z * (F * E) / (R * T)))
|
||||
/ (1 - np.exp(-z * (F * E) / (R * T)))
|
||||
)
|
||||
return ghk
|
||||
1200
cnmodel/cells/cell.py
Normal file
1200
cnmodel/cells/cell.py
Normal file
File diff suppressed because it is too large
Load Diff
897
cnmodel/cells/dstellate.py
Normal file
897
cnmodel/cells/dstellate.py
Normal file
@@ -0,0 +1,897 @@
|
||||
from __future__ import print_function
|
||||
from neuron import h
|
||||
from ..util import nstomho
|
||||
from .cell import Cell
|
||||
from ..util import Params
|
||||
from .. import synapses
|
||||
from .. import data
|
||||
|
||||
__all__ = ["DStellate", "DStellateRothman", "DStellateEager"]
|
||||
|
||||
|
||||
class DStellate(Cell):
|
||||
|
||||
type = "dstellate"
|
||||
|
||||
@classmethod
|
||||
def create(cls, model="RM03", **kwds):
|
||||
if model == "RM03":
|
||||
return DStellateRothman(**kwds)
|
||||
elif model == "Eager":
|
||||
return DStellateEager(**kwds)
|
||||
elif model == "dummy":
|
||||
return DummyDStellate(**kwds)
|
||||
else:
|
||||
raise ValueError("DStellate type %s is unknown", type)
|
||||
|
||||
def __init__(self):
|
||||
Cell.__init__(self)
|
||||
self.spike_source = (
|
||||
None
|
||||
) # used by DummyDStellate to connect VecStim to terminal
|
||||
|
||||
def make_psd(self, terminal, psd_type, **kwds):
|
||||
"""
|
||||
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
|
||||
|
||||
"""
|
||||
if (
|
||||
"postsite" in kwds
|
||||
): # use a defined location instead of the default (soma(0.5)
|
||||
postsite = kwds["postsite"]
|
||||
loc = postsite[1] # where on the section?
|
||||
uname = (
|
||||
"sections[%d]" % postsite[0]
|
||||
) # make a name to look up the neuron section object
|
||||
post_sec = self.hr.get_section(uname) # Tell us where to put the synapse.
|
||||
else:
|
||||
loc = 0.5
|
||||
post_sec = self.soma
|
||||
|
||||
if psd_type == "simple":
|
||||
if terminal.cell.type in ["sgc", "dstellate", "tuberculoventral"]:
|
||||
weight = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="weight",
|
||||
)
|
||||
tau1 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau1",
|
||||
)
|
||||
tau2 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau2",
|
||||
)
|
||||
erev = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="erev",
|
||||
)
|
||||
return self.make_exp2_psd(
|
||||
post_sec,
|
||||
terminal,
|
||||
weight=weight,
|
||||
loc=loc,
|
||||
tau1=tau1,
|
||||
tau2=tau2,
|
||||
erev=erev,
|
||||
)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make simple PSD for %s => %s"
|
||||
% (terminal.cell.type, self.type)
|
||||
)
|
||||
|
||||
elif psd_type == "multisite":
|
||||
if terminal.cell.type == "sgc":
|
||||
# Max conductances for the glu mechanisms are calibrated by
|
||||
# running `synapses/tests/test_psd.py`. The test should fail
|
||||
# if these values are incorrect
|
||||
self.AMPAR_gmax = (
|
||||
data.get(
|
||||
"sgc_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="AMPAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.NMDAR_gmax = (
|
||||
data.get(
|
||||
"sgc_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="NMDAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.Pr = data.get(
|
||||
"sgc_synapse", species=self.species, post_type=self.type, field="Pr"
|
||||
)
|
||||
# adjust gmax to correct for initial Pr
|
||||
self.AMPAR_gmax = self.AMPAR_gmax / self.Pr
|
||||
self.NMDAR_gmax = self.NMDAR_gmax / self.Pr
|
||||
# old values:
|
||||
# AMPA_gmax = 0.22479596944138733*1e3 # factor of 1e3 scales to pS (.mod mechanisms) from nS.
|
||||
# NMDA_gmax = 0.12281291946623739*1e3
|
||||
if "AMPAScale" in kwds:
|
||||
self.AMPAR_gmax = (
|
||||
self.AMPAR_gmax * kwds["AMPAScale"]
|
||||
) # allow scaling of AMPA conductances
|
||||
if "NMDAScale" in kwds:
|
||||
self.NMDAR_gmax = self.NMDAR_gmax * kwds["NMDAScale"]
|
||||
return self.make_glu_psd(
|
||||
post_sec, terminal, self.AMPAR_gmax, self.NMDAR_gmax, loc=loc
|
||||
)
|
||||
|
||||
elif terminal.cell.type == "dstellate":
|
||||
# Get GLY kinetic constants from database
|
||||
return self.make_gly_psd(post_sec, terminal, psdtype="glyfast", loc=loc)
|
||||
elif terminal.cell.type == "tuberculoventral":
|
||||
# Get GLY kinetic constants from database
|
||||
return self.make_gly_psd(post_sec, terminal, psdtype="glyfast", loc=loc)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make PSD for %s => %s" % (terminal.cell.type, self.type)
|
||||
)
|
||||
else:
|
||||
raise ValueError("Unsupported psd type %s" % psd_type)
|
||||
|
||||
def make_terminal(self, post_cell, term_type, **kwds):
|
||||
if term_type == "simple":
|
||||
return synapses.SimpleTerminal(
|
||||
self.soma, post_cell, spike_source=self.spike_source, **kwds
|
||||
)
|
||||
elif term_type == "multisite":
|
||||
if post_cell.type in [
|
||||
"dstellate",
|
||||
"tuberculoventral",
|
||||
"pyramidal",
|
||||
"bushy",
|
||||
"tstellate",
|
||||
]:
|
||||
nzones = data.get(
|
||||
"dstellate_synapse",
|
||||
species=self.species,
|
||||
post_type=post_cell.type,
|
||||
field="n_rsites",
|
||||
)
|
||||
delay = data.get(
|
||||
"dstellate_synapse",
|
||||
species=self.species,
|
||||
post_type=post_cell.type,
|
||||
field="delay",
|
||||
)
|
||||
else:
|
||||
raise NotImplementedError(
|
||||
"No knowledge as to how to connect D stellate cell to cell type %s"
|
||||
% type(post_cell)
|
||||
)
|
||||
pre_sec = self.soma
|
||||
return synapses.StochasticTerminal(
|
||||
pre_sec,
|
||||
post_cell,
|
||||
nzones=nzones,
|
||||
spike_source=self.spike_source,
|
||||
delay=delay,
|
||||
**kwds
|
||||
)
|
||||
else:
|
||||
raise ValueError("Unsupported terminal type %s" % term_type)
|
||||
|
||||
|
||||
class DStellateRothman(DStellate):
|
||||
"""
|
||||
VCN D-stellate model:
|
||||
as a type I-II from Rothman and Manis, 2003
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
morphology=None,
|
||||
decorator=None,
|
||||
nach=None,
|
||||
ttx=False,
|
||||
species="guineapig",
|
||||
modelType=None,
|
||||
modelName=None,
|
||||
debug=False,
|
||||
):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
"""
|
||||
|
||||
super(DStellateRothman, self).__init__()
|
||||
if modelType == None:
|
||||
modelType = "I-II"
|
||||
if species == "guineapig":
|
||||
modelName = "RM03"
|
||||
temp = 22.0
|
||||
if nach == None:
|
||||
nach = "nacn"
|
||||
if species == "mouse":
|
||||
temp = 34.0
|
||||
if modelName is None:
|
||||
modelName = "XM13"
|
||||
if nach is None:
|
||||
nach = "na"
|
||||
self.debug = debug
|
||||
# if modelType == None: # allow us to pass None to get the default
|
||||
# modelType = 'I-II'
|
||||
# if nach == None:
|
||||
# nach = 'na'
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"na": nach,
|
||||
"species": species,
|
||||
"modelType": modelType,
|
||||
"modelName": modelName,
|
||||
"ttx": ttx,
|
||||
"name": "DStellate",
|
||||
"morphology": morphology,
|
||||
"decorator": decorator,
|
||||
"temperature": None,
|
||||
}
|
||||
self.i_test_range = {
|
||||
"pulse": [(-0.3, 0.3, 0.03), (-0.05, 0.0, 0.005)]
|
||||
} # set range for ic command test
|
||||
self.vrange = [-75.0, -55.0]
|
||||
self.spike_threshold = (
|
||||
-40.0
|
||||
) # matches threshold in released CNModel (set in base cell class)
|
||||
|
||||
if morphology is None:
|
||||
"""
|
||||
instantiate a basic soma-only ("point") model
|
||||
"""
|
||||
soma = h.Section(
|
||||
name="DStellate_Soma_%x" % id(self)
|
||||
) # one compartment of about 29000 um2
|
||||
soma.nseg = 1
|
||||
self.add_section(soma, "soma")
|
||||
else:
|
||||
"""
|
||||
instantiate a structured model with the morphology as specified by
|
||||
the morphology file
|
||||
"""
|
||||
self.set_morphology(morphology_file=morphology)
|
||||
|
||||
# decorate the morphology with ion channels
|
||||
if decorator is None: # basic model, only on the soma
|
||||
self.mechanisms = ["klt", "kht", "ihvcn", "leak", nach]
|
||||
for mech in self.mechanisms:
|
||||
self.soma.insert(mech)
|
||||
self.soma.ena = self.e_na
|
||||
self.soma.ek = self.e_k
|
||||
self.soma().leak.erev = self.e_leak
|
||||
self.c_m = 0.9
|
||||
self.set_soma_size_from_Cm(12.0)
|
||||
self.species_scaling(
|
||||
silent=True, species=species, modelType=modelType
|
||||
) # set the default type II cell parameters
|
||||
else: # decorate according to a defined set of rules on all cell compartments
|
||||
self.decorate()
|
||||
self.save_all_mechs() # save all mechanisms inserted, location and gbar values...
|
||||
self.get_mechs(self.soma)
|
||||
|
||||
if self.debug:
|
||||
print("<< D-stellate: JSR Stellate Type I-II cell model created >>")
|
||||
|
||||
def get_cellpars(self, dataset, species="guineapig", modelType="I-II"):
|
||||
cellcap = data.get(
|
||||
dataset, species=species, model_type=modelType, field="soma_Cap"
|
||||
)
|
||||
chtype = data.get(
|
||||
dataset, species=species, model_type=modelType, field="na_type"
|
||||
)
|
||||
pars = Params(cap=cellcap, natype=chtype)
|
||||
# pars.show()
|
||||
|
||||
if self.status["modelName"] == "RM03":
|
||||
for g in [
|
||||
"%s_gbar" % pars.natype,
|
||||
"kht_gbar",
|
||||
"klt_gbar",
|
||||
"ka_gbar",
|
||||
"ih_gbar",
|
||||
"leak_gbar",
|
||||
"leak_erev",
|
||||
"ih_eh",
|
||||
"e_k",
|
||||
"e_na",
|
||||
]:
|
||||
pars.additem(
|
||||
g, data.get(dataset, species=species, model_type=modelType, field=g)
|
||||
)
|
||||
if self.status["modelName"] == "XM13":
|
||||
for g in [
|
||||
"%s_gbar" % pars.natype,
|
||||
"kht_gbar",
|
||||
"klt_gbar",
|
||||
"ka_gbar",
|
||||
"ihvcn_gbar",
|
||||
"leak_gbar",
|
||||
"leak_erev",
|
||||
"ih_eh",
|
||||
"e_k",
|
||||
"e_na",
|
||||
]:
|
||||
pars.additem(
|
||||
g, data.get(dataset, species=species, model_type=modelType, field=g)
|
||||
)
|
||||
if self.status["modelName"] == "mGBC":
|
||||
for g in [
|
||||
"%s_gbar" % pars.natype,
|
||||
"kht_gbar",
|
||||
"klt_gbar",
|
||||
"ka_gbar",
|
||||
"ihvcn_gbar",
|
||||
"leak_gbar",
|
||||
"leak_erev",
|
||||
]:
|
||||
pars.additem(
|
||||
g, data.get(dataset, species=species, model_type=modelType, field=g)
|
||||
)
|
||||
return pars
|
||||
|
||||
def species_scaling(self, species="guineapig", modelType="I-II", silent=True):
|
||||
"""
|
||||
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.
|
||||
|
||||
"""
|
||||
soma = self.soma
|
||||
celltype = modelType
|
||||
if species == "mouse":
|
||||
# use conductance levels from Cao et al., J. Neurophys., 2007.
|
||||
dataset = "XM13_channels"
|
||||
self._valid_temperatures = (34.0,)
|
||||
if self.status["temperature"] is None:
|
||||
self.set_temperature(34.0)
|
||||
self.c_m = 0.9
|
||||
pars = self.get_cellpars(dataset, species=species, modelType=modelType)
|
||||
self.set_soma_size_from_Cm(pars.cap)
|
||||
self.status["na"] = pars.natype
|
||||
# pars.show()
|
||||
self.adjust_na_chans(soma, gbar=pars.na_gbar, sf=1.0)
|
||||
soma().kht.gbar = nstomho(pars.kht_gbar, self.somaarea)
|
||||
soma().klt.gbar = nstomho(pars.klt_gbar, self.somaarea)
|
||||
# soma().ka.gbar = nstomho(pars.ka_gbar, self.somaarea)
|
||||
soma().ihvcn.gbar = nstomho(pars.ihvcn_gbar, self.somaarea)
|
||||
soma().ihvcn.eh = pars.ih_eh # Rodrigues and Oertel, 2006
|
||||
soma().leak.gbar = nstomho(pars.leak_gbar, self.somaarea)
|
||||
soma().leak.erev = pars.leak_erev
|
||||
self.e_k = pars.e_k
|
||||
self.e_na = pars.e_na
|
||||
soma.ena = self.e_na
|
||||
soma.ek = self.e_k
|
||||
# soma().leak.erev = pars.leak_erev
|
||||
self.axonsf = 0.5
|
||||
|
||||
elif species == "guineapig": # values from R&M 2003, Type II-I
|
||||
dataset = "RM03_channels"
|
||||
self.c_m = 0.9
|
||||
self._valid_temperatures = (22.0, 38.0)
|
||||
if self.status["temperature"] is None:
|
||||
self.set_temperature(22.0)
|
||||
sf = 1.0
|
||||
if (
|
||||
self.status["temperature"] == 38.0
|
||||
): # adjust for 2003 model conductance levels at 38
|
||||
sf = 3.03 # Q10 of 2, 22->38C. (p3106, R&M2003c)
|
||||
self.i_test_range = {"pulse": (-0.3, 0.3, 0.03)}
|
||||
self.vrange = [-75.0, -55.0]
|
||||
pars = self.get_cellpars(dataset, species=species, modelType=modelType)
|
||||
self.set_soma_size_from_Cm(pars.cap)
|
||||
self.status["na"] = pars.natype
|
||||
# pars.show()
|
||||
self.adjust_na_chans(soma, gbar=pars.nacn_gbar, sf=sf)
|
||||
soma().kht.gbar = nstomho(pars.kht_gbar, self.somaarea)
|
||||
soma().klt.gbar = nstomho(pars.klt_gbar, self.somaarea)
|
||||
# soma().ka.gbar = nstomho(pars.ka_gbar, self.somaarea)
|
||||
soma().ihvcn.gbar = nstomho(pars.ih_gbar, self.somaarea)
|
||||
soma().leak.gbar = nstomho(pars.leak_gbar, self.somaarea)
|
||||
soma().leak.erev = pars.leak_erev
|
||||
self.axonsf = 0.5
|
||||
|
||||
else:
|
||||
raise ValueError(
|
||||
"Species %s or species-modelType %s is not recognized for D-Stellate cells"
|
||||
% (species, modelType)
|
||||
)
|
||||
self.status["species"] = species
|
||||
self.status["modelType"] = modelType
|
||||
self.check_temperature()
|
||||
# self.cell_initialize(showinfo=False)
|
||||
if not silent:
|
||||
print("set cell as: ", species)
|
||||
print(" with Vm rest = %6.3f" % self.vm0)
|
||||
|
||||
def adjust_na_chans(self, soma, sf=1.0, gbar=1000.0):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
"""
|
||||
if self.status["ttx"]:
|
||||
gnabar = 0.0
|
||||
else:
|
||||
gnabar = nstomho(gbar, self.somaarea) * sf
|
||||
nach = self.status["na"]
|
||||
if nach == "jsrna":
|
||||
soma().jsrna.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if self.debug:
|
||||
print("jsrna gbar: ", soma().jsrna.gbar)
|
||||
elif nach == "nav11":
|
||||
soma().nav11.gbar = gnabar * 0.5
|
||||
soma.ena = self.e_na
|
||||
soma().nav11.vsna = 4.3
|
||||
if self.debug:
|
||||
print("bushy using inva11")
|
||||
print("nav11 gbar: ", soma().nav11.gbar)
|
||||
elif nach == "na":
|
||||
soma().na.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if self.debug:
|
||||
print("na gbar: ", soma().na.gbar)
|
||||
elif nach == "nacn":
|
||||
soma().nacn.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if self.debug:
|
||||
print("nacn gbar: ", soma().nacn.gbar)
|
||||
else:
|
||||
raise ValueError(
|
||||
"Dstellate setting Na channels: channel %s not known" % nach
|
||||
)
|
||||
|
||||
def add_axon(self):
|
||||
"""
|
||||
Add a default axon from the generic cell class to the bushy cell (see cell class).
|
||||
"""
|
||||
Cell.add_axon(self, self.soma, self.somaarea, self.c_m, self.R_a, self.axonsf)
|
||||
|
||||
def add_dendrites(self):
|
||||
"""
|
||||
Add simple unbranched dendrites to basic Rothman Type I-II model.
|
||||
The dendrites have some kht and ih current
|
||||
"""
|
||||
cs = False # not implemented outside here - internal Cesium.
|
||||
nDend = range(4) # these will be simple, unbranced, N=4 dendrites
|
||||
dendrites = []
|
||||
for i in nDend:
|
||||
dendrites.append(h.Section(cell=self.soma))
|
||||
for i in nDend:
|
||||
dendrites[i].connect(self.soma)
|
||||
dendrites[i].L = 300 # length of the dendrite (not tapered)
|
||||
dendrites[i].diam = 1.25 # dendrite diameter
|
||||
dendrites[i].nseg = 21 # # segments in dendrites
|
||||
dendrites[i].Ra = 150 # ohm.cm
|
||||
dendrites[i].insert("kht")
|
||||
if cs is False:
|
||||
dendrites[i]().kht.gbar = 0.005 # a little Ht
|
||||
else:
|
||||
dendrites[i]().kht.gbar = 0.0
|
||||
dendrites[i].insert("leak") # leak
|
||||
dendrites[i]().leak.gbar = 0.0001
|
||||
dendrites[i].insert("ihvcn") # some H current
|
||||
dendrites[i]().ihvcn.gbar = 0.0 # 0.001
|
||||
dendrites[i]().ihvcn.eh = -43.0
|
||||
self.maindend = dendrites
|
||||
self.status["dendrites"] = True
|
||||
self.add_section(self.maindend, "maindend")
|
||||
|
||||
|
||||
class DummyDStellate(DStellate):
|
||||
""" DStellate class with no cell body; this cell only replays a predetermined
|
||||
spike train. Useful for testing, or replacing spike trains to determine
|
||||
the importance of spike structures within a network.
|
||||
"""
|
||||
|
||||
def __init__(self, cf=None, species="mouse"):
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
cf : float (default: None)
|
||||
Required: the characteristic frequency for the DStellate
|
||||
Really just for reference.
|
||||
|
||||
"""
|
||||
|
||||
DStellate.__init__(self)
|
||||
self.vecstim = h.VecStim()
|
||||
|
||||
# this causes the terminal to receive events from the VecStim:
|
||||
self.spike_source = self.vecstim
|
||||
|
||||
# just an empty section for holding the terminal
|
||||
self.add_section(h.Section(), "soma")
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"na": None,
|
||||
"species": species,
|
||||
"modelType": "Dummy",
|
||||
"modelName": "DummyDStellate",
|
||||
"ttx": None,
|
||||
"name": "DummyDStellate",
|
||||
"morphology": None,
|
||||
"decorator": None,
|
||||
"temperature": None,
|
||||
}
|
||||
print("<< DStellate: Dummy DStellate Cell created >>")
|
||||
|
||||
def set_spiketrain(self, times):
|
||||
""" Set the times of spikes (in seconds) to be replayed by the cell.
|
||||
"""
|
||||
self._spiketrain = times
|
||||
self._stvec = h.Vector(times)
|
||||
self.vecstim.play(self._stvec)
|
||||
|
||||
|
||||
class DStellateEager(DStellate):
|
||||
"""
|
||||
This 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
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self, nach="na", ttx=False, species="guineapig", modelType="I-II", debug=False
|
||||
):
|
||||
"""
|
||||
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.
|
||||
|
||||
"""
|
||||
super(DStellateEager, self).__init__()
|
||||
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"na": nach,
|
||||
"species": species,
|
||||
"modelType": modelType,
|
||||
"ttx": ttx,
|
||||
"name": "DStellateEager",
|
||||
}
|
||||
self.i_test_range = (-0.25, 0.25, 0.025) # set range for ic command test
|
||||
|
||||
soma = h.Section(name="DStellateEager_Soma_%x" % id(self)) # one compartment
|
||||
|
||||
soma.nseg = 1
|
||||
|
||||
if nach in ["nacn", "na"]:
|
||||
soma.insert("na")
|
||||
elif nach == "nav11":
|
||||
soma.insert("nav11")
|
||||
elif nach == "jsrna":
|
||||
soma.insert("jsrna")
|
||||
else:
|
||||
raise ValueError("Sodium channel %s in type 1 cell not known" % nach)
|
||||
self.debug = debug
|
||||
soma.insert("kht")
|
||||
soma.insert("klt")
|
||||
soma.insert("ihvcn")
|
||||
soma.insert("leak")
|
||||
soma.ek = self.e_k
|
||||
soma().leak.erev = self.e_leak
|
||||
self.mechanisms = ["kht", "klt", "ihvcn", "leak", nach]
|
||||
self.add_section(soma, "soma")
|
||||
self.species_scaling(
|
||||
silent=False, species=species, modelType=modelType
|
||||
) # set the default type II cell parameters
|
||||
self.add_axon() # must follow species scaling so that area parameters are available
|
||||
self.add_dendrites() # similar for dendrites
|
||||
self.save_all_mechs() # save all mechanisms inserted, location and gbar values...
|
||||
self.get_mechs(soma)
|
||||
|
||||
if self.debug:
|
||||
print("<< D-stellateEager: Eager DStellate Type I-II cell model created >>")
|
||||
|
||||
def species_scaling(self, species="guineapig", modelType="I-II", silent=True):
|
||||
"""
|
||||
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.
|
||||
|
||||
"""
|
||||
soma = self.soma
|
||||
if species == "mouse" and modelType == "I-II":
|
||||
# use conductance levels from Cao et al., J. Neurophys., 2007.
|
||||
self.set_soma_size_from_Cm(25.0)
|
||||
self.adjust_na_chans(soma, gbar=800.0)
|
||||
soma().kht.gbar = nstomho(150.0, self.somaarea)
|
||||
soma().klt.gbar = nstomho(20.0, self.somaarea)
|
||||
soma().ihvcn.gbar = nstomho(2.0, self.somaarea)
|
||||
soma().ihvcn.eh = -43 # Rodrigues and Oertel, 2006
|
||||
soma().leak.gbar = nstomho(2.0, self.somaarea)
|
||||
self.axonsf = 0.5
|
||||
elif (
|
||||
species == "guineapig" and modelType == "I-II"
|
||||
): # values from R&M 2003, Type II-I
|
||||
self.set_soma_size_from_Diam(25.0)
|
||||
self.adjust_na_chans(soma, gbar=1000.0 * 0.75)
|
||||
soma().kht.gbar = 0.02 # nstomho(150.0, self.somaarea)
|
||||
soma().klt.gbar = 0.005 # nstomho(20.0, self.somaarea)
|
||||
soma().ihvcn.gbar = 0.0002 # nstomho(2.0, self.somaarea)
|
||||
soma().leak.gbar = 0.0005 # nstomho(2.0, self.somaarea)
|
||||
self.axonsf = 1.0
|
||||
elif (
|
||||
species == "cat" and modelType == "I=II"
|
||||
): # a cat is a big guinea pig Type I
|
||||
self.set_soma_size_from_Cm(35.0)
|
||||
self.adjust_na_chans(soma)
|
||||
soma().kht.gbar = nstomho(150.0, self.somaarea)
|
||||
soma().klt.gbar = nstomho(20.0, self.somaarea)
|
||||
soma().ihvcn.gbar = nstomho(2.0, self.somaarea)
|
||||
soma().leak.gbar = nstomho(2.0, self.somaarea)
|
||||
self.axonsf = 1.0
|
||||
else:
|
||||
raise ValueError(
|
||||
"Species %s or species-type %s is not recognized for D-StellateEager cells"
|
||||
% (species, type)
|
||||
)
|
||||
self.status["species"] = species
|
||||
self.status["type"] = modelType
|
||||
self.cell_initialize(showinfo=True)
|
||||
if not silent:
|
||||
print(" set cell as: ", species)
|
||||
print(" with Vm rest = %6.3f" % self.vm0)
|
||||
|
||||
def adjust_na_chans(self, soma, gbar=1000.0):
|
||||
"""
|
||||
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
|
||||
|
||||
Returns
|
||||
-------
|
||||
Nothing
|
||||
"""
|
||||
|
||||
if self.status["ttx"]:
|
||||
gnabar = 0.0
|
||||
else:
|
||||
gnabar = nstomho(gbar, self.somaarea)
|
||||
nach = self.status["na"]
|
||||
if nach == "jsrna":
|
||||
soma().jsrna.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if self.debug:
|
||||
print("using jsrna with gbar: ", soma().jsrna.gbar)
|
||||
elif nach == "nav11":
|
||||
soma().nav11.gbar = gnabar * 0.5
|
||||
soma.ena = self.e_na
|
||||
soma().nav11.vsna = 4.3
|
||||
if self.debug:
|
||||
print("using inva11 with gbar:", soma().na.gbar)
|
||||
print("nav11 gbar: ", soma().nav11.gbar)
|
||||
elif nach == "na":
|
||||
soma().na.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if self.debug:
|
||||
print("using na with gbar: ", soma().na.gbar)
|
||||
elif nach == "nach":
|
||||
soma().nach.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if self.debug:
|
||||
print(("uwing nacn with gbar: ", soma().nacn.gbar))
|
||||
else:
|
||||
raise ValueError(
|
||||
"DstellateEager setting Na channels: channel %s not known" % nach
|
||||
)
|
||||
# print soma().na.gbar
|
||||
|
||||
def add_axon(self):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
"""
|
||||
|
||||
naxons = 1
|
||||
axon = []
|
||||
for i in range(naxons):
|
||||
axon.append(h.Section(cell=self.soma))
|
||||
for i in range(naxons):
|
||||
axon[i].connect(self.soma)
|
||||
axon[i].L = 70
|
||||
axon[i].diam = 3.0
|
||||
axon[i].Ra = 500
|
||||
axon[i].cm = 0.9
|
||||
axon[i].nseg = 2
|
||||
axon[i].insert("kht")
|
||||
axon[i].insert("klt")
|
||||
axon[i].insert("ihvcn")
|
||||
axon[i].insert("leak")
|
||||
axon[i].insert("na")
|
||||
axon[i].ek = self.e_k
|
||||
axon[i].ena = self.e_na
|
||||
axon[i]().leak.erev = self.e_leak
|
||||
axon[i]().na.gbar = 0.5
|
||||
axon[i]().klt.gbar = 0.005
|
||||
axon[i]().kht.gbar = 0.02
|
||||
axon[i]().ihvcn.gbar = 0.0002
|
||||
axon[i]().leak.gbar = 0.0005
|
||||
self.status["axon"] = True
|
||||
self.add_section(axon, "axon")
|
||||
|
||||
def add_dendrites(self):
|
||||
"""
|
||||
Adds dendrites to the Eager model. The Eager model uses simple passive dendrites.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
None
|
||||
|
||||
Returns
|
||||
-------
|
||||
Nothing
|
||||
"""
|
||||
|
||||
nDend = range(2) # these will be simple, unbranced, N=4 dendrites
|
||||
dendrites = []
|
||||
for i in nDend:
|
||||
dendrites.append(h.Section(cell=self.soma))
|
||||
for i in nDend:
|
||||
dendrites[i].connect(self.soma)
|
||||
dendrites[i].L = 1100 # length of the dendrite (not tapered)
|
||||
dendrites[i].diam = 3.5 # dendrite diameter
|
||||
dendrites[i].nseg = 5 # # segments in dendrites
|
||||
dendrites[i].Ra = 1500 # ohm.cm
|
||||
dendrites[i].insert("leak") # leak
|
||||
dendrites[i]().leak.gbar = 0.00025
|
||||
dendrites[i]().leak.erev = self.e_leak
|
||||
self.maindend = dendrites
|
||||
self.status["dendrites"] = True
|
||||
self.add_section(self.maindend, "maindend")
|
||||
47
cnmodel/cells/hh.py
Normal file
47
cnmodel/cells/hh.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from __future__ import print_function
|
||||
from neuron import h
|
||||
import neuron as nrn
|
||||
from ..util import nstomho
|
||||
|
||||
from .cell import Cell
|
||||
|
||||
__all__ = ["HH"]
|
||||
|
||||
|
||||
class HH(Cell):
|
||||
"""
|
||||
Standard Hodgkin-Huxley mechanisms from NEURON
|
||||
"""
|
||||
|
||||
def __init__(self, debug=False, message=None):
|
||||
super(HH, self).__init__()
|
||||
|
||||
soma = h.Section(
|
||||
name="HH_Soma_%x" % id(self)
|
||||
) # one compartment of about 29000 um2
|
||||
v_potassium = -80 # potassium reversal potential
|
||||
v_sodium = 50 # sodium reversal potential
|
||||
c_m = 1.0
|
||||
scalefactor = 1.0 # This determines the relative size of the cell
|
||||
rinsf = 1.0 # input resistance adjustment (also current...)
|
||||
totcap = 20.0 # scalefactor * 1.0 # cap in pF for cell
|
||||
effcap = totcap # sometimes we change capacitance - that's effcap
|
||||
somaarea = totcap * 1e-6 / c_m # pf -> uF, cm = 1uf/cm^2 nominal
|
||||
lstd = 1e4 * ((somaarea / 3.14159) ** 0.5) # convert from cm to um
|
||||
|
||||
soma.nseg = 1
|
||||
soma.diam = lstd
|
||||
soma.L = lstd
|
||||
|
||||
seg = soma
|
||||
seg.insert("hh")
|
||||
seg.insert("pas")
|
||||
if debug:
|
||||
if message is None:
|
||||
print("<< Standard HH model created >>")
|
||||
else:
|
||||
print(message)
|
||||
|
||||
self.add_section(soma, "soma")
|
||||
|
||||
self.vm0 = -67.536
|
||||
516
cnmodel/cells/msoprincipal.py
Normal file
516
cnmodel/cells/msoprincipal.py
Normal file
@@ -0,0 +1,516 @@
|
||||
from __future__ import print_function
|
||||
from neuron import h
|
||||
|
||||
from .cell import Cell
|
||||
|
||||
# from .. import synapses
|
||||
from ..util import nstomho
|
||||
from ..util import Params
|
||||
import numpy as np
|
||||
from .. import data
|
||||
|
||||
__all__ = ["MSO"]
|
||||
|
||||
|
||||
class MSO(Cell):
|
||||
|
||||
type = "mso"
|
||||
|
||||
@classmethod
|
||||
def create(cls, model="MSO-principal", **kwds):
|
||||
if model == "MSO-principal":
|
||||
return MSOPrincipal(**kwds)
|
||||
else:
|
||||
raise ValueError("MSO cell model %s is unknown", model)
|
||||
|
||||
def make_psd(self, terminal, psd_type, **kwds):
|
||||
"""
|
||||
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 MSO 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
|
||||
|
||||
"""
|
||||
if (
|
||||
"postsite" in kwds
|
||||
): # use a defined location instead of the default (soma(0.5)
|
||||
postsite = kwds["postsite"]
|
||||
loc = postsite[1] # where on the section?
|
||||
uname = (
|
||||
"sections[%d]" % postsite[0]
|
||||
) # make a name to look up the neuron section object
|
||||
post_sec = self.hr.get_section(uname) # Tell us where to put the synapse.
|
||||
else:
|
||||
loc = 0.5
|
||||
post_sec = self.soma
|
||||
|
||||
if psd_type == "simple":
|
||||
return self.make_exp2_psd(post_sec, terminal, loc=loc)
|
||||
elif psd_type == "multisite":
|
||||
if terminal.cell.type == "bushy":
|
||||
# Max conductances for the glu mechanisms are calibrated by
|
||||
# running `synapses/tests/test_psd.py`. The test should fail
|
||||
# if these values are incorrect
|
||||
self.AMPAR_gmax = (
|
||||
data.get(
|
||||
"bushy_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="AMPAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.NMDAR_gmax = (
|
||||
data.get(
|
||||
"bushy_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="NMDAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.Pr = data.get(
|
||||
"bushy_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="Pr",
|
||||
)
|
||||
# adjust gmax to correct for initial Pr
|
||||
self.AMPAR_gmax = self.AMPAR_gmax / self.Pr
|
||||
self.NMDAR_gmax = self.NMDAR_gmax / self.Pr
|
||||
if "AMPAScale" in kwds: # normally, this should not be done!
|
||||
self.AMPAR_gmax = (
|
||||
self.AMPAR_gmax * kwds["AMPAScale"]
|
||||
) # allow scaling of AMPA conductances
|
||||
if "NMDAScale" in kwds:
|
||||
self.NMDAR_gmax = self.NMDAR_gmax * kwds["NMDAScale"] # and NMDA...
|
||||
return self.make_glu_psd(
|
||||
post_sec, terminal, self.AMPAR_gmax, self.NMDAR_gmax, loc=loc
|
||||
)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make PSD for %s => %s" % (terminal.cell.type, self.type)
|
||||
)
|
||||
else:
|
||||
raise ValueError("Unsupported psd type %s" % psd_type)
|
||||
|
||||
|
||||
class MSOPrincipal(MSO):
|
||||
"""
|
||||
VCN MSO cell models.
|
||||
Using Rothman and Manis, 2003abc (Type II)
|
||||
MSO principal cell type
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
morphology=None,
|
||||
decorator=None,
|
||||
nach=None,
|
||||
ttx=False,
|
||||
species="guineapig",
|
||||
modelType=None,
|
||||
debug=False,
|
||||
temperature=None,
|
||||
):
|
||||
"""
|
||||
Create a MSO principal 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.
|
||||
|
||||
temperature : float (default: None, sets to model default of 22)
|
||||
temperature (deg C) to run the cell at. Must be a valid temperature for the model.
|
||||
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
|
||||
"""
|
||||
super(MSO, self).__init__()
|
||||
self.i_test_range = {
|
||||
"pulse": (-1, 1, 0.05)
|
||||
} # note that this gets reset with decorator according to channels
|
||||
# Changing the default values will cause the unit tests to fail!
|
||||
if modelType == None:
|
||||
modelType = "principal"
|
||||
if nach == None and species == "guineapig":
|
||||
nach = "na"
|
||||
if nach == None and species == "mouse":
|
||||
nach = "na"
|
||||
self.i_test_range = {"pulse": (-1, 1.2, 0.05)}
|
||||
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"hillock": False,
|
||||
"initialsegment": False,
|
||||
"myelinatedaxon": False,
|
||||
"unmyelinatedaxon": False,
|
||||
"na": nach,
|
||||
"species": species,
|
||||
"modelType": modelType,
|
||||
"ttx": ttx,
|
||||
"name": "MSO",
|
||||
"morphology": morphology,
|
||||
"decorator": decorator,
|
||||
"temperature": temperature,
|
||||
}
|
||||
|
||||
self.spike_threshold = -40
|
||||
self.vrange = [-70.0, -55.0] # set a default vrange for searching for rmp
|
||||
print("model type, species: ", modelType, species, nach)
|
||||
if morphology is None:
|
||||
"""
|
||||
instantiate a basic soma-only ("point") model
|
||||
"""
|
||||
print("<< MSO model: Creating point principal cell >>")
|
||||
soma = h.Section(
|
||||
name="MSO_Soma_%x" % id(self)
|
||||
) # one compartment of about 29000 um2
|
||||
soma.nseg = 1
|
||||
self.add_section(soma, "soma")
|
||||
else:
|
||||
"""
|
||||
instantiate a structured model with the morphology as specified by
|
||||
the morphology file
|
||||
"""
|
||||
print(
|
||||
"<< MSO principal cell model: Creating cell with morphology from %s >>"
|
||||
% morphology
|
||||
)
|
||||
self.set_morphology(morphology_file=morphology)
|
||||
|
||||
# decorate the morphology with ion channels
|
||||
if decorator is None: # basic model, only on the soma
|
||||
self.mechanisms = ["klt", "kht", "ihvcn", "leak", nach]
|
||||
for mech in self.mechanisms:
|
||||
self.soma.insert(mech)
|
||||
self.soma.ena = self.e_na
|
||||
self.soma.ek = self.e_k
|
||||
self.soma().ihvcn.eh = self.e_h
|
||||
self.soma().leak.erev = self.e_leak
|
||||
self.c_m = 0.9
|
||||
self.species_scaling(
|
||||
silent=True, species=species, modelType=modelType
|
||||
) # set the default type II cell parameters
|
||||
else: # decorate according to a defined set of rules on all cell compartments
|
||||
self.decorate()
|
||||
self.save_all_mechs() # save all mechanisms inserted, location and gbar values...
|
||||
self.get_mechs(self.soma)
|
||||
|
||||
if debug:
|
||||
print(" << Created cell >>")
|
||||
|
||||
def get_cellpars(self, dataset, species="guineapig", celltype="principal"):
|
||||
cellcap = data.get(
|
||||
dataset, species=species, cell_type=celltype, field="soma_Cap"
|
||||
)
|
||||
chtype = data.get(
|
||||
dataset, species=species, cell_type=celltype, field="soma_na_type"
|
||||
)
|
||||
pars = Params(cap=cellcap, natype=chtype)
|
||||
for g in ["soma_kht_gbar", "soma_klt_gbar", "soma_ih_gbar", "soma_leak_gbar"]:
|
||||
pars.additem(
|
||||
g, data.get(dataset, species=species, cell_type=celltype, field=g)
|
||||
)
|
||||
return pars
|
||||
|
||||
def species_scaling(self, species="guineapig", modelType="principal", silent=True):
|
||||
"""
|
||||
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: 'principal')
|
||||
definition of model type from RM03 models, principal cell for mso
|
||||
|
||||
silent : boolean (default: True)
|
||||
run silently (True) or verbosely (False)
|
||||
|
||||
"""
|
||||
# print '\nSpecies scaling: %s %s' % (species, type)
|
||||
knownspecies = ["guineapig"]
|
||||
|
||||
soma = self.soma
|
||||
if modelType == "principal":
|
||||
celltype = (
|
||||
"MSO-principal"
|
||||
) # There are other possiblities in the literature - this is just the main one
|
||||
else:
|
||||
raise ValueError("model type not recognized")
|
||||
|
||||
if species == "guineapig":
|
||||
print(
|
||||
" Setting conductances for guinea pig %s MSO cell, based on Rothman and Manis, 2003 bushy cell"
|
||||
% modelType
|
||||
)
|
||||
self._valid_temperatures = (22.0, 38.0)
|
||||
if self.status["temperature"] is None:
|
||||
self.status["temperature"] = 22.0
|
||||
self.i_test_range = {"pulse": (-0.4, 0.4, 0.02)}
|
||||
sf = 1.0
|
||||
if (
|
||||
self.status["temperature"] == 38.0
|
||||
): # adjust for 2003 model conductance levels at 38
|
||||
sf = 2 # Q10 of 2, 22->38C. (p3106, R&M2003c)
|
||||
# note that kinetics are scaled in the mod file.
|
||||
dataset = "MSO_principal_channels"
|
||||
pars = self.get_cellpars(dataset, species=species, celltype=celltype)
|
||||
self.set_soma_size_from_Cm(pars.cap)
|
||||
self.status["na"] = pars.natype
|
||||
self.adjust_na_chans(soma, sf=sf)
|
||||
soma().kht.gbar = nstomho(pars.soma_kht_gbar, self.somaarea)
|
||||
soma().klt.gbar = nstomho(pars.soma_klt_gbar, self.somaarea)
|
||||
soma().ihvcn.gbar = nstomho(pars.soma_ih_gbar, self.somaarea)
|
||||
soma().leak.gbar = nstomho(pars.soma_leak_gbar, self.somaarea)
|
||||
|
||||
self.axonsf = 0.57
|
||||
|
||||
else:
|
||||
errmsg = (
|
||||
'Species "%s" or model type "%s" is not recognized for MSO cells.'
|
||||
% (species, modelType)
|
||||
)
|
||||
errmsg += "\n Valid species are: \n"
|
||||
for s in knownspecies:
|
||||
errmsg += " %s\n" % s
|
||||
errmsg += "-" * 40
|
||||
raise ValueError(errmsg)
|
||||
|
||||
self.status["species"] = species
|
||||
self.status["modelType"] = modelType
|
||||
self.check_temperature()
|
||||
# self.cell_initialize(vrange=self.vrange) # no need to do this just yet.
|
||||
if not silent:
|
||||
print(" set cell as: ", species)
|
||||
print(" with Vm rest = %6.3f" % self.vm0)
|
||||
|
||||
def channel_manager(self, modelType="MSO-principal"):
|
||||
"""
|
||||
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, only 1 type is implemented:
|
||||
RM03: Rothman and Manis, 2003 somatic densities based on guinea pig bushy cell
|
||||
|
||||
Returns
|
||||
-------
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
self.c_m = 1e-6 # default in units of F/cm^2
|
||||
if modelType == "MSO-principal":
|
||||
#
|
||||
# Create a model based on the Rothman and Manis 2003 conductance set from guinea pig
|
||||
#
|
||||
self.c_m = 0.9e-6 # default in units of F/cm^2
|
||||
totcap = 12.0e-12 # in units of F, from Rothman and Manis, 2003.
|
||||
refarea = totcap / self.c_m # area is in cm^2
|
||||
# MSO Rothman-Manis, guinea pig type II
|
||||
# model gave cell conductance in nS, but we want S/cm^2 for NEURON
|
||||
# so conversion is 1e-9*nS = uS, and refarea is already in cm2
|
||||
self._valid_temperatures = (22.0, 38.0)
|
||||
sf = 1.0
|
||||
if self.status["temperature"] == None:
|
||||
self.status["temperature"] = 22.0
|
||||
if self.status["temperature"] == 38:
|
||||
sf = 3.03
|
||||
self.gBar = Params(
|
||||
nabar=sf * 1000.0e-9 / refarea,
|
||||
khtbar=sf * 150.0e-9 / refarea,
|
||||
kltbar=sf * 200.0e-9 / refarea,
|
||||
ihbar=sf * 20.0e-9 / refarea,
|
||||
leakbar=sf * 2.0e-9 / refarea,
|
||||
)
|
||||
print("MSO principal channels gbar:\n", self.gBar.show())
|
||||
|
||||
self.channelMap = {
|
||||
"axon": {
|
||||
"nacn": self.gBar.nabar,
|
||||
"klt": self.gBar.kltbar,
|
||||
"kht": self.gBar.khtbar,
|
||||
"ihvcn": 0.0,
|
||||
"leak": self.gBar.leakbar / 2.0,
|
||||
},
|
||||
"hillock": {
|
||||
"nacn": self.gBar.nabar,
|
||||
"klt": self.gBar.kltbar,
|
||||
"kht": self.gBar.khtbar,
|
||||
"ihvcn": 0.0,
|
||||
"leak": self.gBar.leakbar,
|
||||
},
|
||||
"initseg": {
|
||||
"nacn": self.gBar.nabar,
|
||||
"klt": self.gBar.kltbar,
|
||||
"kht": self.gBar.khtbar,
|
||||
"ihvcn": self.gBar.ihbar / 2.0,
|
||||
"leak": self.gBar.leakbar,
|
||||
},
|
||||
"soma": {
|
||||
"nacn": self.gBar.nabar,
|
||||
"klt": self.gBar.kltbar,
|
||||
"kht": self.gBar.khtbar,
|
||||
"ihvcn": self.gBar.ihbar,
|
||||
"leak": self.gBar.leakbar,
|
||||
},
|
||||
"dend": {
|
||||
"nacn": self.gBar.nabar,
|
||||
"klt": self.gBar.kltbar * 0.5,
|
||||
"kht": self.gBar.khtbar * 0.5,
|
||||
"ihvcn": self.gBar.ihbar / 3.0,
|
||||
"leak": self.gBar.leakbar * 0.5,
|
||||
},
|
||||
"apic": {
|
||||
"nacn": self.gBar.nabar,
|
||||
"klt": self.gBar.kltbar * 0.2,
|
||||
"kht": self.gBar.khtbar * 0.2,
|
||||
"ihvcn": self.gBar.ihbar / 4.0,
|
||||
"leak": self.gBar.leakbar * 0.2,
|
||||
},
|
||||
}
|
||||
# self.irange = np.linspace(-1., 1., 21)
|
||||
self.distMap = {
|
||||
"dend": {
|
||||
"klt": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
"kht": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
"nacn": {"gradient": "exp", "gminf": 0.0, "lambda": 100.0},
|
||||
}, # linear with distance, gminf (factor) is multiplied by gbar
|
||||
"apic": {
|
||||
"klt": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
"kht": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
"nacn": {"gradient": "exp", "gminf": 0.0, "lambda": 100.0},
|
||||
}, # gradients are: flat, linear, exponential
|
||||
}
|
||||
|
||||
else:
|
||||
raise ValueError("model type %s is not implemented" % modelType)
|
||||
self.check_temperature()
|
||||
|
||||
def adjust_na_chans(self, soma, sf=1.0, gbar=1000.0, debug=False):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing :
|
||||
|
||||
"""
|
||||
|
||||
if self.status["ttx"]:
|
||||
gnabar = 0.0
|
||||
else:
|
||||
gnabar = nstomho(gbar, self.somaarea) * sf
|
||||
nach = self.status["na"]
|
||||
if nach == "jsrna":
|
||||
soma().jsrna.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if debug:
|
||||
print("jsrna gbar: ", soma().jsrna.gbar)
|
||||
elif nach == "nav11":
|
||||
soma().nav11.gbar = gnabar
|
||||
soma.ena = 50 # self.e_na
|
||||
# print('gnabar: ', soma().nav11.gbar, ' vs: 0.0192307692308')
|
||||
soma().nav11.vsna = 4.3
|
||||
if debug:
|
||||
print("MSO using inva11")
|
||||
elif nach in ["na", "nacn"]:
|
||||
soma().na.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if debug:
|
||||
print("na gbar: ", soma().na.gbar)
|
||||
else:
|
||||
raise ValueError("Sodium channel %s is not recognized for MSO cells", nach)
|
||||
718
cnmodel/cells/octopus.py
Normal file
718
cnmodel/cells/octopus.py
Normal file
@@ -0,0 +1,718 @@
|
||||
from __future__ import print_function
|
||||
from neuron import h
|
||||
from ..util import nstomho
|
||||
from ..util import Params
|
||||
import numpy as np
|
||||
from .cell import Cell
|
||||
from .. import data
|
||||
|
||||
"""
|
||||
Original hoc code from RMmodel.hoc
|
||||
// including the "Octopus" cell:
|
||||
proc set_Type2o() {
|
||||
gbar_na = nstomho(1000)
|
||||
gbar_kht = nstomho(150)
|
||||
gbar_klt = nstomho(600)
|
||||
gbar_ka = nstomho(0)
|
||||
gbar_ih = nstomho(0)
|
||||
gbar_hcno = nstomho(40)
|
||||
gbar_leak = nstomho(2)
|
||||
model = 6
|
||||
modelname = "Type IIo (Octopus)"
|
||||
vm0 = -66.67
|
||||
}
|
||||
|
||||
"""
|
||||
|
||||
__all__ = ["Octopus", "OctopusRothman", "OctopusSpencer"]
|
||||
|
||||
|
||||
class Octopus(Cell):
|
||||
|
||||
type = "octopus"
|
||||
|
||||
@classmethod
|
||||
def create(cls, modelType="RM03", **kwds):
|
||||
if modelType in ["RM03", "II-o"]:
|
||||
return OctopusRothman(**kwds)
|
||||
elif modelType == "Spencer":
|
||||
return OctopusSpencer(**kwds)
|
||||
else:
|
||||
raise ValueError("Octopus cell type %s is unknown" % modelType)
|
||||
|
||||
def make_psd(self, terminal, psd_type, **kwds):
|
||||
"""
|
||||
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
|
||||
|
||||
"""
|
||||
if (
|
||||
"postsite" in kwds
|
||||
): # use a defined location instead of the default (soma(0.5)
|
||||
postsite = kwds["postsite"]
|
||||
loc = postsite[1] # where on the section?
|
||||
uname = (
|
||||
"sections[%d]" % postsite[0]
|
||||
) # make a name to look up the neuron section object
|
||||
post_sec = self.hr.get_section(uname) # Tell us where to put the synapse.
|
||||
else:
|
||||
loc = 0.5
|
||||
post_sec = self.soma
|
||||
|
||||
if psd_type == "simple":
|
||||
if terminal.cell.type in ["sgc"]:
|
||||
weight = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="weight",
|
||||
)
|
||||
tau1 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau1",
|
||||
)
|
||||
tau2 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau2",
|
||||
)
|
||||
erev = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="erev",
|
||||
)
|
||||
return self.make_exp2_psd(
|
||||
post_sec,
|
||||
terminal,
|
||||
weight=weight,
|
||||
loc=loc,
|
||||
tau1=tau1,
|
||||
tau2=tau2,
|
||||
erev=erev,
|
||||
)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make simple PSD for %s => %s"
|
||||
% (terminal.cell.type, self.type)
|
||||
)
|
||||
|
||||
elif psd_type == "multisite":
|
||||
if terminal.cell.type == "sgc":
|
||||
# Max conductances for the glu mechanisms are calibrated by
|
||||
# running `synapses/tests/test_psd.py`. The test should fail
|
||||
# if these values are incorrect
|
||||
self.AMPAR_gmax = (
|
||||
data.get(
|
||||
"sgc_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="AMPAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.NMDAR_gmax = (
|
||||
data.get(
|
||||
"sgc_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="NMDAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.Pr = data.get(
|
||||
"sgc_synapse", species=self.species, post_type=self.type, field="Pr"
|
||||
)
|
||||
# adjust gmax to correct for initial Pr
|
||||
self.AMPAR_gmax = self.AMPAR_gmax / self.Pr
|
||||
self.NMDAR_gmax = self.NMDAR_gmax / self.Pr
|
||||
# AMPA_gmax = 3.314707700918133*1e3 # factor of 1e3 scales to pS (.mod mechanisms) from nS.
|
||||
# NMDA_gmax = 0.4531929783503451*1e3
|
||||
if "AMPAScale" in kwds:
|
||||
self.AMPAR_gmax = (
|
||||
self.AMPAR_gmax * kwds["AMPAScale"]
|
||||
) # allow scaling of AMPA conductances
|
||||
if "NMDAScale" in kwds:
|
||||
self.NMDAR_gmax = self.NMDAR_gmax * kwds["NMDAScale"]
|
||||
return self.make_glu_psd(
|
||||
post_sec, terminal, self.AMPAR_gmax, self.NMDAR_gmax, loc=loc
|
||||
)
|
||||
elif terminal.cell.type == "dstellate":
|
||||
return self.make_gly_psd(post_sec, terminal, psdtype="glyslow", loc=loc)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make PSD for %s => %s" % (terminal.cell.type, self.type)
|
||||
)
|
||||
else:
|
||||
raise ValueError("Unsupported psd type %s" % psd_type)
|
||||
|
||||
|
||||
class OctopusRothman(Octopus, Cell):
|
||||
"""
|
||||
VCN octopus cell model (point cell).
|
||||
Rothman and Manis, 2003abc (Type II, with high gklt and hcno - octopus cell h current).
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
morphology=None,
|
||||
decorator=None,
|
||||
nach=None,
|
||||
ttx=False,
|
||||
species="guineapig",
|
||||
modelType=None,
|
||||
debug=False,
|
||||
):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
"""
|
||||
|
||||
super(OctopusRothman, self).__init__()
|
||||
if modelType == None:
|
||||
modelType = "II-o"
|
||||
if nach == None and species == "guineapig":
|
||||
nach = "jsrna"
|
||||
if nach == None and species == "mouse":
|
||||
nach = "nacn"
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"na": nach,
|
||||
"species": species,
|
||||
"modelType": modelType,
|
||||
"ttx": ttx,
|
||||
"name": "Octopus",
|
||||
"morphology": morphology,
|
||||
"decorator": decorator,
|
||||
"temperature": None,
|
||||
}
|
||||
self.i_test_range = {"pulse": (-4.0, 4.0, 0.2)}
|
||||
self.spike_threshold = -50
|
||||
self.vrange = [-70.0, -57.0] # set a default vrange for searching for rmp
|
||||
|
||||
if morphology is None:
|
||||
"""
|
||||
instantiate a basic soma-only ("point") model
|
||||
"""
|
||||
soma = h.Section(
|
||||
name="Octopus_Soma_%x" % id(self)
|
||||
) # one compartment of about 29000 um2
|
||||
soma.nseg = 1
|
||||
self.add_section(soma, "soma")
|
||||
else:
|
||||
"""
|
||||
instantiate a structured model with the morphology as specified by
|
||||
the morphology file
|
||||
"""
|
||||
self.set_morphology(morphology_file=morphology)
|
||||
|
||||
# decorate the morphology with ion channels
|
||||
if decorator is None: # basic model, only on the soma
|
||||
self.e_leak = -73.0 # from McGinley et al., 2016
|
||||
self.e_h = -38.0 # from McGinley et al.
|
||||
self.R_a = 195 # McGinley et al.
|
||||
if self.status["species"] == "mouse":
|
||||
self.mechanisms = ["klt", "kht", "hcnobo", "leak", nach]
|
||||
else:
|
||||
self.mechanisms = ["klt", "kht", "ihvcn", "leak", nach]
|
||||
for mech in self.mechanisms:
|
||||
self.soma.insert(mech)
|
||||
self.soma.ek = self.e_k
|
||||
self.soma.ena = self.e_na
|
||||
if self.status["species"] == "mouse":
|
||||
self.soma().hcnobo.eh = self.e_h
|
||||
else:
|
||||
self.soma().ihvcn.eh = self.e_h
|
||||
self.soma().leak.erev = self.e_leak
|
||||
self.soma.Ra = self.R_a
|
||||
self.species_scaling(
|
||||
silent=True, species=species, modelType=modelType
|
||||
) # set the default type II cell parameters
|
||||
else: # decorate according to a defined set of rules on all cell compartments
|
||||
self.decorate()
|
||||
self.save_all_mechs() # save all mechanisms inserted, location and gbar values...
|
||||
self.get_mechs(self.soma)
|
||||
|
||||
if debug:
|
||||
print("<< octopus: octopus cell model created >>")
|
||||
# print 'Cell created: ', self.status
|
||||
|
||||
def species_scaling(self, species="guineapig", modelType="II-o", silent=True):
|
||||
"""
|
||||
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)
|
||||
"""
|
||||
soma = self.soma
|
||||
|
||||
if species == "guineapig" and modelType == "II-o":
|
||||
self.c_m = 0.9
|
||||
self.set_soma_size_from_Cm(25.0)
|
||||
self._valid_temperatures = (22.0, 38.0)
|
||||
if self.status["temperature"] is None:
|
||||
self.set_temperature(22.0)
|
||||
sf = 1.0
|
||||
if (
|
||||
self.status["temperature"] == 38.0
|
||||
): # adjust for 2003 model conductance levels at 38
|
||||
sf = 3.03 # Q10 of 2, 22->38C. (p3106, R&M2003c)
|
||||
# note that kinetics are scaled in the mod file.
|
||||
# self.print_soma_info()
|
||||
self.adjust_na_chans(soma, sf=sf)
|
||||
soma().kht.gbar = sf * nstomho(150.0, self.somaarea) # 6.1 mmho/cm2
|
||||
soma().klt.gbar = sf * nstomho(
|
||||
1000.0, self.somaarea
|
||||
) # 40.7 mmho/cm2 3195?
|
||||
soma().ihvcn.gbar = sf * nstomho(
|
||||
30.0, self.somaarea
|
||||
) # 7.6 mmho/cm2, cf. Bal and Oertel, Spencer et al. 25 u dia cell 40ns?
|
||||
soma().leak.gbar = sf * nstomho(2.0, self.somaarea)
|
||||
self.axonsf = 1.0
|
||||
elif species == "mouse" and modelType == "II-o":
|
||||
self.set_soma_size_from_Cm(25.0)
|
||||
self._valid_temperatures = (34.0,)
|
||||
if self.status["temperature"] is None:
|
||||
self.set_temperature(34.0)
|
||||
# self.print_soma_info()
|
||||
self.adjust_na_chans(soma, gbar=3000.0)
|
||||
soma().kht.gbar = nstomho(150.0, self.somaarea) # 6.1 mmho/cm2
|
||||
soma().klt.gbar = nstomho(3196.0, self.somaarea) # 40.7 mmho/cm2
|
||||
soma().hcnobo.gbar = nstomho(
|
||||
40.0, self.somaarea
|
||||
) # 7.6 mmho/cm2, cf. Bal and Oertel, Spencer et al. 25 u dia cell
|
||||
soma().leak.gbar = nstomho(2.0, self.somaarea)
|
||||
self.axonsf = 1.0
|
||||
else:
|
||||
raise ValueError(
|
||||
'Species "%s" or species-type "%s" is not recognized for octopus cells'
|
||||
% (species, type)
|
||||
)
|
||||
self.status["species"] = species
|
||||
self.status["modelType"] = modelType
|
||||
# self.cell_initialize(showinfo=True)
|
||||
self.check_temperature()
|
||||
if not silent:
|
||||
print("set cell as: ", species)
|
||||
print(" with Vm rest = %6.3f" % self.vm0)
|
||||
|
||||
def adjust_na_chans(self, soma, sf=1.0, gbar=1000.0, debug=False):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
"""
|
||||
|
||||
if self.status["ttx"]:
|
||||
gnabar = 0.0
|
||||
else:
|
||||
gnabar = sf * nstomho(gbar, self.somaarea) # mmho/cm2 - 4244.1 moh - 4.2441
|
||||
nach = self.status["na"]
|
||||
if nach == "jsrna":
|
||||
soma().jsrna.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if debug:
|
||||
print("octopus using jsrna, gbar: ", soma().jsrna.gbar)
|
||||
elif nach == "nav11":
|
||||
soma().nav11.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
soma().nav11.vsna = 4.3
|
||||
if debug:
|
||||
print("octopus using inva11, gbar:", soma().nav11.gbar)
|
||||
elif nach in ["na", "nacn"]:
|
||||
soma().nacn.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if debug:
|
||||
print("octopus cell using na/nacn, gbar: ", soma().na.gbar)
|
||||
else:
|
||||
raise ValueError(
|
||||
"Sodium channel %s is not recognized for octopus cells", nach
|
||||
)
|
||||
|
||||
|
||||
class OctopusSpencer(Octopus, Cell):
|
||||
"""
|
||||
VCN octopus cell model (with dendrites).
|
||||
Based on Spencer et al Front. Comput. Neurosci., 22 October 2012
|
||||
https://doi.org/10.3389/fncom.2012.00083
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
morphology=None,
|
||||
decorator=None,
|
||||
nach="jsrna",
|
||||
ttx=False,
|
||||
species="guineapig",
|
||||
modelType=None,
|
||||
debug=False,
|
||||
):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
"""
|
||||
|
||||
super(OctopusSpencer, self).__init__()
|
||||
if modelType == None:
|
||||
modelType = "Spencer"
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"na": nach,
|
||||
"species": species,
|
||||
"modelType": modelType,
|
||||
"ttx": ttx,
|
||||
"name": "Octopus",
|
||||
"morphology": morphology,
|
||||
"decorator": decorator,
|
||||
"temperature": None,
|
||||
}
|
||||
self.i_test_range = (-4.0, 6.0, 0.25)
|
||||
self.spike_threshold = -50
|
||||
self.vrange = [-75.0, -63.0] # set a default vrange for searching for rmp
|
||||
|
||||
if morphology is None:
|
||||
"""
|
||||
instantiate a basic soma-only ("point") model
|
||||
"""
|
||||
soma = h.Section(
|
||||
name="Octopus_Soma_%x" % id(self)
|
||||
) # one compartment of about 29000 um2
|
||||
soma.nseg = 1
|
||||
self.add_section(soma, "soma")
|
||||
self.set_soma_size_from_Section(self.soma)
|
||||
|
||||
else:
|
||||
"""
|
||||
instantiate a structured model with the morphology as specified by
|
||||
the morphology file
|
||||
"""
|
||||
self.set_morphology(morphology_file=morphology)
|
||||
|
||||
# decorate the morphology with ion channels
|
||||
if decorator is None: # basic model, only on the soma
|
||||
self.e_leak = -62.0 # from Spencer et al., 2012
|
||||
self.e_h = -38.0 ## from Spencer et al., 2012
|
||||
self.R_a = 100.0 # from Spencer et al., 2012
|
||||
self.mechanisms = ["klt", "kht", "hcnobo", "leak", nach]
|
||||
for mech in self.mechanisms:
|
||||
self.soma.insert(mech)
|
||||
self.soma.ek = -70.0 # self.e_k
|
||||
self.soma.ena = 55.0 # self.e_na
|
||||
self.soma().hcnobo.eh = self.e_h
|
||||
self.soma().leak.erev = self.e_leak
|
||||
self.soma.Ra = self.R_a
|
||||
self.species_scaling(
|
||||
silent=True, species=species, modelType=modelType
|
||||
) # set the default type II cell parameters
|
||||
else: # decorate according to a defined set of rules on all cell compartments
|
||||
self.decorate()
|
||||
self.decorated.channelValidate(self, verify=True)
|
||||
# print 'Mechanisms inserted: ', self.mechanisms
|
||||
self.get_mechs(self.soma)
|
||||
# self.cell_initialize(vrange=self.vrange)
|
||||
|
||||
if debug:
|
||||
print("<< octopus: octopus cell model created >>")
|
||||
# print 'Cell created: ', self.status
|
||||
|
||||
def channel_manager(self, modelType="Spencer"):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
#
|
||||
# Create a model based on the Spencer model
|
||||
# Channel decoration and stick model from Figure 2
|
||||
# densities from Tables 2 and 3
|
||||
if modelType == "Spencer":
|
||||
# print self.c_m
|
||||
self.c_m = 0.9
|
||||
# self.set_soma_size_from_Section(self.soma)
|
||||
totcap = self.totcap
|
||||
refarea = self.somaarea # totcap / self.c_m # see above for units
|
||||
# self.print_soma_info()
|
||||
self._valid_temperatures = (
|
||||
34.0,
|
||||
) # 34 for consistency with other mouse models, but
|
||||
# Spencer data used "33". This affects very slightly
|
||||
# the HCN channel conductance.
|
||||
if self.status["temperature"] is None:
|
||||
self.set_temperature(34.0)
|
||||
self.gBar = Params(
|
||||
nabar=0.0, # 0.0407, # S/cm2
|
||||
nabar_ais=0.42441,
|
||||
kltbar_ais=0.0,
|
||||
khtbar_ais=0.0,
|
||||
ihbar_ais=0.0,
|
||||
kltbar_soma=0.0407,
|
||||
khtbar_soma=0.0061,
|
||||
ihbar_soma=0.0076,
|
||||
kltbar_dend=0.0027,
|
||||
khtbar_dend=0.0,
|
||||
ihbar_dend=0.0006,
|
||||
khtbar_hillock=0.0,
|
||||
kltbar_hillock=0.0,
|
||||
ihbar_hillock=0.0,
|
||||
leakbar=0.0020,
|
||||
)
|
||||
|
||||
self.channelMap = {
|
||||
"soma": {
|
||||
"jsrna": self.gBar.nabar,
|
||||
"klt": self.gBar.kltbar_soma,
|
||||
"kht": self.gBar.khtbar_soma,
|
||||
"hcnobo": self.gBar.ihbar_soma,
|
||||
"leak": self.gBar.leakbar,
|
||||
},
|
||||
"hillock": {
|
||||
"jsrna": 0.0,
|
||||
"klt": self.gBar.kltbar_hillock,
|
||||
"kht": self.gBar.khtbar_hillock,
|
||||
"hcnobo": self.gBar.ihbar_hillock,
|
||||
"leak": self.gBar.leakbar,
|
||||
},
|
||||
# axon initial segment:
|
||||
"unmyelinatedaxon": {
|
||||
"jsrna": self.gBar.nabar_ais,
|
||||
"klt": self.gBar.kltbar_ais,
|
||||
"kht": self.gBar.khtbar_ais,
|
||||
"hcnobo": self.gBar.ihbar_ais,
|
||||
"leak": self.gBar.leakbar,
|
||||
},
|
||||
"primarydendrite": {
|
||||
"jsrna": 0.0,
|
||||
"klt": self.gBar.kltbar_dend,
|
||||
"kht": self.gBar.khtbar_dend,
|
||||
"hcnobo": self.gBar.ihbar_dend,
|
||||
"leak": self.gBar.leakbar,
|
||||
},
|
||||
}
|
||||
|
||||
self.distMap = {
|
||||
"primarydendrite": {
|
||||
"klt": {"gradient": "flat", "gminf": 0.0, "lambda": 100.0},
|
||||
"kht": {"gradient": "flat", "gminf": 0.0, "lambda": 100.0},
|
||||
"hcnobo": {"gradient": "flat", "gminf": 0.0, "lambda": 100.0},
|
||||
} # all flat with distance
|
||||
}
|
||||
# reversal potential map
|
||||
self.channelErevMap = {
|
||||
"soma": {
|
||||
"jsrna": 55.0,
|
||||
"klt": -70,
|
||||
"kht": -70,
|
||||
"hcnobo": -38,
|
||||
"leak": -62.0,
|
||||
},
|
||||
"hillock": {
|
||||
"jsrna": 55.0,
|
||||
"klt": -70,
|
||||
"kht": -70,
|
||||
"hcnobo": -38,
|
||||
"leak": -62.0,
|
||||
},
|
||||
"unmyelinatedaxon": {
|
||||
"jsrna": 55.0,
|
||||
"klt": -70,
|
||||
"kht": -70,
|
||||
"hcnobo": -38,
|
||||
"leak": -62.0,
|
||||
},
|
||||
"primarydendrite": {
|
||||
"jsrna": 55.0,
|
||||
"klt": -70,
|
||||
"kht": -70,
|
||||
"hcnobo": -38,
|
||||
"leak": -62.0,
|
||||
},
|
||||
}
|
||||
|
||||
else:
|
||||
raise ValueError("model type %s is not implemented" % modelType)
|
||||
self.check_temperature()
|
||||
|
||||
def species_scaling(self, species="mouse", modelType="Spencer", silent=True):
|
||||
"""
|
||||
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)
|
||||
"""
|
||||
soma = self.soma
|
||||
|
||||
if species == "mouse" and modelType == "Spencer":
|
||||
print("Octopus: Mouse, Spencer point model - not a valid model")
|
||||
self.set_soma_size_from_Cm(25.0)
|
||||
self._valid_temperatures = (34.0,)
|
||||
if self.status["temperature"] is None:
|
||||
self.set_temperature(34.0)
|
||||
self.print_soma_info()
|
||||
# self.adjust_na_chans(soma)
|
||||
# soma().kht.gbar = 0.0061 # nstomho(150.0, self.somaarea) # 6.1 mmho/cm2
|
||||
# soma().klt.gbar = 0.0407 # nstomho(3196.0, self.somaarea) # 40.7 mmho/cm2
|
||||
# soma().hcnobo.gbar = 0.0076 #nstomho(40.0, self.somaarea) # 7.6 mmho/cm2, cf. Bal and Oertel, Spencer et al. 25 u dia cell
|
||||
# soma().leak.gbar = 0.0005 # nstomho(2.0, self.somaarea)
|
||||
self.axonsf = 1.0
|
||||
else:
|
||||
raise ValueError(
|
||||
'Species "%s" or species-type "%s" is not recognized for octopus cells'
|
||||
% (species, type)
|
||||
)
|
||||
self.status["species"] = species
|
||||
self.status["modelType"] = modelType
|
||||
self.cell_initialize(showinfo=True)
|
||||
if not silent:
|
||||
print("set cell as: ", species)
|
||||
print(" with Vm rest = %6.3f" % self.vm0)
|
||||
482
cnmodel/cells/pyramidal.py
Normal file
482
cnmodel/cells/pyramidal.py
Normal file
@@ -0,0 +1,482 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import numpy as np
|
||||
from neuron import h
|
||||
|
||||
from .cell import Cell
|
||||
from .. import data
|
||||
from ..util import Params
|
||||
from ..util import nstomho
|
||||
|
||||
__all__ = ["Pyramidal", "PyramidalKanold"]
|
||||
|
||||
|
||||
class Pyramidal(Cell):
|
||||
|
||||
type = "pyramidal"
|
||||
|
||||
@classmethod
|
||||
def create(cls, model="POK", **kwds):
|
||||
if model == "POK":
|
||||
return PyramidalKanold(**kwds)
|
||||
else:
|
||||
raise ValueError("Pyramidal model %s is unknown", model)
|
||||
|
||||
def make_psd(self, terminal, psd_type, **kwds):
|
||||
"""
|
||||
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
|
||||
|
||||
"""
|
||||
if (
|
||||
"postsite" in kwds
|
||||
): # use a defined location instead of the default (soma(0.5)
|
||||
postsite = kwds["postsite"]
|
||||
loc = postsite[1] # where on the section?
|
||||
uname = (
|
||||
"sections[%d]" % postsite[0]
|
||||
) # make a name to look up the neuron section object
|
||||
post_sec = self.hr.get_section(uname) # Tell us where to put the synapse.
|
||||
else:
|
||||
loc = 0.5
|
||||
post_sec = self.soma
|
||||
|
||||
if psd_type == "simple":
|
||||
if terminal.cell.type in [
|
||||
"sgc",
|
||||
"dstellate",
|
||||
"tuberculoventral",
|
||||
"cartwheel",
|
||||
]:
|
||||
weight = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="weight",
|
||||
)
|
||||
tau1 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau1",
|
||||
)
|
||||
tau2 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau2",
|
||||
)
|
||||
erev = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="erev",
|
||||
)
|
||||
return self.make_exp2_psd(
|
||||
post_sec,
|
||||
terminal,
|
||||
weight=weight,
|
||||
loc=loc,
|
||||
tau1=tau1,
|
||||
tau2=tau2,
|
||||
erev=erev,
|
||||
)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make simple PSD for %s => %s"
|
||||
% (terminal.cell.type, self.type)
|
||||
)
|
||||
|
||||
elif psd_type == "multisite":
|
||||
if terminal.cell.type == "sgc":
|
||||
# Max conductances for the glu mechanisms are calibrated by
|
||||
# running `synapses/tests/test_psd.py`. The test should fail
|
||||
# if these values are incorrect
|
||||
self.AMPAR_gmax = (
|
||||
data.get(
|
||||
"sgc_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="AMPAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.NMDAR_gmax = (
|
||||
data.get(
|
||||
"sgc_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="NMDAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.Pr = data.get(
|
||||
"sgc_synapse", species=self.species, post_type=self.type, field="Pr"
|
||||
)
|
||||
# adjust gmax to correct for initial Pr
|
||||
self.AMPAR_gmax = self.AMPAR_gmax / self.Pr
|
||||
self.NMDAR_gmax = self.NMDAR_gmax / self.Pr
|
||||
if "AMPAScale" in kwds:
|
||||
self.AMPA_gmax = (
|
||||
self.AMPA_gmax * kwds["AMPAScale"]
|
||||
) # allow scaling of AMPA conductances
|
||||
if "NMDAScale" in kwds:
|
||||
self.NMDA_gmax = self.NMDA_gmax * kwds["NMDAScale"]
|
||||
return self.make_glu_psd(
|
||||
post_sec, terminal, self.AMPAR_gmax, self.NMDAR_gmax, loc=loc
|
||||
)
|
||||
elif terminal.cell.type == "dstellate": # WBI input -Voigt, Nelken, Young
|
||||
return self.make_gly_psd(post_sec, terminal, psdtype="glyfast", loc=loc)
|
||||
elif (
|
||||
terminal.cell.type == "tuberculoventral"
|
||||
): # TV cells talk to each other-Kuo et al.
|
||||
return self.make_gly_psd(post_sec, terminal, psdtype="glyfast", loc=loc)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make PSD for %s => %s" % (terminal.cell.type, self.type)
|
||||
)
|
||||
else:
|
||||
raise ValueError("Unsupported psd type %s" % psd_type)
|
||||
|
||||
|
||||
class PyramidalKanold(Pyramidal, Cell):
|
||||
"""
|
||||
DCN pyramidal cell
|
||||
Kanold and Manis, 1999, 2001, 2005
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
morphology=None,
|
||||
decorator=None,
|
||||
nach=None,
|
||||
ttx=False,
|
||||
species="rat",
|
||||
modelType=None,
|
||||
debug=False,
|
||||
):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
|
||||
"""
|
||||
super(PyramidalKanold, self).__init__()
|
||||
if modelType == None:
|
||||
modelType = "POK"
|
||||
if nach == None:
|
||||
nach = "napyr"
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"na": nach,
|
||||
"species": species,
|
||||
"modelType": modelType,
|
||||
"ttx": ttx,
|
||||
"name": "Pyramidal",
|
||||
"morphology": morphology,
|
||||
"decorator": decorator,
|
||||
"temperature": None,
|
||||
}
|
||||
|
||||
self.i_test_range = {"pulse": (-0.3, 0.401, 0.02)}
|
||||
self.vrange = [-75.0, -60.0]
|
||||
if morphology is None:
|
||||
"""
|
||||
instantiate a basic soma-only ("point") model
|
||||
"""
|
||||
soma = h.Section(
|
||||
name="Pyramidal_Soma_%x" % id(self)
|
||||
) # one compartment of about 29000 um2
|
||||
soma.nseg = 1
|
||||
self.add_section(soma, "soma")
|
||||
else:
|
||||
"""
|
||||
instantiate a structured model with the morphology as specified by
|
||||
the morphology file
|
||||
"""
|
||||
self.set_morphology(morphology_file=morphology)
|
||||
|
||||
# decorate the morphology with ion channels
|
||||
if decorator is None: # basic model, only on the soma
|
||||
self.mechanisms = [
|
||||
"napyr",
|
||||
"kdpyr",
|
||||
"kif",
|
||||
"kis",
|
||||
"ihpyr",
|
||||
"leak",
|
||||
"kcnq",
|
||||
"nap",
|
||||
]
|
||||
for mech in self.mechanisms:
|
||||
try:
|
||||
self.soma.insert(mech)
|
||||
except ValueError:
|
||||
print("WARNING: Mechanism %s not found" % mech)
|
||||
self.soma().kif.kif_ivh = -89.6
|
||||
self.species_scaling(
|
||||
silent=True, species=species, modelType=modelType
|
||||
) # set the default type I-c cell parameters
|
||||
else: # decorate according to a defined set of rules on all cell compartments
|
||||
self.decorate()
|
||||
self.save_all_mechs() # save all mechanisms inserted, location and gbar values...
|
||||
self.get_mechs(self.soma)
|
||||
if debug:
|
||||
print("<< PYR: POK Pyramidal Cell created >>")
|
||||
|
||||
def get_cellpars(self, dataset, species="guineapig", celltype="II"):
|
||||
cellcap = data.get(
|
||||
dataset, species=species, cell_type=celltype, field="soma_Cap"
|
||||
)
|
||||
chtype = data.get(
|
||||
dataset, species=species, cell_type=celltype, field="soma_natype"
|
||||
)
|
||||
pars = Params(cap=cellcap, natype=chtype)
|
||||
for g in [
|
||||
"soma_napyr_gbar",
|
||||
"soma_kdpyr_gbar",
|
||||
"soma_kif_gbar",
|
||||
"soma_kis_gbar",
|
||||
"soma_kcnq_gbar",
|
||||
"soma_nap_gbar",
|
||||
"soma_ihpyr_gbar",
|
||||
"soma_leak_gbar",
|
||||
"soma_e_h",
|
||||
"soma_leak_erev",
|
||||
"soma_e_k",
|
||||
"soma_e_na",
|
||||
]:
|
||||
pars.additem(
|
||||
g, data.get(dataset, species=species, cell_type=celltype, field=g)
|
||||
)
|
||||
return pars
|
||||
|
||||
def species_scaling(self, species="rat", modelType="I", silent=True):
|
||||
"""
|
||||
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)
|
||||
"""
|
||||
if modelType in ["I", "POK"]:
|
||||
celltype = "pyramidal"
|
||||
elif modelType in ["II"]:
|
||||
celltype = "pyramidal-II"
|
||||
else:
|
||||
celltype = modelType
|
||||
|
||||
dataset = "POK_channels"
|
||||
|
||||
soma = self.soma
|
||||
if species in ["rat", "mouse"] and modelType in [
|
||||
"I",
|
||||
"POK",
|
||||
"II",
|
||||
]: # canonical K&M2001 model cell
|
||||
self._valid_temperatures = (34.0,)
|
||||
if self.status["temperature"] is None:
|
||||
self.set_temperature(34.0)
|
||||
pars = self.get_cellpars(dataset, species=species, celltype=celltype)
|
||||
self.set_soma_size_from_Cm(pars.cap)
|
||||
self.status["na"] = pars.natype
|
||||
soma().napyr.gbar = nstomho(pars.soma_napyr_gbar, self.somaarea)
|
||||
soma().nap.gbar = nstomho(
|
||||
pars.soma_nap_gbar, self.somaarea
|
||||
) # does not exist in canonical model
|
||||
soma().kdpyr.gbar = nstomho(pars.soma_kdpyr_gbar, self.somaarea)
|
||||
soma().kcnq.gbar = nstomho(
|
||||
pars.soma_kcnq_gbar, self.somaarea
|
||||
) # does not exist in canonical model.
|
||||
soma().kif.gbar = nstomho(pars.soma_kif_gbar, self.somaarea)
|
||||
soma().kis.gbar = nstomho(pars.soma_kis_gbar, self.somaarea)
|
||||
soma().ihpyr.gbar = nstomho(pars.soma_ihpyr_gbar, self.somaarea)
|
||||
# soma().ihpyr_adj.q10 = 3.0 # no temp scaling to sta
|
||||
soma().leak.gbar = nstomho(pars.soma_leak_gbar, self.somaarea)
|
||||
soma().leak.erev = pars.soma_leak_erev
|
||||
soma().ena = pars.soma_e_na
|
||||
soma().ek = pars.soma_e_k
|
||||
soma().ihpyr.eh = pars.soma_e_h
|
||||
|
||||
# elif species in 'rat' and modelType == 'II':
|
||||
# """
|
||||
# Modified canonical K&M2001 model cell
|
||||
# In this model version, the specific membrane capacitance is modified
|
||||
# so that the overall membrane time constant is consistent with experimental
|
||||
# measures in slices. However, this is not a physiological value. Attempts
|
||||
# to use the normal 1 uF/cm2 value were unsuccessful in establishing the expected
|
||||
# ~12 msec time constant.
|
||||
# This model also adds a KCNQ channel, as described by Li et al., 2012.
|
||||
# """
|
||||
# self.c_m = 6.0
|
||||
# self.set_soma_size_from_Diam(30.0)
|
||||
# # self.set_soma_size_from_Cm(80.0)
|
||||
# # print 'diameter: %7.1f' % self.soma.diam
|
||||
# self._valid_temperatures = (34.,)
|
||||
# if self.status['temperature'] is None:
|
||||
# self.set_temperature(34.)
|
||||
# self.refarea = self.somaarea
|
||||
# soma().napyr.gbar = nstomho(550, self.refarea)
|
||||
# soma().nap.gbar = nstomho(60.0, self.refarea)
|
||||
# soma().kcnq.gbar = nstomho(2, self.refarea) # pyramidal cells have kcnq: Li et al, 2011 (Thanos)
|
||||
# soma().kdpyr.gbar = nstomho(180, self.refarea) # Normally 80.
|
||||
# soma().kif.gbar = nstomho(150, self.refarea) # normally 150
|
||||
# soma().kis.gbar = nstomho(40, self.refarea) # 40
|
||||
# soma().ihpyr.gbar = nstomho(2.8, self.refarea)
|
||||
# soma().leak.gbar = nstomho(0.5, self.refarea)
|
||||
# soma().leak.erev = -62. # override default values in cell.py
|
||||
# soma().ena = 50.0
|
||||
# soma().ek = -81.5
|
||||
# soma().ihpyr.eh = -43
|
||||
# if not self.status['dendrites']:
|
||||
# self.add_dendrites()
|
||||
|
||||
else:
|
||||
raise ValueError(
|
||||
"Species %s or species-modelType %s is not implemented for Pyramidal cells"
|
||||
% (species, modelType)
|
||||
)
|
||||
|
||||
self.status["species"] = species
|
||||
self.status["modelType"] = modelType
|
||||
# self.cell_initialize(showinfo=True)
|
||||
self.check_temperature()
|
||||
if not silent:
|
||||
print("set cell as: ", species, modelType)
|
||||
print(" with Vm rest = %f" % self.vm0)
|
||||
print(self.status)
|
||||
for m in self.mechanisms:
|
||||
print("%s.gbar = %f" % (m, eval("soma().%s.gbar" % m)))
|
||||
|
||||
def i_currents(self, V):
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
for part in self.all_sections.keys():
|
||||
for sec in self.all_sections[part]:
|
||||
sec.v = V
|
||||
h.celsius = self.status["temperature"]
|
||||
h.finitialize()
|
||||
self.ix = {}
|
||||
|
||||
if "napyr" in self.mechanisms:
|
||||
self.ix["napyr"] = self.soma().napyr.gna * (V - self.soma().ena)
|
||||
if "nap" in self.mechanisms:
|
||||
self.ix["nap"] = self.soma().nap.gnap * (V - self.soma().ena)
|
||||
if "kdpyr" in self.mechanisms:
|
||||
self.ix["kdpyr"] = self.soma().kdpyr.gk * (V - self.soma().ek)
|
||||
if "kif" in self.mechanisms:
|
||||
self.ix["kif"] = self.soma().kif.gkif * (V - self.soma().ek)
|
||||
if "kis" in self.mechanisms:
|
||||
self.ix["kis"] = self.soma().kis.gkis * (V - self.soma().ek)
|
||||
if "kcnq" in self.mechanisms:
|
||||
self.ix["kcnq"] = self.soma().kcnq.gk * (V - self.soma().ek)
|
||||
if "ihpyr" in self.mechanisms:
|
||||
self.ix["ihpyr"] = self.soma().ihpyr.gh * (V - self.soma().ihpyr.eh)
|
||||
if "ihpyr_adj" in self.mechanisms:
|
||||
self.ix["ihpyr_adj"] = self.soma().ihpyr_adj.gh * (
|
||||
V - self.soma().ihpyr_adj.eh
|
||||
)
|
||||
# leak
|
||||
if "leak" in self.mechanisms:
|
||||
self.ix["leak"] = self.soma().leak.gbar * (V - self.soma().leak.erev)
|
||||
return np.sum([self.ix[i] for i in self.ix])
|
||||
|
||||
def add_dendrites(self):
|
||||
"""
|
||||
Add simple unbranched dendrite.
|
||||
The dendrites have some kd, kif and ih current
|
||||
"""
|
||||
nDend = range(2) # these will be simple, unbranced, N=4 dendrites
|
||||
dendrites = []
|
||||
for i in nDend:
|
||||
dendrites.append(h.Section(cell=self.soma))
|
||||
for i in nDend:
|
||||
dendrites[i].connect(self.soma)
|
||||
dendrites[i].L = 250 # length of the dendrite (not tapered)
|
||||
dendrites[i].diam = 1
|
||||
dendrites[i].cm = self.c_m
|
||||
# h('dendrites[i].diam(0:1) = 2:1') # dendrite diameter, with tapering
|
||||
dendrites[i].nseg = 21 # # segments in dendrites
|
||||
dendrites[i].Ra = 150 # ohm.cm
|
||||
dendrites[i].insert("napyr")
|
||||
dendrites[i]().napyr.gbar = 0.00
|
||||
dendrites[i].insert("kdpyr")
|
||||
dendrites[i]().kdpyr.gbar = 0.002 # a little Ht
|
||||
dendrites[i].insert("kif")
|
||||
dendrites[i]().kif.gbar = 0.0001 # a little Ht
|
||||
dendrites[i].insert("leak") # leak
|
||||
dendrites[i]().leak.gbar = 0.00001
|
||||
dendrites[i].insert("ihpyr_adj") # some H current
|
||||
# mechanism missing so the ihvcn mechanism need to be inserted
|
||||
dendrites[i].insert('ihvcn')
|
||||
dendrites[i]().ihvcn.gbar = 0.0 # 0.00002
|
||||
dendrites[i]().ihvcn.eh = -43.0
|
||||
self.maindend = dendrites
|
||||
self.status["dendrites"] = True
|
||||
self.add_section(self.maindend, "maindend")
|
||||
467
cnmodel/cells/sgc.py
Normal file
467
cnmodel/cells/sgc.py
Normal file
@@ -0,0 +1,467 @@
|
||||
from __future__ import print_function
|
||||
from neuron import h
|
||||
from ..util import nstomho
|
||||
from ..util import Params
|
||||
import numpy as np
|
||||
from .cell import Cell
|
||||
from .. import synapses
|
||||
from .. import an_model
|
||||
from .. import data
|
||||
|
||||
__all__ = ["SGC", "SGC_TypeI", "DummySGC"]
|
||||
|
||||
|
||||
class SGC(Cell):
|
||||
type = "sgc"
|
||||
|
||||
@classmethod
|
||||
def create(cls, model="I", species="mouse", **kwds):
|
||||
if model == "dummy":
|
||||
return DummySGC(**kwds)
|
||||
elif model == "I":
|
||||
return SGC_TypeI(species=species, **kwds)
|
||||
else:
|
||||
raise ValueError("SGC model %s is unknown", model)
|
||||
|
||||
def __init__(self, cf=None, sr=None):
|
||||
Cell.__init__(self)
|
||||
self._cf = cf
|
||||
self._sr = sr
|
||||
self.spike_source = None # used by DummySGC to connect VecStim to terminal
|
||||
|
||||
@property
|
||||
def cf(self):
|
||||
""" Center frequency
|
||||
"""
|
||||
return self._cf
|
||||
|
||||
@property
|
||||
def sr(self):
|
||||
""" Spontaneous rate group. 1=low, 2=mid, 3=high
|
||||
"""
|
||||
return self._sr
|
||||
|
||||
def make_terminal(self, post_cell, term_type, **kwds):
|
||||
"""Create a StochasticTerminal and configure it according to the
|
||||
postsynaptic cell type.
|
||||
"""
|
||||
pre_sec = self.soma
|
||||
|
||||
# Return a simple terminal unless a stochastic terminal was requested.
|
||||
if term_type == "simple":
|
||||
return synapses.SimpleTerminal(
|
||||
pre_sec, post_cell, spike_source=self.spike_source, **kwds
|
||||
)
|
||||
elif term_type == "multisite":
|
||||
n_rsites = data.get(
|
||||
"sgc_synapse",
|
||||
species="mouse",
|
||||
post_type=post_cell.type,
|
||||
field="n_rsites",
|
||||
)
|
||||
opts = {"nzones": n_rsites, "delay": 0, "dep_flag": 1}
|
||||
opts.update(kwds)
|
||||
# when created, depflag is set True (1) so that we compute the DKR D*F to get release
|
||||
# this can be modified prior to the run by setting the terminal(s) so that dep_flag is 0
|
||||
# (no DKR: constant release probability)
|
||||
term = synapses.StochasticTerminal(
|
||||
pre_sec, post_cell, spike_source=self.spike_source, **opts
|
||||
)
|
||||
|
||||
kinetics = data.get(
|
||||
"sgc_ampa_kinetics",
|
||||
species="mouse",
|
||||
post_type=post_cell.type,
|
||||
field=["tau_g", "amp_g"],
|
||||
)
|
||||
term.set_params(**kinetics)
|
||||
dynamics = data.get(
|
||||
"sgc_release_dynamics",
|
||||
species="mouse",
|
||||
post_type=post_cell.type,
|
||||
field=["F", "k0", "kmax", "kd", "kf", "taud", "tauf", "dD", "dF"],
|
||||
)
|
||||
term.set_params(**dynamics)
|
||||
return term
|
||||
else:
|
||||
raise ValueError("Unsupported terminal type %s" % term_type)
|
||||
|
||||
|
||||
class DummySGC(SGC):
|
||||
""" SGC class with no cell body; this cell only replays a predetermined
|
||||
spike train.
|
||||
"""
|
||||
|
||||
def __init__(self, cf=None, sr=None, simulator=None):
|
||||
"""
|
||||
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').
|
||||
|
||||
"""
|
||||
self._simulator = simulator
|
||||
SGC.__init__(self, cf, sr)
|
||||
self.vecstim = h.VecStim()
|
||||
|
||||
# this causes the terminal to receive events from the VecStim:
|
||||
self.spike_source = self.vecstim
|
||||
|
||||
# just an empty section for holding the terminal
|
||||
self.add_section(h.Section(), "soma")
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"na": None,
|
||||
"species": None,
|
||||
"modelType": "dummy",
|
||||
"ttx": False,
|
||||
"name": "DummysGC",
|
||||
"morphology": None,
|
||||
"decorator": None,
|
||||
"temperature": None,
|
||||
}
|
||||
|
||||
def set_spiketrain(self, times):
|
||||
""" Set the times of spikes (in seconds) to be replayed by the cell.
|
||||
"""
|
||||
self._spiketrain = times
|
||||
self._stvec = h.Vector(times)
|
||||
self.vecstim.play(self._stvec)
|
||||
|
||||
def set_sound_stim(self, stim, seed, simulator=None):
|
||||
""" Set the sound stimulus used to generate this cell's spike train.
|
||||
"""
|
||||
self._sound_stim = stim
|
||||
spikes = self.generate_spiketrain(stim, seed, simulator)
|
||||
self.set_spiketrain(spikes)
|
||||
|
||||
def generate_spiketrain(self, stim, seed, simulator=None):
|
||||
if simulator is None:
|
||||
simulator = self._simulator
|
||||
spikes = an_model.get_spiketrain(
|
||||
cf=self.cf, sr=self.sr, seed=seed, stim=stim, simulator=simulator
|
||||
)
|
||||
return spikes * 1000
|
||||
|
||||
|
||||
class SGC_TypeI(SGC):
|
||||
"""
|
||||
Spiral ganglion cell model
|
||||
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
morphology=None,
|
||||
decorator=None,
|
||||
nach=None,
|
||||
ttx=False,
|
||||
species="guineapig",
|
||||
modelType="bm",
|
||||
cf=None,
|
||||
sr=None,
|
||||
debug=False,
|
||||
):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
|
||||
"""
|
||||
|
||||
super(SGC_TypeI, self).__init__(cf=cf, sr=sr)
|
||||
if modelType == None:
|
||||
modelType = "bm" # modelTypes are: a (apical), bm (basal middle)
|
||||
if nach == None:
|
||||
nach = "jsrna"
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"na": nach,
|
||||
"species": species,
|
||||
"modelType": modelType,
|
||||
"ttx": ttx,
|
||||
"name": "SGC",
|
||||
"morphology": morphology,
|
||||
"decorator": decorator,
|
||||
"temperature": None,
|
||||
}
|
||||
|
||||
self.i_test_range = {
|
||||
"pulse": [(-0.3, 0.3, 0.02), (-0.03, 0.0, 0.005)]
|
||||
} # include finer range as well
|
||||
self.vrange = [-75.0, -55.0]
|
||||
if morphology is None:
|
||||
"""
|
||||
instantiate a basic soma-only ("point") model
|
||||
"""
|
||||
soma = h.Section(
|
||||
name="SGC_Soma_%x" % id(self)
|
||||
) # one compartment of about 29000 um2
|
||||
soma.nseg = 1
|
||||
self.add_section(soma, "soma")
|
||||
else:
|
||||
"""
|
||||
instantiate a structured model with the morphology as specified by
|
||||
the morphology file
|
||||
"""
|
||||
self.set_morphology(morphology_file=morphology)
|
||||
|
||||
# decorate the morphology with ion channels
|
||||
if decorator is None: # basic model, only on the soma
|
||||
self.mechanisms = [nach, "klt", "kht", "leak"]
|
||||
if modelType == "a":
|
||||
self.mechanisms.append("ihsgcApical")
|
||||
elif modelType == "bm":
|
||||
self.mechanisms.append("ihsgcBasalMiddle")
|
||||
else:
|
||||
raise ValueError("Type %s not known for SGC model" % modelType)
|
||||
for mech in self.mechanisms:
|
||||
self.soma.insert(mech)
|
||||
self.soma.ek = self.e_k
|
||||
self.soma().leak.erev = self.e_leak
|
||||
self.species_scaling(
|
||||
silent=True, species=species, modelType=modelType
|
||||
) # set the default type II cell parameters
|
||||
else: # decorate according to a defined set of rules on all cell compartments
|
||||
self.decorate()
|
||||
self.save_all_mechs() # save all mechanisms inserted, location and gbar values...
|
||||
self.get_mechs(self.soma)
|
||||
if debug:
|
||||
print("<< SGC: Spiral Ganglion Cell created >>")
|
||||
|
||||
def get_cellpars(self, dataset, species="guineapig", celltype="sgc-a"):
|
||||
cellcap = data.get(
|
||||
dataset, species=species, cell_type=celltype, field="soma_Cap"
|
||||
)
|
||||
chtype = data.get(
|
||||
dataset, species=species, cell_type=celltype, field="soma_na_type"
|
||||
)
|
||||
pars = Params(soma_Cap=cellcap, natype=chtype)
|
||||
for g in [
|
||||
"soma_na_gbar",
|
||||
"soma_kht_gbar",
|
||||
"soma_klt_gbar",
|
||||
"soma_ihap_gbar",
|
||||
"soma_ihbm_gbar",
|
||||
"soma_ihap_eh",
|
||||
"soma_ihbm_eh",
|
||||
"soma_leak_gbar",
|
||||
"soma_leak_erev",
|
||||
"soma_e_k",
|
||||
"soma_e_na",
|
||||
]:
|
||||
pars.additem(
|
||||
g, data.get(dataset, species=species, cell_type=celltype, field=g)
|
||||
)
|
||||
return pars
|
||||
|
||||
def species_scaling(self, silent=True, species="guineapig", modelType="a"):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
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.
|
||||
|
||||
"""
|
||||
|
||||
soma = self.soma
|
||||
if modelType == "a":
|
||||
celltype = "sgc-a"
|
||||
elif modelType == "bm":
|
||||
celltype = "sgc-bm"
|
||||
else:
|
||||
raise ValueError("SGC: unrecognized model type %s " % modelType)
|
||||
|
||||
if species == "mouse":
|
||||
self._valid_temperatures = (34.0,)
|
||||
if self.status["temperature"] is None:
|
||||
self.set_temperature(34.0)
|
||||
par = self.get_cellpars(
|
||||
"sgc_mouse_channels", species=species, celltype=celltype
|
||||
)
|
||||
elif species == "guineapig":
|
||||
# guinea pig data from Rothman and Manis, 2003, modelType II
|
||||
self._valid_temperatures = (22.0,)
|
||||
if self.status["temperature"] is None:
|
||||
self.set_temperature(22.0)
|
||||
par = self.get_cellpars(
|
||||
"sgc_guineapig_channels", species=species, celltype=celltype
|
||||
)
|
||||
|
||||
self.set_soma_size_from_Cm(par.soma_Cap)
|
||||
self.adjust_na_chans(soma, gbar=par.soma_na_gbar)
|
||||
soma().kht.gbar = nstomho(par.soma_kht_gbar, self.somaarea)
|
||||
soma().klt.gbar = nstomho(par.soma_klt_gbar, self.somaarea)
|
||||
if celltype == "sgc-a":
|
||||
soma().ihsgcApical.gbar = nstomho(par.soma_ihap_gbar, self.somaarea)
|
||||
soma().ihsgcApical.eh = par.soma_ihap_eh
|
||||
elif celltype == "sgc-bm":
|
||||
soma().ihsgcBasalMiddle.gbar = nstomho(par.soma_ihbm_gbar, self.somaarea)
|
||||
soma().ihsgcBasalMiddle.eh = par.soma_ihbm_eh
|
||||
else:
|
||||
raise ValueError(
|
||||
"Ihsgc modelType %s not recognized for species %s" % (celltype, species)
|
||||
)
|
||||
soma().leak.gbar = nstomho(par.soma_leak_gbar, self.somaarea)
|
||||
soma().leak.erev = par.soma_leak_erev
|
||||
|
||||
self.status["species"] = species
|
||||
self.status["modelType"] = modelType
|
||||
self.check_temperature()
|
||||
if not silent:
|
||||
print("set cell as: ", species)
|
||||
print(" with Vm rest = %f" % self.vm0)
|
||||
|
||||
def adjust_na_chans(self, soma, gbar=1000.0, debug=False):
|
||||
"""
|
||||
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:
|
||||
"""
|
||||
if self.status["ttx"]:
|
||||
gnabar = 0.0
|
||||
else:
|
||||
gnabar = nstomho(gbar, self.somaarea)
|
||||
nach = self.status["na"]
|
||||
if nach == "jsrna":
|
||||
soma().jsrna.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if debug:
|
||||
print("jsrna gbar: ", soma().jsrna.gbar)
|
||||
elif nach == "nav11":
|
||||
soma().nav11.gbar = gnabar * 0.5
|
||||
soma.ena = self.e_na
|
||||
soma().nav11.vsna = 4.3
|
||||
if debug:
|
||||
print("sgc using inva11")
|
||||
print("nav11 gbar: ", soma().nav11.gbar)
|
||||
elif nach in ["na", "nacn"]:
|
||||
soma().na.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if debug:
|
||||
print("na gbar: ", soma().na.gbar)
|
||||
else:
|
||||
raise ValueError("Sodium channel %s is not recognized for SGC cells", nach)
|
||||
|
||||
def i_currents(self, V):
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
for part in self.all_sections.keys():
|
||||
for sec in self.all_sections[part]:
|
||||
sec.v = V
|
||||
|
||||
h.t = 0.0
|
||||
h.celsius = self.status["temperature"]
|
||||
h.finitialize()
|
||||
self.ix = {}
|
||||
if "na" in self.mechanisms:
|
||||
# print dir(self.soma().na)
|
||||
self.ix["na"] = self.soma().na.gna * (V - self.soma().ena)
|
||||
if "jsrna" in self.mechanisms:
|
||||
# print dir(self.soma().na)
|
||||
self.ix["jsrna"] = self.soma().jsrna.gna * (V - self.soma().ena)
|
||||
if "klt" in self.mechanisms:
|
||||
self.ix["klt"] = self.soma().klt.gklt * (V - self.soma().ek)
|
||||
if "kht" in self.mechanisms:
|
||||
self.ix["kht"] = self.soma().kht.gkht * (V - self.soma().ek)
|
||||
if "ihsgcApical" in self.mechanisms:
|
||||
self.ix["ihsgcApical"] = self.soma().ihsgcApical.gh * (
|
||||
V - self.soma().ihsgcApical.eh
|
||||
)
|
||||
if "ihsgcBasalMiddle" in self.mechanisms:
|
||||
self.ix["ihsgcBasalMiddle"] = self.soma().ihsgcBasalMiddle.gh * (
|
||||
V - self.soma().ihsgcBasalMiddle.eh
|
||||
)
|
||||
if "leak" in self.mechanisms:
|
||||
self.ix["leak"] = self.soma().leak.gbar * (V - self.soma().leak.erev)
|
||||
# print self.status['name'], self.status['type'], V, self.ix
|
||||
return np.sum([self.ix[i] for i in self.ix])
|
||||
3
cnmodel/cells/tests/cell_data/SGC_rat_a.pk
Normal file
3
cnmodel/cells/tests/cell_data/SGC_rat_a.pk
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2e60518d0332cd475f67e13e8f85e23b1b60dda4f252620b495bdfbc5dab43fe
|
||||
size 7826
|
||||
3
cnmodel/cells/tests/cell_data/SGC_rat_bm.pk
Normal file
3
cnmodel/cells/tests/cell_data/SGC_rat_bm.pk
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f0814086d71479adab9326978620e1af0ed153fdfc2c6f4fa0d2213c0b80131b
|
||||
size 7729
|
||||
3
cnmodel/cells/tests/cell_data/bushy-mouse-typeII.pk
Normal file
3
cnmodel/cells/tests/cell_data/bushy-mouse-typeII.pk
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5dbd4717983175a81d362bd01015cb28baa145d78c6c460dd7ec6456f9f46e72
|
||||
size 8103
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:34fbddf52a61283bd29622fe87e1fc8afc6f46160cdce3f0cdd581f89bfeba35
|
||||
size 7963
|
||||
3
cnmodel/cells/tests/cell_data/bushy_guineapig-typeII.pk
Normal file
3
cnmodel/cells/tests/cell_data/bushy_guineapig-typeII.pk
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:de245b95e0b1f66680ed1f79bc31739bce36aed9edd044d02b6effbd645e948e
|
||||
size 8160
|
||||
3
cnmodel/cells/tests/cell_data/cartwheel_rat_I.pk
Normal file
3
cnmodel/cells/tests/cell_data/cartwheel_rat_I.pk
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0f7c79982ffa921ba17690de6b31ff27be75936acde0fa72b5d52e0e4abc54da
|
||||
size 5506
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:de64e933070f7c216d8f632cb56ee32b346bba282c24f453f818c686439b772a
|
||||
size 8710
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0e713ac67a7211e4d78c846bd8bdda4b738c49d5c50fb61c1974f12d45341937
|
||||
size 9506
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e86a6fb8651d0ed0a33e30273d49b8358436bf169899ee9d2bcda454f450225e
|
||||
size 7747
|
||||
3
cnmodel/cells/tests/cell_data/pyramidal_rat_I.pk
Normal file
3
cnmodel/cells/tests/cell_data/pyramidal_rat_I.pk
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8ebe0523b9260f3b9a87fc6e535f38cb8f0b5840aea056fe8764943883782db7
|
||||
size 16581
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a2536a5ca43d2f46fa6e6bf786d520ac12815b742896a3272a227660a91fc2c1
|
||||
size 7863
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fa5ddc40011269d7e4d00d70ac3053bd4d2d88293db5f8d6f9ae8225c3ed1bdc
|
||||
size 8182
|
||||
3
cnmodel/cells/tests/cell_data/tstellate_mouse-typeI-c.pk
Normal file
3
cnmodel/cells/tests/cell_data/tstellate_mouse-typeI-c.pk
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2990652711db28fa846886f1399faecb4d4680fd8014cbc006636c215248263d
|
||||
size 14815
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9f50fb610552b181dfd0130245ee41bcbe745d4fc856abfe7f5ad180e84773a5
|
||||
size 13267
|
||||
227
cnmodel/cells/tests/test_cells.py
Normal file
227
cnmodel/cells/tests/test_cells.py
Normal file
@@ -0,0 +1,227 @@
|
||||
import os, pickle, pprint
|
||||
import numpy as np
|
||||
import neuron
|
||||
|
||||
import cnmodel
|
||||
import cnmodel.cells as cells
|
||||
from cnmodel.util import UserTester, reset
|
||||
from cnmodel.protocols import IVCurve
|
||||
|
||||
"""
|
||||
Cell-type tests
|
||||
"""
|
||||
|
||||
|
||||
def test_bushy():
|
||||
reset(raiseError=False)
|
||||
cell = cells.Bushy.create(species="guineapig", modelType="II")
|
||||
CellTester("bushy_guineapig-typeII", cell)
|
||||
|
||||
|
||||
def test_bushy21():
|
||||
reset(raiseError=False)
|
||||
cell = cells.Bushy.create(species="guineapig", modelType="II-I")
|
||||
CellTester("bushy_guineapig-typeII-I", cell)
|
||||
|
||||
|
||||
def test_bushy_mouse():
|
||||
reset(raiseError=False)
|
||||
cell = cells.Bushy.create(species="mouse", modelType="II")
|
||||
CellTester("bushy-mouse-typeII", cell)
|
||||
|
||||
|
||||
def test_tstellate():
|
||||
reset(raiseError=False)
|
||||
cell = cells.TStellate.create(species="guineapig", modelType="I-c")
|
||||
CellTester("tstellate_guineapig-typeI-c", cell)
|
||||
|
||||
|
||||
def test_tstellate_mouse():
|
||||
reset(raiseError=False)
|
||||
cell = cells.TStellate.create(species="mouse", modelType="I-c")
|
||||
CellTester("tstellate_mouse-typeI-c", cell)
|
||||
|
||||
|
||||
def test_tstellatet():
|
||||
reset(raiseError=False)
|
||||
cell = cells.TStellate.create(species="guineapig", modelType="I-t")
|
||||
CellTester("tstellate_guineapig-typeI-t", cell)
|
||||
|
||||
|
||||
# not implemented yet
|
||||
# def test_tstellatet_mouse():
|
||||
# reset(raiseError=False)
|
||||
# cell = cells.TStellate.create(species='mouse', modelType='I-t')
|
||||
# CellTester('tstellate_mouse-typeI-t', cell)
|
||||
|
||||
|
||||
def test_dstellate():
|
||||
reset(raiseError=False)
|
||||
cell = cells.DStellate.create(species="guineapig", modelType="I-II")
|
||||
CellTester("dstellate_guineapig-typeI-II", cell)
|
||||
|
||||
|
||||
def test_dstellate_mouse():
|
||||
reset(raiseError=False)
|
||||
cell = cells.DStellate.create(species="mouse", modelType="I-II")
|
||||
CellTester("dstellate_mouse-typeI-II", cell)
|
||||
|
||||
|
||||
def test_octopus():
|
||||
reset(raiseError=False)
|
||||
cell = cells.Octopus.create(species="guineapig", modelType="II-o")
|
||||
CellTester("octopus_guineapig-typeII-o", cell)
|
||||
|
||||
|
||||
def test_pyramidal():
|
||||
reset(raiseError=False)
|
||||
cell = cells.Pyramidal.create(species="rat", modelType="I")
|
||||
CellTester("pyramidal_rat_I", cell)
|
||||
|
||||
|
||||
def test_tuberculoventral():
|
||||
reset(raiseError=False)
|
||||
cell = cells.Tuberculoventral.create(species="mouse", modelType="TVmouse")
|
||||
CellTester("tuberculoventral_mouse_I", cell)
|
||||
|
||||
|
||||
def test_cartwheel():
|
||||
reset(raiseError=False)
|
||||
cell = cells.Cartwheel.create(species="mouse", modelType="I")
|
||||
CellTester("cartwheel_rat_I", cell)
|
||||
|
||||
|
||||
def test_sgc_basal_middle():
|
||||
reset(raiseError=False)
|
||||
cell = cells.SGC.create(species="mouse", modelType="bm")
|
||||
CellTester("SGC_rat_bm", cell)
|
||||
|
||||
|
||||
def test_sgc_apical():
|
||||
reset(raiseError=False)
|
||||
cell = cells.SGC.create(species="mouse", modelType="a")
|
||||
CellTester("SGC_rat_a", cell)
|
||||
|
||||
|
||||
#
|
||||
# Supporting functions
|
||||
#
|
||||
|
||||
|
||||
class CellTester(UserTester):
|
||||
data_dir = "cell_data"
|
||||
|
||||
def run_test(self, cell):
|
||||
# run I/V test on cell
|
||||
V0 = cell.find_i0(showinfo=True)
|
||||
rmrintau = cell.compute_rmrintau(auto_initialize=False, vrange=None)
|
||||
iv = IVCurve()
|
||||
self.iv = iv
|
||||
iv.run(cell.i_test_range, cell)
|
||||
if self.audit:
|
||||
iv.show(cell)
|
||||
|
||||
info = dict(
|
||||
temp=iv.temp,
|
||||
icmd=iv.current_cmd,
|
||||
spikes=iv.spike_times(),
|
||||
rmp=iv.rest_vm(),
|
||||
rm_taum=iv.input_resistance_tau(),
|
||||
vpeak=iv.peak_vm(),
|
||||
vss=iv.steady_vm(),
|
||||
rmrintau=rmrintau,
|
||||
)
|
||||
return info
|
||||
|
||||
def assert_test_info(self, *args, **kwds):
|
||||
try:
|
||||
super(CellTester, self).assert_test_info(*args, **kwds)
|
||||
finally:
|
||||
if hasattr(self, "iv") and hasattr(self.iv, "win"):
|
||||
self.iv.win.hide()
|
||||
|
||||
|
||||
# def result_file(key):
|
||||
# """
|
||||
# Return a file name to be used for storing / retrieving test results
|
||||
# given *key*.
|
||||
# """
|
||||
# path = os.path.dirname(__file__)
|
||||
# return os.path.join(path, 'cell_data', key + '.pk')
|
||||
|
||||
# def load_cell_info(key):
|
||||
# """
|
||||
# Load prior test results for *key*.
|
||||
# If there are no prior results, return None.
|
||||
# """
|
||||
# fn = result_file(key)
|
||||
# if os.path.isfile(fn):
|
||||
# return pickle.load(open(fn, 'rb'))
|
||||
# return None
|
||||
|
||||
# def save_cell_info(info, key):
|
||||
# """
|
||||
# Store test results for *key*.
|
||||
# """
|
||||
# fn = result_file(key)
|
||||
# dirname = os.path.dirname(fn)
|
||||
# if not os.path.isdir(dirname):
|
||||
# os.mkdir(dirname)
|
||||
# pickle.dump(info, open(fn, 'wb'))
|
||||
|
||||
|
||||
# The following is superseeded by the built in unit tests.
|
||||
# def CellTester(key):
|
||||
# """
|
||||
# Test *cell* and raise exception if the results do not match prior
|
||||
# data.
|
||||
# """
|
||||
# audit = cnmodel.AUDIT_TESTS
|
||||
|
||||
## run I/V test on cell
|
||||
# iv = IVCurve()
|
||||
# iv.run(cell.i_test_range, cell)
|
||||
# iv.show(cell)
|
||||
|
||||
# try:
|
||||
# info = dict(
|
||||
# icmd=iv.current_cmd,
|
||||
# spikes=iv.spike_times(),
|
||||
# rmp=iv.rest_vm(),
|
||||
# rm=iv.input_resistance(),
|
||||
# vpeak=iv.peak_vm(),
|
||||
# vss=iv.steady_vm(),
|
||||
# )
|
||||
|
||||
# expect = load_cell_info(key)
|
||||
|
||||
# if expect is not None:
|
||||
|
||||
## Check test structures are the same
|
||||
# assert len(info) == len(expect)
|
||||
# for k in info:
|
||||
# assert k in expect
|
||||
|
||||
## Check data matches
|
||||
# for k in info:
|
||||
# if isinstance(info[k], list):
|
||||
# assert len(info[k]) == len(expect[k])
|
||||
# for i in range(len(info[k])):
|
||||
# assert np.allclose(info[k][i], expect[k][i])
|
||||
# else:
|
||||
# assert np.allclose(info[k], expect[k])
|
||||
# else:
|
||||
# if not audit:
|
||||
# raise Exception("No prior test results for cell type '%s'. "
|
||||
# "Run test.py --audit store new test data." % key)
|
||||
|
||||
# print "\n=== New test results for %s: ===\n" % key
|
||||
# pprint.pprint(info)
|
||||
# print "Store new test results? [y/n]",
|
||||
# yn = raw_input()
|
||||
# if yn.lower().startswith('y'):
|
||||
# save_cell_info(info, key)
|
||||
# else:
|
||||
# raise Exception("Rejected test results for '%s'" % key)
|
||||
# finally:
|
||||
# iv.win.hide()
|
||||
1089
cnmodel/cells/tstellate.py
Normal file
1089
cnmodel/cells/tstellate.py
Normal file
File diff suppressed because it is too large
Load Diff
619
cnmodel/cells/tuberculoventral.py
Normal file
619
cnmodel/cells/tuberculoventral.py
Normal file
@@ -0,0 +1,619 @@
|
||||
from __future__ import print_function
|
||||
from neuron import h
|
||||
import numpy as np
|
||||
|
||||
# import neuron as nrn
|
||||
|
||||
from .cell import Cell
|
||||
from .. import synapses
|
||||
from ..util import nstomho
|
||||
from ..util import Params
|
||||
from .. import data
|
||||
|
||||
__all__ = ["Tuberculoventral"]
|
||||
|
||||
|
||||
class Tuberculoventral(Cell):
|
||||
|
||||
type = "tuberculoventral"
|
||||
|
||||
@classmethod
|
||||
def create(cls, model="TVmouse", **kwds):
|
||||
if model in ["TVmouse", "I"]:
|
||||
return Tuberculoventral(**kwds)
|
||||
elif model == "dummy":
|
||||
return DummyTuberculoventral(**kwds)
|
||||
else:
|
||||
raise ValueError("Tuberculoventral type %s is unknown", model)
|
||||
|
||||
def __init__(self):
|
||||
Cell.__init__(self)
|
||||
self.spike_source = (
|
||||
None
|
||||
) # used by DummyTuberculoventral to connect VecStim to terminal
|
||||
|
||||
def make_psd(self, terminal, psd_type, **kwds):
|
||||
"""
|
||||
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
|
||||
|
||||
"""
|
||||
if (
|
||||
"postsite" in kwds
|
||||
): # use a defined location instead of the default (soma(0.5)
|
||||
postsite = kwds["postsite"]
|
||||
loc = postsite[1] # where on the section?
|
||||
uname = (
|
||||
"sections[%d]" % postsite[0]
|
||||
) # make a name to look up the neuron section object
|
||||
post_sec = self.hr.get_section(uname) # Tell us where to put the synapse.
|
||||
else:
|
||||
loc = 0.5
|
||||
post_sec = self.soma
|
||||
|
||||
if psd_type == "simple":
|
||||
if terminal.cell.type in ["sgc", "dstellate", "tuberculoventral"]:
|
||||
weight = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="weight",
|
||||
)
|
||||
tau1 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau1",
|
||||
)
|
||||
tau2 = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="tau2",
|
||||
)
|
||||
erev = data.get(
|
||||
"%s_synapse" % terminal.cell.type,
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="erev",
|
||||
)
|
||||
return self.make_exp2_psd(
|
||||
post_sec,
|
||||
terminal,
|
||||
weight=weight,
|
||||
loc=loc,
|
||||
tau1=tau1,
|
||||
tau2=tau2,
|
||||
erev=erev,
|
||||
)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make simple PSD for %s => %s"
|
||||
% (terminal.cell.type, self.type)
|
||||
)
|
||||
|
||||
elif psd_type == "multisite":
|
||||
if terminal.cell.type == "sgc":
|
||||
# Max conductances for the glu mechanisms are calibrated by
|
||||
# running `synapses/tests/test_psd.py`. The test should fail
|
||||
# if these values are incorrect
|
||||
self.AMPAR_gmax = (
|
||||
data.get(
|
||||
"sgc_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="AMPAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.NMDAR_gmax = (
|
||||
data.get(
|
||||
"sgc_synapse",
|
||||
species=self.species,
|
||||
post_type=self.type,
|
||||
field="NMDAR_gmax",
|
||||
)
|
||||
* 1e3
|
||||
)
|
||||
self.Pr = data.get(
|
||||
"sgc_synapse", species=self.species, post_type=self.type, field="Pr"
|
||||
)
|
||||
# adjust gmax to correct for initial Pr
|
||||
self.AMPAR_gmax = self.AMPAR_gmax / self.Pr
|
||||
self.NMDAR_gmax = self.NMDAR_gmax / self.Pr
|
||||
if "AMPAScale" in kwds:
|
||||
self.AMPA_gmax = (
|
||||
self.AMPA_gmax * kwds["AMPAScale"]
|
||||
) # allow scaling of AMPA conductances
|
||||
if "NMDAScale" in kwds:
|
||||
self.NMDA_gmax = self.NMDA_gmax * kwds["NMDAScale"]
|
||||
return self.make_glu_psd(
|
||||
post_sec, terminal, self.AMPAR_gmax, self.NMDAR_gmax, loc=loc
|
||||
)
|
||||
elif terminal.cell.type == "dstellate": # WBI input -Voigt, Nelken, Young
|
||||
return self.make_gly_psd(post_sec, terminal, psdtype="glyfast", loc=loc)
|
||||
elif (
|
||||
terminal.cell.type == "tuberculoventral"
|
||||
): # TV cells talk to each other-Kuo et al.
|
||||
return self.make_gly_psd(post_sec, terminal, psdtype="glyfast", loc=loc)
|
||||
else:
|
||||
raise TypeError(
|
||||
"Cannot make PSD for %s => %s" % (terminal.cell.type, self.type)
|
||||
)
|
||||
else:
|
||||
raise ValueError("Unsupported psd type %s" % psd_type)
|
||||
|
||||
def make_terminal(self, post_cell, term_type, **kwds):
|
||||
pre_sec = self.soma
|
||||
if term_type == "simple":
|
||||
return synapses.SimpleTerminal(
|
||||
pre_sec, post_cell, spike_source=self.spike_source, **kwds
|
||||
)
|
||||
elif term_type == "multisite":
|
||||
if post_cell.type in [
|
||||
"dstellate",
|
||||
"tuberculoventral",
|
||||
"pyramidal",
|
||||
"bushy",
|
||||
"tstellate",
|
||||
]:
|
||||
nzones = data.get(
|
||||
"tuberculoventral_synapse",
|
||||
species=self.species,
|
||||
post_type=post_cell.type,
|
||||
field="n_rsites",
|
||||
)
|
||||
delay = data.get(
|
||||
"tuberculoventral_synapse",
|
||||
species=self.species,
|
||||
post_type=post_cell.type,
|
||||
field="delay",
|
||||
)
|
||||
else:
|
||||
raise NotImplementedError(
|
||||
"No knowledge as to how to connect tuberculoventral cell to cell type %s"
|
||||
% type(post_cell)
|
||||
)
|
||||
pre_sec = self.soma
|
||||
return synapses.StochasticTerminal(
|
||||
pre_sec,
|
||||
post_cell,
|
||||
nzones=nzones,
|
||||
spike_source=self.spike_source,
|
||||
delay=delay,
|
||||
**kwds
|
||||
)
|
||||
else:
|
||||
raise ValueError("Unsupported terminal type %s" % term_type)
|
||||
|
||||
|
||||
class Tuberculoventral(Tuberculoventral):
|
||||
"""
|
||||
Tuberculoventral Neuron (DCN) base model
|
||||
Adapted from T-stellate model, using target parameters from Kuo et al. J. Neurophys. 2012
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
morphology=None,
|
||||
decorator=None,
|
||||
nach=None,
|
||||
ttx=False,
|
||||
species="mouse",
|
||||
modelType=None,
|
||||
debug=False,
|
||||
):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
"""
|
||||
super(Tuberculoventral, self).__init__()
|
||||
if modelType == None:
|
||||
modelType = "TVmouse"
|
||||
if nach == None:
|
||||
nach = "nacncoop"
|
||||
self.debug = debug
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"na": nach,
|
||||
"species": species,
|
||||
"modelType": modelType,
|
||||
"ttx": ttx,
|
||||
"name": "Tuberculoventral",
|
||||
"morphology": morphology,
|
||||
"decorator": decorator,
|
||||
"temperature": None,
|
||||
}
|
||||
|
||||
self.i_test_range = {"pulse": [(-0.35, 1.0, 0.05), (-0.04, 0.01, 0.01)]}
|
||||
self.vrange = [-80.0, -60.0] # set a default vrange for searching for rmp
|
||||
|
||||
if morphology is None:
|
||||
"""
|
||||
instantiate a basic soma-only ("point") model
|
||||
"""
|
||||
if self.debug:
|
||||
print("<< Tuberculoventral model: Creating point cell >>")
|
||||
soma = h.Section(
|
||||
name="Tuberculoventral_Soma_%x" % id(self)
|
||||
) # one compartment of about 29000 um2
|
||||
soma.nseg = 1
|
||||
self.add_section(soma, "soma")
|
||||
else:
|
||||
"""
|
||||
instantiate a structured model with the morphology as specified by
|
||||
the morphology file
|
||||
"""
|
||||
if self.debug:
|
||||
print("<< Tuberculoventral model: Creating structured cell >>")
|
||||
self.set_morphology(morphology_file=morphology)
|
||||
|
||||
# decorate the morphology with ion channels
|
||||
if decorator is None: # basic model, only on the soma
|
||||
self.mechanisms = ["kht", "ka", "ihvcn", "leak", nach]
|
||||
for mech in self.mechanisms:
|
||||
self.soma.insert(mech)
|
||||
self.species_scaling(
|
||||
silent=True, species=species, modelType=modelType
|
||||
) # adjust the default parameters
|
||||
else: # decorate according to a defined set of rules on all cell compartments
|
||||
self.decorate()
|
||||
self.save_all_mechs() # save all mechanisms inserted, location and gbar values...
|
||||
self.get_mechs(self.soma)
|
||||
if self.debug:
|
||||
print("<< Tuberculoventral cell model created >>")
|
||||
|
||||
def get_cellpars(self, dataset, species="mouse", celltype="TVmouse"):
|
||||
cellcap = data.get(
|
||||
dataset, species=species, cell_type=celltype, field="soma_Cap"
|
||||
)
|
||||
chtype = data.get(
|
||||
dataset, species=species, cell_type=celltype, field="soma_na_type"
|
||||
)
|
||||
pars = Params(soma_cap=cellcap, soma_na_type=chtype)
|
||||
for g in [
|
||||
"soma_nacncoop_gbar",
|
||||
"soma_kht_gbar",
|
||||
"soma_ka_gbar",
|
||||
"soma_ihvcn_gbar",
|
||||
"soma_ihvcn_eh",
|
||||
"soma_leak_gbar",
|
||||
"soma_leak_erev",
|
||||
"soma_e_k",
|
||||
"soma_e_na",
|
||||
]:
|
||||
pars.additem(
|
||||
g, data.get(dataset, species=species, cell_type=celltype, field=g)
|
||||
)
|
||||
return pars
|
||||
|
||||
def species_scaling(self, species="guineapig", modelType="TVmouse", silent=True):
|
||||
"""
|
||||
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)
|
||||
"""
|
||||
soma = self.soma
|
||||
if self.debug:
|
||||
print("modelType: ", modelType)
|
||||
if modelType in ["TVmouse", "I"]:
|
||||
celltype = "TVmouse" # modelType
|
||||
modelType = "TVmouse"
|
||||
else:
|
||||
raise ValueError(
|
||||
"Tuberuloventral: Model type %s not recognized" % modelType
|
||||
)
|
||||
|
||||
if species == "mouse" and modelType in ["TVmouse", "I"]:
|
||||
"""#From Kuo 150 Mohm, 10 msec tau
|
||||
Firing at 600 pA about 400 Hz
|
||||
These values from brute_force runs, getting 380 Hz at 600 pA at 35C
|
||||
Input resistance and vm is ok, time constnat is short
|
||||
*** Rin: 168 tau: 7.8 v: -68.4
|
||||
Attempts to get longer time constant - cannot keep rate up.
|
||||
"""
|
||||
# Adapted from TStellate model type I-c'
|
||||
self.vrange = [-80.0, -58.0]
|
||||
self._valid_temperatures = (34.0,)
|
||||
if self.status["temperature"] is None:
|
||||
self.set_temperature(34.0)
|
||||
|
||||
pars = self.get_cellpars("TV_channels", species="mouse", celltype=modelType)
|
||||
self.set_soma_size_from_Cm(pars.soma_cap)
|
||||
self.status["na"] = pars.soma_na_type
|
||||
self.adjust_na_chans(soma, gbar=pars.soma_nacncoop_gbar, debug=self.debug)
|
||||
soma().kht.gbar = nstomho(pars.soma_kht_gbar, self.somaarea)
|
||||
soma().ka.gbar = nstomho(pars.soma_ka_gbar, self.somaarea)
|
||||
soma().ihvcn.gbar = nstomho(pars.soma_ihvcn_gbar, self.somaarea)
|
||||
soma().ihvcn.eh = pars.soma_ihvcn_eh
|
||||
soma().leak.gbar = nstomho(pars.soma_leak_gbar, self.somaarea)
|
||||
soma().leak.erev = pars.soma_leak_erev
|
||||
self.e_leak = pars.soma_leak_erev
|
||||
self.soma.ek = self.e_k = pars.soma_e_k
|
||||
self.soma.ena = self.e_na = pars.soma_e_na
|
||||
|
||||
self.axonsf = 0.5
|
||||
else:
|
||||
raise ValueError(
|
||||
"Species %s or species-type %s is not recognized for Tuberculoventralcells"
|
||||
% (species, type)
|
||||
)
|
||||
|
||||
self.status["species"] = species
|
||||
self.status["modelType"] = modelType
|
||||
self.check_temperature()
|
||||
|
||||
def channel_manager(self, modelType="TVmouse"):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
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.
|
||||
|
||||
"""
|
||||
if modelType == "TVmouse":
|
||||
print("decorate as tvmouse")
|
||||
# totcap = 95.0E-12 # Tuberculoventral cell (type I), based on stellate, adjusted for Kuo et al. TV firing
|
||||
self.set_soma_size_from_Section(self.soma)
|
||||
totcap = self.totcap
|
||||
refarea = self.somaarea # totcap / self.c_m # see above for units
|
||||
self.gBar = Params(
|
||||
nabar=1520.0e-9 / refarea,
|
||||
khtbar=160.0e-9 / refarea,
|
||||
kltbar=0.0e-9 / refarea,
|
||||
kabar=65.0 / refarea,
|
||||
ihbar=1.25e-9 / refarea,
|
||||
leakbar=5.5e-9 / refarea,
|
||||
)
|
||||
self.channelMap = {
|
||||
"axon": {
|
||||
"nacn": 0.0,
|
||||
"klt": 0.0,
|
||||
"kht": self.gBar.khtbar,
|
||||
"ihvcn": 0.0,
|
||||
"leak": self.gBar.leakbar / 4.0,
|
||||
},
|
||||
"hillock": {
|
||||
"nacn": self.gBar.nabar,
|
||||
"klt": 0.0,
|
||||
"kht": self.gBar.khtbar,
|
||||
"ihvcn": 0.0,
|
||||
"leak": self.gBar.leakbar,
|
||||
},
|
||||
"initseg": {
|
||||
"nacn": self.gBar.nabar,
|
||||
"klt": 0.0,
|
||||
"kht": self.gBar.khtbar,
|
||||
"ihvcn": self.gBar.ihbar / 2.0,
|
||||
"leak": self.gBar.leakbar,
|
||||
},
|
||||
"soma": {
|
||||
"nacn": self.gBar.nabar,
|
||||
"klt": self.gBar.kltbar,
|
||||
"kht": self.gBar.khtbar,
|
||||
"ihvcn": self.gBar.ihbar,
|
||||
"leak": self.gBar.leakbar,
|
||||
},
|
||||
"dend": {
|
||||
"nacn": self.gBar.nabar / 2.0,
|
||||
"klt": 0.0,
|
||||
"kht": self.gBar.khtbar * 0.5,
|
||||
"ihvcn": self.gBar.ihbar / 3.0,
|
||||
"leak": self.gBar.leakbar * 0.5,
|
||||
},
|
||||
"apic": {
|
||||
"nacn": 0.0,
|
||||
"klt": 0.0,
|
||||
"kht": self.gBar.khtbar * 0.2,
|
||||
"ihvcn": self.gBar.ihbar / 4.0,
|
||||
"leak": self.gBar.leakbar * 0.2,
|
||||
},
|
||||
}
|
||||
self.irange = np.linspace(-0.3, 0.6, 10)
|
||||
self.distMap = {
|
||||
"dend": {
|
||||
"klt": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
"kht": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
}, # linear with distance, gminf (factor) is multiplied by gbar
|
||||
"apic": {
|
||||
"klt": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
"kht": {"gradient": "linear", "gminf": 0.0, "lambda": 100.0},
|
||||
}, # gradients are: flat, linear, exponential
|
||||
}
|
||||
else:
|
||||
raise ValueError("model type %s is not implemented" % modelType)
|
||||
|
||||
def adjust_na_chans(self, soma, gbar=1000.0, debug=False):
|
||||
"""
|
||||
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
|
||||
-------
|
||||
Nothing
|
||||
"""
|
||||
if self.status["ttx"]:
|
||||
gnabar = 0.0
|
||||
else:
|
||||
gnabar = nstomho(gbar, self.somaarea)
|
||||
nach = self.status["na"]
|
||||
if nach == "nacncoop":
|
||||
soma().nacncoop.gbar = gnabar
|
||||
soma().nacncoop.KJ = 2000.0
|
||||
soma().nacncoop.p = 0.25
|
||||
soma.ena = self.e_na
|
||||
if debug:
|
||||
print("nacncoop gbar: ", soma().nacncoop.gbar)
|
||||
elif nach == "jsrna":
|
||||
soma().jsrna.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if debug:
|
||||
print("jsrna gbar: ", soma().jsrna.gbar)
|
||||
elif nach == "nav11":
|
||||
soma().nav11.gbar = gnabar * 0.5
|
||||
soma.ena = self.e_na
|
||||
soma().nav11.vsna = 4.3
|
||||
if debug:
|
||||
print("Tuberculoventral using inva11")
|
||||
print("nav11 gbar: ", soma().nav11.gbar)
|
||||
elif nach == "na":
|
||||
soma().na.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if debug:
|
||||
print("na gbar: ", soma().na.gbar)
|
||||
elif nach == "nacn":
|
||||
soma().nacn.gbar = gnabar
|
||||
soma.ena = self.e_na
|
||||
if debug:
|
||||
print("nacn gbar: ", soma().nacn.gbar)
|
||||
else:
|
||||
raise ValueError(
|
||||
"Tuberculoventral setting Na channels: channel %s not known" % nach
|
||||
)
|
||||
|
||||
|
||||
class DummyTuberculoventral(Tuberculoventral):
|
||||
""" Tuberculoventral cell class with no cell body; this cell only replays a predetermined
|
||||
spike train. Useful for testing, or replacing spike trains to determine
|
||||
the importance of spike structures within a network.
|
||||
"""
|
||||
|
||||
def __init__(self, cf=None, species="mouse"):
|
||||
"""
|
||||
Parameters
|
||||
----------
|
||||
cf : float (default: None)
|
||||
Required: the characteristic frequency for the TV cell
|
||||
Really just for reference.
|
||||
|
||||
"""
|
||||
|
||||
Tuberculoventral.__init__(self)
|
||||
self.vecstim = h.VecStim()
|
||||
|
||||
# this causes the terminal to receive events from the VecStim:
|
||||
self.spike_source = self.vecstim
|
||||
|
||||
# just an empty section for holding the terminal
|
||||
self.add_section(h.Section(), "soma")
|
||||
self.status = {
|
||||
"soma": True,
|
||||
"axon": False,
|
||||
"dendrites": False,
|
||||
"pumps": False,
|
||||
"na": None,
|
||||
"species": species,
|
||||
"modelType": "Dummy",
|
||||
"modelName": "DummyTuberculoventral",
|
||||
"ttx": None,
|
||||
"name": "DummyTuberculoventral",
|
||||
"morphology": None,
|
||||
"decorator": None,
|
||||
"temperature": None,
|
||||
}
|
||||
print("<< Tuberculoventral: Dummy Tuberculoventral Cell created >>")
|
||||
|
||||
def set_spiketrain(self, times):
|
||||
""" Set the times of spikes (in seconds) to be replayed by the cell.
|
||||
"""
|
||||
self._spiketrain = times
|
||||
self._stvec = h.Vector(times)
|
||||
self.vecstim.play(self._stvec)
|
||||
23
cnmodel/custom_init.hoc
Executable file
23
cnmodel/custom_init.hoc
Executable file
@@ -0,0 +1,23 @@
|
||||
INITDUR = 100 // # ms to reach steady state
|
||||
DTSTEP = 0.1
|
||||
proc init() { local temp
|
||||
//print "Using Custom Init"
|
||||
finitialize(v_init)
|
||||
t = -2*INITDUR // jump to a time "before" 0
|
||||
temp = cvode.active()
|
||||
if (temp != 0) { // if cvode is on, turn it off
|
||||
cvode.active(0)
|
||||
dt = DTSTEP
|
||||
}
|
||||
while (t < -INITDUR) {
|
||||
fadvance()
|
||||
}
|
||||
if (temp != 0) { cvode.active(1) } // turn cvode back on if necessary
|
||||
t = 0
|
||||
if (cvode.active()) {
|
||||
cvode.re_init()
|
||||
} else {
|
||||
fcurrent()
|
||||
}
|
||||
frecord_init()
|
||||
}
|
||||
18
cnmodel/data/__init__.py
Normal file
18
cnmodel/data/__init__.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
The cnmodel.data package contains information about ion channel densities,
|
||||
connectivity, synaptic properties, and population distributions. These values
|
||||
are used by the Cell, Synapse, Population, and related classes to determine
|
||||
all model construction parameters.
|
||||
|
||||
Values are stored in python strings that contain human-readable tables with
|
||||
provenance documentation.
|
||||
"""
|
||||
|
||||
|
||||
from ._db import get, get_source, add_table_data, report_changes, setval
|
||||
|
||||
|
||||
from . import connectivity
|
||||
from . import synapses
|
||||
from . import populations
|
||||
from . import ionchannels
|
||||
321
cnmodel/data/_db.py
Normal file
321
cnmodel/data/_db.py
Normal file
@@ -0,0 +1,321 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
from __future__ import print_function
|
||||
from collections import OrderedDict
|
||||
import re
|
||||
|
||||
|
||||
# Unified collection point for all empirically-determined biophysical
|
||||
# values. Each value is a tuple (val, source).
|
||||
DATA = OrderedDict()
|
||||
|
||||
|
||||
def get(*args, **kwds):
|
||||
""" Get a single value from the database using the supplied arguments
|
||||
to query.
|
||||
|
||||
Optionally, one keyword argument may be a list of values, in which case
|
||||
a dict will be returned containing {listval: dbval} pairs for each value in
|
||||
the list.
|
||||
"""
|
||||
return _lookup(0, *args, **kwds)
|
||||
|
||||
|
||||
def get_source(*args, **kwds):
|
||||
""" Get the source of a single value from the database using the supplied
|
||||
arguments to query.
|
||||
|
||||
Optionally, one keyword argument may be a list of values, in which case
|
||||
a dict will be returned containing {listval: dbval} pairs for each value in
|
||||
the list.
|
||||
"""
|
||||
return _lookup(1, *args, **kwds)
|
||||
|
||||
|
||||
def print_table(table):
|
||||
for k in DATA.keys():
|
||||
if table == k[0]:
|
||||
print("data key: ", k)
|
||||
print(DATA[k][0])
|
||||
|
||||
|
||||
def get_table_info(table):
|
||||
"""
|
||||
Return a dictionary of row and column names in the table
|
||||
"""
|
||||
tinfo = {}
|
||||
for k in DATA.keys():
|
||||
if table == k[0]:
|
||||
for p in k:
|
||||
if not isinstance(p, tuple):
|
||||
continue
|
||||
if p[0] not in tinfo.keys():
|
||||
tinfo[p[0]] = []
|
||||
if p[1] not in tinfo[p[0]]:
|
||||
tinfo[p[0]].append(p[1])
|
||||
return tinfo
|
||||
|
||||
|
||||
def _lookup(ind, *args, **kwds):
|
||||
key = mk_key(*args, **kwds)
|
||||
if isinstance(key, dict):
|
||||
data = {}
|
||||
for k, key in key.items():
|
||||
data[k] = DATA[key][ind]
|
||||
return data
|
||||
else:
|
||||
return DATA[key][ind]
|
||||
|
||||
|
||||
def setval(val, *args, **kwds):
|
||||
key = mk_key(*args, **kwds)
|
||||
oldval = None
|
||||
# change_flag = False
|
||||
if key in DATA:
|
||||
# change_flag = True # any attempt to change key will set this
|
||||
oldval = DATA[key] # save the previous stored value
|
||||
# raise RuntimeError("Data key '%s' has already been set." % str(key))
|
||||
DATA[key] = val
|
||||
return oldval
|
||||
|
||||
|
||||
def mk_key(*args, **kwds):
|
||||
# Make a unique key (or list of keys) used to access values from the
|
||||
# database. The generated key is independent of the order that arguments
|
||||
# are specified.
|
||||
#
|
||||
# Optionally, one keyword argument may have a list of values, in which case
|
||||
# the function will return a dict containing {listval: key} pairs for each
|
||||
# value in the list.
|
||||
listkey = None
|
||||
for k, v in kwds.items():
|
||||
if isinstance(v, (list, tuple)):
|
||||
if listkey is not None:
|
||||
raise TypeError("May only specify a list of values for one key.")
|
||||
listkey = k
|
||||
|
||||
if listkey is None:
|
||||
return _mk_key(*args, **kwds)
|
||||
else:
|
||||
keys = {}
|
||||
for v in kwds[listkey]:
|
||||
kwds[listkey] = v
|
||||
keys[v] = _mk_key(*args, **kwds)
|
||||
return keys
|
||||
|
||||
|
||||
def _mk_key(*args, **kwds):
|
||||
key = list(args) + list(kwds.items())
|
||||
key.sort(key=lambda a: a[0] if isinstance(a, tuple) else a)
|
||||
return tuple(key)
|
||||
|
||||
|
||||
def add_table_data(name, row_key, col_key, data, **kwds):
|
||||
"""
|
||||
Read data like::
|
||||
|
||||
Description
|
||||
|
||||
------------------------------------
|
||||
col1 col2 col3
|
||||
row1 1.2 [1] 0.9e-6 [1] 27 [2]
|
||||
row2 1.7 [1] [3]
|
||||
row3 0.93 [2] 0.3e-6 3 [2]
|
||||
|
||||
------------------------------------
|
||||
|
||||
[1] citation 1
|
||||
[2] citation 2
|
||||
[3] missing because.
|
||||
|
||||
|
||||
"""
|
||||
if isinstance(data, str) and "\xc2" in data:
|
||||
raise TypeError(
|
||||
"Data table <%s> appears to contain unicode characters but"
|
||||
"was not defined as unicode." % name
|
||||
)
|
||||
|
||||
lines = data.split("\n")
|
||||
|
||||
# First, split into description, table, and sources using ----- lines
|
||||
desc = []
|
||||
table = []
|
||||
while lines:
|
||||
line = lines.pop(0)
|
||||
# print ">", line
|
||||
if re.match(r"\s*-+\s*$", line):
|
||||
# print "match!"
|
||||
break
|
||||
desc.append(line)
|
||||
while lines:
|
||||
line = lines.pop(0)
|
||||
# print ">", line
|
||||
if re.match(r"\s*-+\s*$", line):
|
||||
# print "match!"
|
||||
break
|
||||
table.append(line)
|
||||
|
||||
# print desc
|
||||
# print table
|
||||
|
||||
# parse remaining lines as sources
|
||||
sources = parse_sources(lines)
|
||||
# print sources
|
||||
|
||||
#
|
||||
# parse table
|
||||
# table might be empty, so take care of that first.
|
||||
if table == []:
|
||||
return [] # no changes
|
||||
|
||||
while len(table[0].strip()) == 0:
|
||||
table.pop(0)
|
||||
|
||||
spaces = [c == " " for c in table[0]]
|
||||
cols = [0] + [i for i in range(1, len(spaces)) if spaces[i - 1] and not spaces[i]]
|
||||
cols = cols + [max(map(len, table)) + 1]
|
||||
# print spaces
|
||||
# print cols
|
||||
# Make sure columns are obeyed strictly
|
||||
for i, line in enumerate(table):
|
||||
for j, c in enumerate(cols[1:]):
|
||||
if len(line) < c:
|
||||
continue
|
||||
if line[c - 1] != " ":
|
||||
print("Table line with error: \n ", line)
|
||||
raise Exception(
|
||||
"Table <%s> line: %d, column: %s does not obey column boundaries."
|
||||
% (name, i, j)
|
||||
)
|
||||
|
||||
# Break table into cells
|
||||
cells = []
|
||||
for line in table:
|
||||
if line.strip() != "":
|
||||
cells.append(
|
||||
[line[cols[i] : cols[i + 1]].strip() for i in range(len(cols) - 1)]
|
||||
)
|
||||
# print cells
|
||||
|
||||
# Extract row/column names
|
||||
col_names = cells.pop(0)[1:]
|
||||
row_names = [cells[i].pop(0) for i in range(len(cells))]
|
||||
if len(set(row_names)) != len(row_names):
|
||||
for n in set(row_names):
|
||||
row_names.remove(n)
|
||||
raise NameError("Duplicate row names: %s" % row_names)
|
||||
|
||||
# Parse cell values
|
||||
for i in range(len(cells)):
|
||||
for j in range(len(cells[0])):
|
||||
cell = cells[i][j].strip()
|
||||
m = re.match(r"([^\[]*)(\[([^\]]+)\])?", cell) # match like "0.7 [3]"
|
||||
if m is None:
|
||||
raise ValueError(
|
||||
"Table cell (%d, %d) has bad format: '%s'" % (i, j, cell)
|
||||
)
|
||||
|
||||
# parse value
|
||||
# If the value contains '±' then a tuple is returned containing the values
|
||||
# on either side.
|
||||
val, _, source = m.groups()
|
||||
# val = unicode(val) # python 2
|
||||
val = str(val) # python 3
|
||||
if val.strip() == "":
|
||||
val = None
|
||||
else:
|
||||
parts = val.split(u"±")
|
||||
vals = []
|
||||
for p in parts:
|
||||
try:
|
||||
p = int(p)
|
||||
except ValueError:
|
||||
try:
|
||||
p = float(p)
|
||||
except ValueError:
|
||||
try:
|
||||
p = str(
|
||||
p.strip()
|
||||
) # allow strings to identify mechanisms also
|
||||
except ValueError:
|
||||
raise ValueError(
|
||||
"Table cell (%d, %d) value has bad format: '%s'"
|
||||
% (i, j, val)
|
||||
)
|
||||
vals.append(p)
|
||||
if len(vals) == 1:
|
||||
val = vals[0]
|
||||
else:
|
||||
val = tuple(vals)
|
||||
|
||||
# parse source
|
||||
if source is not None:
|
||||
try:
|
||||
source = sources[source]
|
||||
except KeyError:
|
||||
raise ValueError(
|
||||
"Table cell (%d, %d) has unknown source key: '%s'"
|
||||
% (i, j, source)
|
||||
)
|
||||
|
||||
cells[i][j] = (val, source)
|
||||
|
||||
changes = [] # a list of parameters that are changed if we are rewriting a table
|
||||
for i, row in enumerate(row_names):
|
||||
for j, col in enumerate(col_names):
|
||||
kwds[row_key] = row
|
||||
kwds[col_key] = col
|
||||
oldval = setval(cells[i][j], name, **kwds)
|
||||
if oldval is not None and oldval != cells[i][j]:
|
||||
key = mk_key(name, **kwds)
|
||||
changes.append(
|
||||
{"key": key, "new": cells[i][j], "old": oldval, "name": name}
|
||||
)
|
||||
# changes.append({'name': name, 'row': row, 'col': col, 'new': cells[i][j], 'old': oldval})
|
||||
return changes
|
||||
|
||||
|
||||
def report_changes(changes):
|
||||
"""
|
||||
For changes to data tables, give user a readout
|
||||
"""
|
||||
if len(changes) > 0:
|
||||
anychg = False
|
||||
for ch in changes:
|
||||
# print(' >>> Changing %s, %s from default (%s) to %s' % (ch['row'], ch['col'], str(ch['new'][0]), str(ch['old'][0])))
|
||||
if str(ch["old"][0]) != str(ch["new"][0]):
|
||||
if anychg is False:
|
||||
print(
|
||||
"\nWarning: Data Table '%s' (in memory) has been modified!"
|
||||
% changes[0]["name"]
|
||||
)
|
||||
anychg = True
|
||||
print(
|
||||
" >>> Changing %s, from default (%s) to %s"
|
||||
% (ch["key"], str(ch["old"][0]), str(ch["new"][0]))
|
||||
)
|
||||
|
||||
|
||||
def parse_sources(lines):
|
||||
sources = {}
|
||||
key = None
|
||||
val = []
|
||||
for l in lines:
|
||||
l = l.lstrip()
|
||||
m = re.match(r"\s*\[([^\]]+)\]\s+(.*)$", l)
|
||||
if m is not None:
|
||||
key = m.groups()[0]
|
||||
sources[key] = m.groups()[1].strip()
|
||||
else:
|
||||
if key is None:
|
||||
if l == "":
|
||||
continue
|
||||
raise ValueError(
|
||||
"Incorrect sources format--got text without "
|
||||
'citation index: "%s".' % l
|
||||
)
|
||||
sources[key] += "\n" + l
|
||||
return sources
|
||||
|
||||
|
||||
# parse_sources('''\n\n[1] source 1\n it's cool.\n[2] source 2 is not\n'''.split('\n'))
|
||||
234
cnmodel/data/connectivity.py
Normal file
234
cnmodel/data/connectivity.py
Normal file
@@ -0,0 +1,234 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
from ._db import add_table_data
|
||||
|
||||
#: Mouse synaptic convregence table
|
||||
mouse_convergence = u"""
|
||||
|
||||
Convergence defines the average number of presynaptic cells of a particular
|
||||
type (rows) that synapse onto a single postsynaptic cell of a particular
|
||||
type (columns).
|
||||
This connectivity matrix is currently incomplete.
|
||||
Note: Bushy and pyramidal cells are known to have no (or very few)
|
||||
collaterals within the CN, and so they are not listed as presynaptic cells in
|
||||
this table. Octopus cells have collaterals (including in granule cell domains),
|
||||
and should be added to this table when more data are available (Golding et al.,
|
||||
J. Neurosci. 15: 3138, 1995)
|
||||
|
||||
----------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate octopus pyramidal tuberculoventral
|
||||
sgc 3.3±0.6 [2] 6.5±1.0 [2] 35±0 [3] 60±0 [2] 48±0 [5] 24±0 [5]
|
||||
dstellate 7 [1] 20 [1] 3 [1] 0 [4] 15 [5] 15 [5]
|
||||
tstellate 0 [6] 0 [6] 0 [6] 0 [6] 0 [6] 0 [6]
|
||||
tuberculoventral 6 6 0 0 [4] 21 [5] 0 [7]
|
||||
pyramidal 0 0 0 0 0 0
|
||||
----------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Guesses based on Campagnola & Manis 2014
|
||||
|
||||
[2] Cao, X. & Oertel, D. (2010). Auditory nerve fibers excite targets through
|
||||
synapses that vary in convergence, strength, and short-term plasticity.
|
||||
Journal of Neurophysiology, 104(5), 2308–20.
|
||||
Xie and Manis (unpublished): max EPSC = 3.4 ± 1.5 nA with ~0.3 nA steps
|
||||
(Cao and Oertel, 2010) = ~11 AN inputs. However neither we nor Cao and Oertel
|
||||
see that many clear steps in the responses, so use lower bound.
|
||||
|
||||
[3] Lower bound based on estimates from unpublished data Xie and Manis (2017)
|
||||
Assumptions: No discernable step sizes when increasing shock intensity
|
||||
at ANFs in radiate multipolars (dstellate)
|
||||
Measured: 0.034 ± 15 nA sEPSC @ -70 mV
|
||||
Measured: Maximal current from AN stim = 1.2 ± 0.7 nA @ -70 mV
|
||||
Assuming that each AN provides 1 input, then N = ~35
|
||||
|
||||
[4] Octopus cells are devoid of inhibitory input (Golding et al., J. Neurosci., 1995)
|
||||
|
||||
[5] Convergence from Hancock and Voigt, Ann. Biomed. Eng. 27, 1999 and Zheng and Voigt,
|
||||
Ann. Biomed. Eng., 34, 2006. Numbers are based on models for cat and gerbil,
|
||||
respectively. Adjusted to 1/2 to avoid overexciting TV cells in network model.
|
||||
|
||||
[6] tstellate cells have collaterals within the CN. It has been proposed that they
|
||||
provide auditory-driven input to the DCN (Oertel and Young, ), and also synapse
|
||||
within the VCN (Oertel, SFN abstract). These parameters may need to be adjusted
|
||||
once the convergence and strength is known.
|
||||
|
||||
[7] In the models of Hancock and Voigt (1999) and Zheng and Voigt (2006), the TV cells
|
||||
have no connections with each other. However, Kuo et al. (J. Neurophysiol., 2015)
|
||||
did see connections between pairs of TV cells in the mouse.
|
||||
|
||||
"""
|
||||
|
||||
add_table_data(
|
||||
"convergence",
|
||||
row_key="pre_type",
|
||||
col_key="post_type",
|
||||
species="mouse",
|
||||
data=mouse_convergence,
|
||||
)
|
||||
|
||||
|
||||
mouse_convergence_range = u"""
|
||||
|
||||
The convergence range table describes, for each type of connection from
|
||||
presynaptic (rows) to postsynaptic (columns), the variance in frequency of
|
||||
presynaptic cells relative to the postsynaptic cell.
|
||||
|
||||
All values are expressed as the sigma for a lognormal distribution scaled to
|
||||
the CF of the postsynaptic cell.
|
||||
|
||||
----------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate octopus pyramidal tuberculoventral
|
||||
sgc 0.05 [1] 0.1 [1] 0.4 [1] 0.5 [5] 0.1 [1] 0.1 [1]
|
||||
dstellate 0.208 [2] 0.347 [2] 0.5 [1] 0 0.2 [1] 0.2 [1]
|
||||
tstellate 0.1 [4] 0.1 [4] 0 0 0 0
|
||||
tuberculoventral 0.069 [3] 0.111 [3] 0 0 0.15 [1] 0
|
||||
pyramidal 0 0 0 0 0 0
|
||||
----------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Guess based on axonal / dendritic morphology.
|
||||
|
||||
[2] Calculated from Campagnola & Manis 2014 fig. 7C
|
||||
Distribution widths are given in stdev(octaves), so we multiply by ln(2) to
|
||||
get the sigma for a lognormal distribution.
|
||||
DS->Bushy: ln(2) * 0.3 = 0.208
|
||||
DS->TStellate: ln(2) * 0.5 = 0.347
|
||||
|
||||
[3] Calculated from Campagnola & Manis 2014 fig. 9C
|
||||
Distribution widths are given in stdev(octaves), so we multiply by ln(2) to
|
||||
get the sigma for a lognormal distribution.
|
||||
TV->Bushy: ln(2) * 0.10 = 0.069
|
||||
TV->TStellate: ln(2) * 0.16 = 0.111
|
||||
|
||||
[4] Guess based on very limited information in Campagnola & Manis 2014 fig. 12
|
||||
|
||||
[5] Octopus cells get a wide range of ANF input (but weak on a per input basis)
|
||||
For example, see McGinley et al., 2012 or Spencer et al., 2012.
|
||||
|
||||
|
||||
"""
|
||||
|
||||
add_table_data(
|
||||
"convergence_range",
|
||||
row_key="pre_type",
|
||||
col_key="post_type",
|
||||
species="mouse",
|
||||
data=mouse_convergence_range,
|
||||
)
|
||||
|
||||
# --------------------------------------------------------------------------------------------
|
||||
guineapig_convergence = u"""
|
||||
|
||||
Convergence defines the average number of presynaptic cells of a particular
|
||||
type (rows) that synapse onto a single postsynaptic cell of a particular
|
||||
type (columns).
|
||||
This connectivity matrix is currently incomplete.
|
||||
Note: Bushy and pyramidal cells are known to have no (or very few)
|
||||
collaterals within the CN, and so they are not listed as presynaptic cells in
|
||||
this table. Octopus cells have collaterals (including in granule cell domains),
|
||||
and should be added to this table when more data are available (Golding et al.,
|
||||
J. Neurosci. 15: 3138, 1995)
|
||||
|
||||
This table is just a guess... using mouse data...
|
||||
|
||||
----------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate octopus pyramidal tuberculoventral mso
|
||||
sgc 3.3±0.6 [2] 6.5±1.0 [2] 35±0 [3] 60±0 [2] 48±0 [5] 24±0 [5] 0
|
||||
bushy 0 0 0 0 0 0 12 [8]
|
||||
dstellate 7 [1] 20 [1] 3 [1] 0 [4] 15 [5] 15 [5] 0
|
||||
tstellate 0 [6] 0 [6] 0 [6] 0 [6] 0 [6] 0 [6] 0
|
||||
tuberculoventral 6 6 0 0 [4] 21 [5] 0 [7] 0
|
||||
pyramidal 0 0 0 0 0 0 0
|
||||
----------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Guesses based on Campagnola & Manis 2014 (using mouse data on guinea pig cells)
|
||||
|
||||
[2] Cao, X. & Oertel, D. (2010). Auditory nerve fibers excite targets through
|
||||
synapses that vary in convergence, strength, and short-term plasticity.
|
||||
Journal of Neurophysiology, 104(5), 2308–20.
|
||||
Xie and Manis (unpublished): max EPSC = 3.4 ± 1.5 nA with ~0.3 nA steps
|
||||
(Cao and Oertel, 2010) = ~11 AN inputs. However neither we nor Cao and Oertel
|
||||
see that many clear steps in the responses, so use lower bound.
|
||||
|
||||
[3] Lower bound based on estimates from unpublished data Xie and Manis (2017)
|
||||
Assumptions: No discernable step sizes when increasing shock intensity
|
||||
at ANFs in radiate multipolars (dstellate)
|
||||
Measured: 0.034 ± 15 nA sEPSC @ -70 mV
|
||||
Measured: Maximal current from AN stim = 1.2 ± 0.7 nA @ -70 mV
|
||||
Assuming that each AN provides 1 input, then N = ~35
|
||||
|
||||
[4] Octopus cells are devoid of inhibitory input (Golding et al., J. Neurosci., 1995)
|
||||
|
||||
[5] Convergence from Hancock and Voigt, Ann. Biomed. Eng. 27, 1999 and Zheng and Voigt,
|
||||
Ann. Biomed. Eng., 34, 2006. Numbers are based on models for cat and gerbil,
|
||||
respectively. Adjusted to 1/2 to avoid overexciting TV cells in network model.
|
||||
|
||||
[6] tstellate cells have collaterals within the CN. It has been proposed that they
|
||||
provide auditory-driven input to the DCN (Oertel and Young, ), and also synapse
|
||||
within the VCN (Oertel, SFN abstract). These parameters may need to be adjusted
|
||||
once the convergence and strength is known.
|
||||
|
||||
[7] In the models of Hancock and Voigt (1999) and Zheng and Voigt (2006), the TV cells
|
||||
have no connections with each other. However, Kuo et al. (J. Neurophysiol., 2015)
|
||||
did see connections between pairs of TV cells in the mouse.
|
||||
|
||||
[8] Bushy convergence to MSO is a guess
|
||||
"""
|
||||
|
||||
add_table_data(
|
||||
"convergence",
|
||||
row_key="pre_type",
|
||||
col_key="post_type",
|
||||
species="guineapig",
|
||||
data=guineapig_convergence,
|
||||
)
|
||||
|
||||
|
||||
guineapig_convergence_range = u"""
|
||||
|
||||
The convergence range table describes, for each type of connection from
|
||||
presynaptic (rows) to postsynaptic (columns), the variance in frequency of
|
||||
presynaptic cells relative to the postsynaptic cell.
|
||||
|
||||
All values are expressed as the sigma for a lognormal distribution scaled to
|
||||
the CF of the postsynaptic cell.
|
||||
|
||||
*** This table is just a guess - using data from mouse... ****
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate octopus pyramidal tuberculoventral mso
|
||||
sgc 0.05 [1] 0.1 [1] 0.4 [1] 0.5 [5] 0.1 [1] 0.1 [1] 0
|
||||
bushy 0 0 0 0 0 0 0.05 [6]
|
||||
dstellate 0.208 [2] 0.347 [2] 0.5 [1] 0 0.2 [1] 0.2 [1] 0
|
||||
tstellate 0.1 [4] 0.1 [4] 0 0 0 0 0
|
||||
tuberculoventral 0.069 [3] 0.111 [3] 0 0 0.15 [1] 0 0
|
||||
pyramidal 0 0 0 0 0 0 0
|
||||
--------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Guess based on axonal / dendritic morphology.
|
||||
|
||||
[2] Calculated from Campagnola & Manis 2014 fig. 7C (Using mouse data on guinea pig cells)
|
||||
Distribution widths are given in stdev(octaves), so we multiply by ln(2) to
|
||||
get the sigma for a lognormal distribution.
|
||||
DS->Bushy: ln(2) * 0.3 = 0.208
|
||||
DS->TStellate: ln(2) * 0.5 = 0.347
|
||||
|
||||
[3] Calculated from Campagnola & Manis 2014 fig. 9C (Using mouse data on guinea pig cells)
|
||||
Distribution widths are given in stdev(octaves), so we multiply by ln(2) to
|
||||
get the sigma for a lognormal distribution.
|
||||
TV->Bushy: ln(2) * 0.10 = 0.069
|
||||
TV->TStellate: ln(2) * 0.16 = 0.111
|
||||
|
||||
[4] Guess based on very limited information in Campagnola & Manis 2014 fig. 12
|
||||
|
||||
[5] Octopus cells get a wide range of ANF input (but weak on a per input basis)
|
||||
For example, see McGinley et al., 2012 or Spencer et al., 2012.
|
||||
|
||||
[6] MSO convergence from bushy cells is a guess.
|
||||
|
||||
"""
|
||||
|
||||
add_table_data(
|
||||
"convergence_range",
|
||||
row_key="pre_type",
|
||||
col_key="post_type",
|
||||
species="guineapig",
|
||||
data=guineapig_convergence_range,
|
||||
)
|
||||
582
cnmodel/data/ionchannels.py
Normal file
582
cnmodel/data/ionchannels.py
Normal file
@@ -0,0 +1,582 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
from ._db import add_table_data
|
||||
|
||||
"""
|
||||
Ion channel density tables
|
||||
All of the ion channel densities for the models implemented in cnmodel
|
||||
are (or should be) stated here, and should not be modified in the
|
||||
cnmodel code itself.
|
||||
|
||||
"""
|
||||
|
||||
add_table_data(
|
||||
"RM03_channels",
|
||||
row_key="field",
|
||||
col_key="model_type",
|
||||
species="guineapig",
|
||||
data=u"""
|
||||
|
||||
This table describes the ion channel densities (and voltage shifts if necessary)
|
||||
for different cell types in the original Rothman Manis 2003 model.
|
||||
Data from Table 1, except for "octopus" cells, which is modified (see note 3)
|
||||
map to cell: bushy-II bushy-II-I tstellate tstellate-t bushy-I-II octopus
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
II II-I I-c I-t I-II II-o
|
||||
|
||||
nacn_gbar 1000. [1] 1000. [1] 1000. [1] 1000. [1] 1000. [2] 1000. [3]
|
||||
kht_gbar 150.0 [1] 150.0 [1] 150.0 [1] 80.0 [1] 150.0 [2] 150.0 [3]
|
||||
klt_gbar 200.0 [1] 35.0 [1] 0.0 [1] 0.0 [1] 20.0 [2] 1000. [3]
|
||||
ka_gbar 0.0 [1] 0.0 [1] 0.0 [1] 65.0 [1] 0.0 [2] 0.0 [3]
|
||||
ih_gbar 20.0 [1] 3.5 [1] 0.5 [1] 0.5 [1] 2.0 [2] 30.0 [3]
|
||||
leak_gbar 2.0 [1] 2.0 [1] 2.0 [1] 2.0 [1] 2.0 [2] 2.0 [3]
|
||||
leak_erev -65 [1] -65 [1] -65 [1] -65 [1] -65 [2] -65 [3]
|
||||
na_type nacn [1] nacn [1] nacn [1] nacn [1] nacn [2] nacn [3]
|
||||
ih_type ihvcn [1] ihvcn [1] ihvcn [1] ihvcn [1] ihvcn [2] ihvcn [3]
|
||||
soma_Cap 12.0 [1] 12.0 [1] 12.0 [1] 12.0 [1] 12.0 [2] 25.0 [3]
|
||||
e_k -84 [1] -84 [1] -84 [1] -84 [2] -84 [2] -84 [2]
|
||||
e_na 50. [1] 50. [1] 50. [1] 50. [2] 50. [2] 50. [2]
|
||||
ih_eh -43 [1] -43 [1] -43 [1] -43 [2] -43 [2] -43 [2]
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Rothman and Manis, 2003
|
||||
Age "adult", Temperature=22C
|
||||
Units are nS.
|
||||
|
||||
[2] Rothman and manis, 2003, model I-II
|
||||
Some low-voltage K current, based on observations of
|
||||
a single spike near threshold and regular firing for higher
|
||||
currents (Xie and Manis, 2017)
|
||||
|
||||
[3] Derived from Rothman and Manis, 2003, model II
|
||||
Large amounts of low-voltage K current, and elevated HCN. Conductances
|
||||
based on Rothman and Manis, 2003; concept from Cao and Oertel
|
||||
|
||||
[4] Designation for elevated LTK and Ih for octopus cells
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
add_table_data(
|
||||
"XM13_channels",
|
||||
row_key="field",
|
||||
col_key="model_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
This table describes the REFERENCE ion channel densities (and voltage shifts if necessary)
|
||||
for different cell types based on the Xie and Manis 2013 models for mouse.
|
||||
|
||||
The REFERENCE values are applied to "point" models, and to the soma of
|
||||
compartmental models.
|
||||
The names of the mechanisms must match a channel mechanism (Neuron .mod files)
|
||||
and the following _(gbar, vshift, etc) must match an attribute of that channel
|
||||
that can be accessed.
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
II II-I I-c I-II I-t
|
||||
|
||||
nav11_gbar 0000. [4] 0000. [4] 000. [4] 0. [4] 3000. [4]
|
||||
nacn_gbar 1000. [1] 1000. [1] 3000. [1] 0000. [2] 0000. [1]
|
||||
na_gbar 1000. [1] 1000. [1] 3000. [1] 1800. [2] 0000. [1]
|
||||
kht_gbar 58.0 [1] 58.0 [1] 500.0 [1] 150.0 [2] 500.0 [1]
|
||||
klt_gbar 80.0 [1] 20.0 [1] 0.0 [1] 14.0 [3] 0.0 [1]
|
||||
ka_gbar 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [2] 125.0 [1]
|
||||
ihvcn_gbar 30.0 [1] 30.0 [1] 18.0 [1] 2.0 [2] 18.0 [1]
|
||||
leak_gbar 2.0 [1] 2.0 [1] 8.0 [1] 2.0 [2] 8.0 [1]
|
||||
leak_erev -65 [1] -65 [1] -65 [1] -65 [2] -65 [1]
|
||||
na_type nacn [1] nav11 [1] nacn [1] na [3] nav11 [1]
|
||||
ih_type ihvcn [1] ihvcn [1] ihvcn [1] ihvcn [2] ihvcn [1]
|
||||
soma_Cap 26.0 [1] 26.0 [1] 25.0 [1] 25.0 [2] 25.0 [1]
|
||||
nav11_vshift 4.3 [1] 4.3 [1] 4.3 [1] 4.3 [1] 4.3 [1]
|
||||
e_k -84 [1] -84 [1] -84 [1] -70 [3] -84 [1]
|
||||
e_na 50. [1] 50. [1] 50. [1] 55. [3] 50. [1]
|
||||
ih_eh -43 [1] -43 [1] -43 [1] -43 [2] -43 [1]
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Uses channels from Rothman and Manis, 2003
|
||||
Conductances are for Mouse bushy cells
|
||||
Xie and Manis, 2013
|
||||
Age "adult", Temperature=34C
|
||||
Units are nS.
|
||||
|
||||
[2] Rothman and manis, 2003, model I-II
|
||||
Some low-voltage K current, based on observations of
|
||||
a single spike near threshold and regular firing for higher
|
||||
currents (Xie and Manis, 2017)
|
||||
|
||||
[3] These values for the I-II (dstellate) are from the original checkpoint test
|
||||
for cnmodel 12/2017.
|
||||
|
||||
[4] nav11 channels were used in original Xie and Manis (2013) ms, but are not
|
||||
used for mice in the master distribution of cnmodel, which used only the nacn
|
||||
channels.
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
add_table_data(
|
||||
"XM13_channels_compartments",
|
||||
row_key="parameter",
|
||||
col_key="compartment",
|
||||
species="mouse",
|
||||
model_type="II",
|
||||
data=u"""
|
||||
|
||||
This table describes the ion channel densities relative to somatic densities,
|
||||
e.g., relative to REFERENCE densities in the table XM13_channels.
|
||||
and voltage shifts, for different compartments of the specified neuron,
|
||||
Conductances will be calculated from the Model derived from Xie and Manis 2013 for mouse
|
||||
(data table: mGVC_channels).
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
axon unmyelinatedaxon myelinatedaxon initialsegment hillock soma dendrite primarydendrite secondarydendrite
|
||||
|
||||
nav11_gbar 3.0 [1] 3.0 [1] 0.0 [1] 5.0 [1] 5.0 [1] 1.0 [1] 0.5 [1] 0.50 [1] 0.25 [1]
|
||||
kht_gbar 1.0 [1] 2.0 [1] 0.01 [1] 2.0 [1] 2.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.25 [1]
|
||||
klt_gbar 1.0 [1] 1.0 [1] 0.01 [1] 1.0 [1] 1.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.25 [1]
|
||||
ihvcn_gbar 0.0 [1] 0.0 [1] 0.0 [1] 0.5 [1] 0.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.5 [1]
|
||||
leak_gbar 1.0 [1] 0.25 [1] 0.25e-3 [1] 1.0 [1] 1.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.5 [1]
|
||||
leak_erev -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1]
|
||||
nav11_vshift 4.3 [1] 4.3 [1] 0.0 [1] 4.3 [1] 4.3 [1] 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [1]
|
||||
na_type nav11 nav11 nav11 nav11 nav11 nav11 nav11 nav11 nav11
|
||||
ih_type ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Scaling is relative to soma scaling. Numbers are estimates based on general distribution from literature on cortical neurons.
|
||||
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
# ***** BEGINNING OF XM13_Channels for nacncoop version of model
|
||||
|
||||
|
||||
add_table_data(
|
||||
"XM13nacncoop_channels",
|
||||
row_key="field",
|
||||
col_key="model_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
This table describes the REFERENCE ion channel densities (and voltage shifts if necessary)
|
||||
for different cell types based on the Xie and Manis 2013 models for mouse, but using
|
||||
the nacncoop mechanism (coooperative sodium channels)
|
||||
|
||||
!!!!!!!!!!!! USAGE OF THIS TABLE SHOULD BE CONSIDERED EXPERIMENTAL !!!!!!!!!!!!!!
|
||||
|
||||
The REFERENCE values are applied to "point" models, and to the soma of
|
||||
compartmental models.
|
||||
The names of the mechanisms must match a channel mechanism (Neuron .mod files)
|
||||
and the following _(gbar, vshift, etc) must match an attribute of that channel
|
||||
that can be accessed.
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
II II-I I-c I-II I-t
|
||||
|
||||
nacncoop_gbar 3000. [4] 1000. [4] 1000. [4] 1000. [4] 1000. [4]
|
||||
kht_gbar 58.0 [1] 58.0 [1] 500.0 [1] 150.0 [2] 500.0 [1]
|
||||
klt_gbar 80.0 [1] 20.0 [1] 0.0 [1] 14.0 [3] 0.0 [1]
|
||||
ka_gbar 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [2] 125.0 [1]
|
||||
ihvcn_gbar 30.0 [1] 30.0 [1] 18.0 [1] 2.0 [2] 18.0 [1]
|
||||
leak_gbar 2.0 [1] 2.0 [1] 8.0 [1] 2.0 [2] 8.0 [1]
|
||||
leak_erev -65 [1] -65 [1] -65 [1] -65 [2] -65 [1]
|
||||
na_type nacncoop [1] nacncoop [1] nacncoop [1] nacncoop [3] nacncoop [1]
|
||||
ih_type ihvcn [1] ihvcn [1] ihvcn [1] ihvcn [2] ihvcn [1]
|
||||
soma_Cap 26.0 [1] 26.0 [1] 25.0 [1] 25.0 [2] 25.0 [1]
|
||||
nacncoop_vshift 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [1]
|
||||
e_k -84 [1] -84 [1] -84 [1] -70 [3] -84 [1]
|
||||
e_na 50. [1] 50. [1] 50. [1] 55. [3] 50. [1]
|
||||
ih_eh -43 [1] -43 [1] -43 [1] -43 [2] -43 [1]
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Uses channels from Xie and Manis, 2013
|
||||
Age "adult", Temperature=34C
|
||||
Units are nS.
|
||||
|
||||
[2] Rothman and manis, 2003, model I-II
|
||||
Some low-voltage K current, based on observations of
|
||||
a single spike near threshold and regular firing for higher
|
||||
currents (Xie and Manis, 2017)
|
||||
|
||||
[3] These values for the I-II (dstellate) are from the original checkpoint test
|
||||
for cnmodel 12/2017.
|
||||
|
||||
[4] nav11 channels were used in original Xie and Manis (2013) ms,
|
||||
However, this version uses cooperative na channels for faster activation
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
add_table_data(
|
||||
"XM13nacncooop_channels_compartments",
|
||||
row_key="parameter",
|
||||
col_key="compartment",
|
||||
species="mouse",
|
||||
model_type="II",
|
||||
data=u"""
|
||||
|
||||
!!!!!!!!!!!! USAGE OF THIS TABLE SHOULD BE CONSIDERED EXPERIMENTAL !!!!!!!!!!!!!!
|
||||
|
||||
This table describes the ion channel densities relative to somatic densities,
|
||||
e.g., relative to REFERENCE densities in the table XM13_nacncoop_channels.
|
||||
and voltage shifts, for different compartments of the specified neuron,
|
||||
Conductances will be calculated from the Model derived from Xie and Manis 2013 for mouse
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
axon unmyelinatedaxon myelinatedaxon initialsegment hillock soma dendrite primarydendrite secondarydendrite
|
||||
|
||||
nacncoop_gbar 3.0 [1] 3.0 [1] 0.0 [1] 5.0 [1] 5.0 [1] 1.0 [1] 0.5 [1] 0.50 [1] 0.25 [1]
|
||||
kht_gbar 1.0 [1] 2.0 [1] 0.01 [1] 2.0 [1] 2.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.25 [1]
|
||||
klt_gbar 1.0 [1] 1.0 [1] 0.01 [1] 1.0 [1] 1.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.25 [1]
|
||||
ihvcn_gbar 0.0 [1] 0.0 [1] 0.0 [1] 0.5 [1] 0.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.5 [1]
|
||||
leak_gbar 1.0 [1] 0.25 [1] 0.25e-3 [1] 1.0 [1] 1.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.5 [1]
|
||||
leak_erev -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1]
|
||||
nacncoop_vshift 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [1]
|
||||
na_type nacncoop nacncoop nacncoop nacncoop nacncoop nacncoop nacncoop nacncoop nacncoop
|
||||
ih_type ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Scaling is relative to soma scaling. Numbers are estimates based on general distribution from literature on cortical neurons.
|
||||
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
# ***** END OF XM13_Channels for nacncoop version of model
|
||||
|
||||
add_table_data(
|
||||
"mGBC_channels",
|
||||
row_key="field",
|
||||
col_key="model_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
This table describes the REFERENCE ion channel densities (and voltage shifts if necessary)
|
||||
for different cell types based on the Xie and Manis 2013 models for mouse.
|
||||
|
||||
The REFERENCE values are applied to "point" models, and to the soma of
|
||||
compartmental models.
|
||||
The names of the mechanisms must match a channel mechanism (Neuron .mod files)
|
||||
and the following _(gbar, vshift, etc) must match an attribute of that channel
|
||||
that can be accessed.
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
II II-I I-c I-II I-t
|
||||
|
||||
nav11_gbar 1600. [1] 1600. [1] 3000. [1] 1600. [2] 3000. [1]
|
||||
kht_gbar 58.0 [1] 58.0 [1] 500.0 [1] 150.0 [2] 500.0 [1]
|
||||
klt_gbar 80.0 [1] 14.0 [1] 0.0 [1] 20.0 [2] 0.0 [1]
|
||||
ka_gbar 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [2] 125.0 [1]
|
||||
ihvcn_gbar 30.0 [1] 30.0 [1] 18.0 [1] 2.0 [2] 18.0 [1]
|
||||
leak_gbar 2.0 [1] 2.0 [1] 8.0 [1] 2.0 [2] 8.0 [1]
|
||||
leak_erev -65 [1] -65 [1] -65 [1] -65 [2] -65 [1]
|
||||
na_type nav11 [1] nav11 [1] nav11 [1] nav11 [1] nav11 [1]
|
||||
ih_type ihvcn [1] ihvcn [1] ihvcn [1] ihvcn [2] ihvcn [1]
|
||||
soma_Cap 26.0 [1] 26.0 [1] 25.0 [1] 26.0 [2] 25.0 [1]
|
||||
nav11_vshift 4.3 [1] 4.3 [1] 4.3 [1] 4.3 [1] 4.3 [1]
|
||||
e_k -84 [1] -84 [1] -84 [1] -84 [2] -84 [1]
|
||||
e_na 50. [1] 50. [1] 50. [1] 50. [2] 50. [1]
|
||||
ih_eh -43 [1] -43 [1] -43 [1] -43 [2] -43 [1]
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Uses channels from Rothman and Manis, 2003, except for Na channels
|
||||
Conductances are for Mouse bushy cells
|
||||
Xie and Manis, 2013
|
||||
Age "adult", Temperature=34C
|
||||
Units are nS.
|
||||
|
||||
[2] Rothman and Manis, 2003, model I-II
|
||||
Some low-voltage K current, based on observations of
|
||||
a single spike near threshold and regular firing for higher
|
||||
currents (Xie and Manis, 2017)
|
||||
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
add_table_data(
|
||||
"mGBC_channels_compartments",
|
||||
row_key="parameter",
|
||||
col_key="compartment",
|
||||
species="mouse",
|
||||
model_type="II",
|
||||
data=u"""
|
||||
|
||||
This table describes the ion channel densities relative to somatic densities,
|
||||
e.g., relative to REFERENCE densities in the table XM13_channels.
|
||||
and voltage shifts, for different compartments of the specified neuron,
|
||||
Conductances will be calculated from the Model for Xie and Manis 2013 for mouse
|
||||
(data table: XM13_channels).
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
axon unmyelinatedaxon myelinatedaxon initialsegment hillock soma dendrite primarydendrite secondarydendrite
|
||||
|
||||
nav11_gbar 3.0 [1] 3.0 [1] 0.0 [1] 3.0 [1] 2.0 [1] 1.0 [1] 0.25 [1] 0.25 [1] 0.25 [1]
|
||||
kht_gbar 1.0 [1] 2.0 [1] 0.01 [1] 2.0 [1] 2.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.25 [1]
|
||||
klt_gbar 1.0 [1] 1.0 [1] 0.01 [1] 1.0 [1] 1.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.25 [1]
|
||||
ihvcn_gbar 0.0 [1] 0.0 [1] 0.0 [1] 0.5 [1] 0.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.5 [1]
|
||||
leak_gbar 1.0 [1] 0.25 [1] 0.25e-3 [1] 1.0 [1] 1.0 [1] 1.0 [1] 0.5 [1] 0.5 [1] 0.5 [1]
|
||||
leak_erev -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1] -65. [1]
|
||||
nav11_vshift 4.3 [1] 4.3 [1] 0.0 [1] 4.3 [1] 4.3 [1] 0.0 [1] 0.0 [1] 0.0 [1] 0.0 [1]
|
||||
na_type nav11 nav11 nav11 nav11 nav11 nav11 nav11 nav11 nav11
|
||||
ih_type ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn ihvcn
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Scaling is relative to soma scaling. Numbers are estimates based on general distribution from literature on cortical neurons.
|
||||
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
add_table_data(
|
||||
"POK_channels",
|
||||
row_key="field",
|
||||
col_key="cell_type",
|
||||
species="rat",
|
||||
data=u"""
|
||||
|
||||
This table describes the ion channel densities and voltage shifts for rat DCN pyramidal cells,
|
||||
from Kanold and Manis, 2001
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
pyramidal
|
||||
|
||||
soma_napyr_gbar 350.0 [1]
|
||||
soma_nap_gbar 0.
|
||||
soma_kdpyr_gbar 80.0 [1]
|
||||
soma_kcnq_gbar 0.
|
||||
soma_kif_gbar 150.0 [1]
|
||||
soma_kis_gbar 40.0 [1]
|
||||
soma_ihpyr_gbar 2.8 [1]
|
||||
soma_leak_gbar 2.8 [1]
|
||||
soma_leak_erev -62.0 [1]
|
||||
soma_e_na 50. [1]
|
||||
soma_e_k -81.5 [1]
|
||||
soma_e_h -43.0 [1]
|
||||
soma_natype napyr
|
||||
soma_Cap 12 [1]
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Kanold and Manis, 1999, 2001, 2005
|
||||
Age P11-14, Temperature=22C
|
||||
Units are nS.
|
||||
[2] Adjustable q10 added for fitting
|
||||
soma_ihpyr_adj_q10 1.0 [2] (removed for testing)
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
add_table_data(
|
||||
"CW_channels",
|
||||
row_key="field",
|
||||
col_key="cell_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
This table describes the ion channel densities and voltage shifts
|
||||
for a mouse carthweel cell model.
|
||||
Ad-hoc model, based on a Purkinje cell model (ref [1]).
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
cartwheel
|
||||
|
||||
soma_narsg_gbar 500.0 [1]
|
||||
soma_bkpkj_gbar 2.0
|
||||
soma_kpkj_gbar 100. [1]
|
||||
soma_kpkj2_gbar 50.
|
||||
soma_kpkjslow_gbar 150 [1]
|
||||
soma_kpksk_gbar 25.0 [1]
|
||||
soma_lkpkj_gbar 5.0 [1]
|
||||
soma_hpkj_gbar 5.0 [1]
|
||||
soma_e_na 50. [1]
|
||||
soma_e_k -80.0 [1]
|
||||
soma_hpkj_eh -43.0 [1]
|
||||
soma_lkpkj_e -65.0 [1]
|
||||
soma_e_ca 50.
|
||||
soma_na_type narsg
|
||||
soma_pcabar 0.00015 [1]
|
||||
soma_Dia 18
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Channels from Khaliq, Gouwens and Raman, J. Neurosci. 2003
|
||||
Conductance levels modified.
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
add_table_data(
|
||||
"TV_channels",
|
||||
row_key="field",
|
||||
col_key="cell_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
This table describes the ion channel densities and voltage shifts
|
||||
for a mouse tuberculoventral cell model.
|
||||
Ad-hoc model, based on the t-stellate cell model, but adjusted
|
||||
to match the data from Kuo and Trussell.
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
TVmouse
|
||||
|
||||
soma_nacncoop_gbar 5800.0 [2]
|
||||
soma_kht_gbar 400.0 [1]
|
||||
soma_ihvcn_gbar 2.5 [2]
|
||||
soma_ka_gbar 65.0 [1]
|
||||
soma_leak_gbar 4.5 [1]
|
||||
soma_leak_erev -72.0 [1]
|
||||
soma_e_na 50. [1]
|
||||
soma_e_k -81.5 [1]
|
||||
soma_ihvcn_eh -43.0 [1]
|
||||
soma_na_type nacncoop [2]
|
||||
soma_Cap 35 [1]
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Values obtained from brute force runs and comparision to
|
||||
FI curve from Kuo, Lu and Trussell, J Neurophysiol. 2012 Aug 15;
|
||||
108(4): 1186–1198.
|
||||
|
||||
[2] Cooperative sodium channel model, based on (see the mechanisms folder)
|
||||
concepts and implementation similar to Oz et al. J.Comp. Neurosci. 39: 63, 2015,
|
||||
and Huang et al., PloSOne 7:e37729, 2012.
|
||||
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
add_table_data(
|
||||
"sgc_mouse_channels",
|
||||
row_key="field",
|
||||
col_key="cell_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
This table describes the ion channel densities (and voltage shifts if necessary)
|
||||
for SGC cells, based on
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
sgc-a sgc-bm
|
||||
|
||||
sgc_name a bm
|
||||
soma_na_gbar 350. [2] 350. [2]
|
||||
soma_kht_gbar 58.0 [1] 58.0 [1]
|
||||
soma_klt_gbar 80.0 [1] 80.0 [1]
|
||||
soma_ihap_gbar 3.0 [3] 0.0 [1]
|
||||
soma_ihap_eh -41.0 [3] -41.0 [3]
|
||||
soma_ihbm_gbar 0.0 [3] 3.0 [3]
|
||||
soma_ihbm_eh -41.0 [3] -41.0 [3]
|
||||
soma_leak_gbar 2.0 [1] 2.0 [1]
|
||||
soma_leak_erev -65 [1] -65 [1]
|
||||
soma_na_type jsrna [2] jsrna [2]
|
||||
soma_Cap 12.0 [1] 12.0 [1]
|
||||
soma_e_k -84 [1] -84 [1]
|
||||
soma_e_na 50. [1] 50. [1]
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Model is based on the mouse bushy cell model (XM13, above),
|
||||
but with a fast sodium channel from Rothman et al, 1993. and Ih currents
|
||||
from Liu et al. 2014
|
||||
|
||||
[2] Sodium channel from Rothman, Young and Manis, J Neurophysiol. 1993 Dec;70(6):2562-83.
|
||||
|
||||
[3] Ih Currents from Liu, Manis, Davis, J Assoc Res Otolaryngol. 2014 Aug;15(4):585-99.
|
||||
doi: 10.1007/s10162-014-0446-z. Epub 2014 Feb 21.
|
||||
Age "P10" (cultured SGC cells), Original data temperature=22C.
|
||||
Units are nS.
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
add_table_data(
|
||||
"sgc_guineapig_channels",
|
||||
row_key="field",
|
||||
col_key="cell_type",
|
||||
species="guineapig",
|
||||
data=u"""
|
||||
|
||||
This table describes the ion channel densities (and voltage shifts if necessary)
|
||||
for a model SGC cell, which is based on a bushy cell with a different Na channel.
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
sgc-a sgc-bm
|
||||
|
||||
sgc_name a bm
|
||||
soma_na_gbar 1000. [2] 1000. [2]
|
||||
soma_kht_gbar 150.0 [1] 150.0 [1]
|
||||
soma_klt_gbar 200.0 [1] 200.0 [1]
|
||||
soma_ihap_gbar 3.0 [3] 0.0 [3]
|
||||
soma_ihap_eh -41.0 [3] -41.0 [3]
|
||||
soma_ihbm_gbar 0.0 [3] 3.0 [3]
|
||||
soma_ihbm_eh -41.0 [3] -41.0 [3]
|
||||
soma_leak_gbar 2.0 [1] 2.0 [1]
|
||||
soma_leak_erev -65 [1] -65 [1]
|
||||
soma_na_type jsrna [2] jsrna [2]
|
||||
soma_Cap 12.0 [1] 12.0 [1]
|
||||
soma_e_k -84 [1] -84 [1]
|
||||
soma_e_na 50. [1] 50. [1]
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Model is based on the guinea pig bushy cell model (RM03, above),
|
||||
but with a fast sodium channel from Rothman et al, 1993. and Ih currents
|
||||
from Liu et al. 2014
|
||||
|
||||
[2] Sodium channel from Rothman, Young and Manis, J Neurophysiol. 1993 Dec;70(6):2562-83.
|
||||
|
||||
[3] Ih Currents from Liu, Manis, Davis, J Assoc Res Otolaryngol. 2014 Aug;15(4):585-99.
|
||||
doi: 10.1007/s10162-014-0446-z. Epub 2014 Feb 21.
|
||||
Age "P10" (cultured SGC cells), Temperature=22C.
|
||||
Units are nS.
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
add_table_data(
|
||||
"MSO_principal_channels",
|
||||
row_key="field",
|
||||
col_key="cell_type",
|
||||
species="guineapig",
|
||||
data=u"""
|
||||
|
||||
This table describes the ion channel densities
|
||||
for a putative MSO principal neuron based on the original Rothman Manis 2003 model for bushy cells.
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
MSO-principal
|
||||
|
||||
MSO_name Principal
|
||||
soma_na_gbar 1000. [1]
|
||||
soma_kht_gbar 150.0 [1]
|
||||
soma_klt_gbar 200.0 [1]
|
||||
soma_ka_gbar 0.0 [1]
|
||||
soma_ih_gbar 20.0 [1]
|
||||
soma_leak_gbar 2.0 [1]
|
||||
soma_leak_erev -65 [1]
|
||||
soma_na_type nacn [1]
|
||||
soma_ih_type ihvcn [1]
|
||||
soma_Cap 12.0 [1]
|
||||
soma_e_k -84 [1]
|
||||
soma_e_na 50. [1]
|
||||
soma_ih_eh -43 [1]
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] This MSO neuron model is basied on Rothman and Manis, 2003 bushy cell, type II
|
||||
Age "adult", Temperature=22C
|
||||
Units are nS.
|
||||
|
||||
|
||||
""",
|
||||
)
|
||||
37
cnmodel/data/populations.py
Normal file
37
cnmodel/data/populations.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
from ._db import add_table_data
|
||||
|
||||
add_table_data(
|
||||
"populations",
|
||||
row_key="field",
|
||||
col_key="cell_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
sgc bushy tstellate dstellate octopus pyramidal tuberculoventral
|
||||
|
||||
n_cells 10000 [1] 6500 [2] 6500 [2] 650 [3] 5000 3000 5000
|
||||
cf_min 2000 2000 2000 2000 2000 2000 2000
|
||||
cf_max 90000 90000 90000 90000 90000 90000 90000
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] ?
|
||||
|
||||
[2] Rough estimate from allen brain atlas data:
|
||||
Volume of VCN is 0.377 mm^3, by counting voxels with 'VCO' (101) label in Common Coordinate Framework atlas.
|
||||
753370 voxels * 0.5 * 10e-6**3 m^3/vox = 0.377 mm^3
|
||||
Counted Slc17a7 (pan-excitatory) cell bodies in a 500x500 um chunk of VCN
|
||||
http://mouse.brain-map.org/experiment/siv?id=69014470&imageId=68856767&initImage=ish&coordSystem=pixel&x=7616.5&y=4144.5&z=1
|
||||
266 cells in 500x500 um = 34707 cells / mm^2
|
||||
34707**3/2 * 0.377 mm^3 = 13084 cells total
|
||||
Assume half are bushy, half are T-stellate
|
||||
|
||||
[3] Rough estimate from allen brain atlas data:
|
||||
Similar to [2], using Gad1 inhibitory marker
|
||||
http://mouse.brain-map.org/experiment/siv?id=75492764&imageId=75405134&initImage=ish&coordSystem=pixel&x=5320.5&y=3232.5&z=1
|
||||
36 cells in 500x500 um = 144e6 / m^2 ~= 1728 / mm^2
|
||||
= 651 cells total (VCN, unilateral)
|
||||
|
||||
""",
|
||||
)
|
||||
503
cnmodel/data/synapses.py
Normal file
503
cnmodel/data/synapses.py
Normal file
@@ -0,0 +1,503 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
from ._db import add_table_data
|
||||
|
||||
# sgc old weights:
|
||||
# bushy tstellate dstellate octopus pyramidal tuberculoventral
|
||||
# weight 0.027 [12] 0.006 [12] 0.00064 [12] 0.0011 [12] 0.0023 [12] 0.0029 [12]
|
||||
# tau1 0.1 [5] 0.1 [5] 0.2 [5] 0.1 [5] 0.1 [5] 0.1 [5]
|
||||
# tau2 0.3 [5] 0.3 [5] 0.5 [5] 0.3 [5] 0.3 [5] 0.3 [5]
|
||||
# erev 0 [5] 0 [5] 0 [5] 0 [5] 0 [5] 0 [5]
|
||||
|
||||
add_table_data(
|
||||
"sgc_synapse",
|
||||
row_key="field",
|
||||
col_key="post_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
AMPA_gmax and NMDA_gmax are the estimated average peak conductances (in nS)
|
||||
resulting from an action potential in a single auditory nerve terminal, under
|
||||
conditions that minimize the effects of short-term plasticity.
|
||||
AMPA_gmax are from values measured at -65 mV (or -70mV), and represent SINGLE TERMINAL
|
||||
conductances
|
||||
AMPAR_gmax are the individual synapse postsynaptic conductance
|
||||
NMDA_gmax values are taken as the fraction of the current that is NMDAR dependent
|
||||
at +40 mV (see below)
|
||||
|
||||
n_rsites is the number of release sites per SGC terminal.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate octopus pyramidal tuberculoventral cartwheel
|
||||
|
||||
AMPA_gmax 21.05±15.4 [1] 4.6±3.1 [2] 0.49±0.29 [7] 0.87±0.23 [3] 0.6±0.3 [8] 2.2±1.5 [8] 0
|
||||
AMPAR_gmax 4.6516398 [10] 4.632848 [10] 1.7587450 [10] 16.975147 [10] 0.9 [8] 2.2 [8] 0
|
||||
NMDA_gmax 10.8±4.6 [1] 2.4±1.6 [2] 0.552±0.322 [7] 0.17±0.046 [3] 0.4±0.33 [8] 2.4±1.6 [8] 0
|
||||
NMDAR_gmax 0.4531933 [10] 1.2127097 [10] 0.9960820 [10] 0.6562702 [10] 0.2 [8] 1.2127097 [8] 0
|
||||
NMDAR_vsh -15.0 [12] -15.0 [12] -15.0 [12] -15.0 [12] -15.0 [12] -15.0 [12] 0
|
||||
NMDAR_vshift 0.0 [12] 0.0 [12] 0.0 [12] 0.0 [12] 0.0 [12] 0.0 [12] 0
|
||||
EPSC_cv 0.12 [8] 0.499759 [9] 0.886406 [9] 1.393382 [9] 0.499 [8] 0.499 [8] 0
|
||||
Pr 1.000 [11] 1.000 [11] 1.000 [11] 1.000 [11] 1.000 [8] 1.000 [8] 0
|
||||
n_rsites 100 [5] 4 [6] 1 [4] 1 [4] 2 [8] 2 [8] 0
|
||||
delay 0.600 0.600 0.600 0.600 0.600 0.600 0
|
||||
weight 0.020377 0.003679 0.000457 0.001311 0.000327 0.000808 0
|
||||
tau1 0.158 0.174 0.152 0.125 0.167 0.157 0
|
||||
tau2 0.246 1.501 1.652 0.251 1.489 1.641 0
|
||||
erev 0.0 0.0 0.0 0.0 0.0 0.0 0
|
||||
----------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Derived from Cao, X. & Oertel, D. (2010). Single-terminal conductance was
|
||||
reported as 21.5±15.4 nS (1.4±1.0 nA at -65 mV). The ratio of NMDA current to
|
||||
total current is 0.3, so AMPA and NMDA currents are:
|
||||
AMPA_gmax = 21.5±15.4 nS (measured at -65 mV)
|
||||
NMDA_gmax = 21.5±15.4 nS * 0.3 = 10.8±4.6 nS
|
||||
Age>p17, Temperature=33C, [Mg2+]=1.3mM, [Ca2+]=2.4mM
|
||||
Units are nS.
|
||||
See also Pliss et al., J. Neurophys., 2009 (and note [12])
|
||||
|
||||
[2] Derived from Cao, X. & Oertel, D. (2010). Single-terminal conductance was
|
||||
estimated as 4.6±3.1 nS. The ratio of NMDA current to
|
||||
total current is 0.53, so AMPA and NMDA currents are:
|
||||
AMPA_gmax = 4.6±3.1 nS
|
||||
NMDA_gmax = 4.6±3.1 nS * 0.53 = 2.4±1.6 nS
|
||||
Estimated number of inputs per AN fiber:
|
||||
0.3 nA step, 0.08 nA mini size = ~ 4 inputs per AN fiber
|
||||
Age>p17, Temperature=33C, [Mg2+]=1.3mM, [Ca2+]=2.4mM
|
||||
Units are nS
|
||||
|
||||
[3] Derived from Cao, X. & Oertel, D. (2010). Single-terminal conductance was
|
||||
estimated as 52±14 nS / 60 = 0.87±0.23 nS. The ratio of NMDA current to
|
||||
total current is 0.2, so AMPA and NMDA currents are:
|
||||
AMPA_gmax = 0.87±0.23 nS
|
||||
NMDA_gmax = 0.87±0.23 nS * 0.2 = 0.17±0.046 nS
|
||||
Age>p17, Temperature=33C, [Mg2+]=1.3mM, [Ca2+]=2.4mM
|
||||
Units are nS
|
||||
|
||||
[4] Assumption based on mini size and lack of discernable EPSC step (guess).
|
||||
Should be verified.
|
||||
|
||||
[5] Oleskevich & Walmsley ~2002, Wang & Manis 2005. Units are nS
|
||||
|
||||
[6] A value of 45 would be chosen to satisfy the CV of EPSC amplitude determined in [9].
|
||||
However, those measures are for simultaneous stimulation of multiple AN fibers.
|
||||
A value of 4 is included here to correspond to measures in Cao and Oertel (2010)
|
||||
(see note [2])
|
||||
|
||||
[7] (Xie and Manis, Frontiers in Neural Circuits, 2017):
|
||||
Measurements from CBA/CaJ mouse "radiate" multipolar cells in the AVCN.
|
||||
Single terminal conductance = (1.2 ± 0.70 nA/70 mV)/ 35 inputs = 0.490 ± 0.286 nS
|
||||
(see connections.py)
|
||||
Single terminal conductance from mini = 34 pA/70 mV = 0.486 nS (single mini)
|
||||
Assume same AMPA/NMDA ratio as tstellate cells, but measures made where NMDA = 0
|
||||
(at negative V):
|
||||
AMPA_gmax = 0.490±0.286 nS
|
||||
NMDA_gmax = 0.490±0.286 nS * 0.53/0.47 = 0.552±0.322 nS
|
||||
Age > P35, Temperature=34C, [Mg2+]=1.5mM, [Ca2+]=2.5mM
|
||||
|
||||
[8] Thin air. These are for testing the software, not necessarily for performing
|
||||
real simulations. Note: Pyramidal cell strength has been reduced
|
||||
because of large convergence and high input resistance of the reference cell model.
|
||||
Release 1 (Nov 2017):
|
||||
pyramidal
|
||||
|
||||
0.6 ±1.05 [8]
|
||||
1.8 [8]
|
||||
0.8±0.66 [8]
|
||||
0.4 [8]
|
||||
-15.0 [12]
|
||||
0.499 [8]
|
||||
1.000 [8]
|
||||
2 [8]
|
||||
|
||||
|
||||
[9] Reanalysis of evoked EPSCs in stellate cells (Manis/Xie, 2014)
|
||||
|
||||
[10] Maximum AMPA open conductance per synaptic site (units are pS).
|
||||
These values are calculated by running python cnmodel/synapses/tests/test_psd.py
|
||||
for a specific cell type (if the cell uses the receptor mechanisms; this is
|
||||
not necessary for simple exp2syn style mechanisms)
|
||||
to ensure that maximum AMPA conductance during PSG matches [1, 2 or 3]
|
||||
For a bushy cell, the original default values (bushy cell) were:
|
||||
AMPAR_gmax 3.314707700918133
|
||||
NMDAR_gmax 0.4531929783503451
|
||||
These values will also depend on the number of release sites per
|
||||
synapse (the total conductance is produce of site gmax and nsites).
|
||||
|
||||
A note on the precision of these values: This precision is only
|
||||
required for the tests of the model, as a way of ensuring numerical
|
||||
equivalency after potential modifications of the code. The precision
|
||||
of the value is in no way intended to specificy biological precision.
|
||||
|
||||
For example, a change in the rate constants in the AMPA_Trussell AMPA
|
||||
receptor model could (and probably would) change the open probability,
|
||||
and therefore the maximal conductance of an EPSC. However, as this is
|
||||
only a representation of the EPSC, the "receptor" conductance should
|
||||
be scaled so that the computed EPSC has the same maximal conductance
|
||||
as prior to the kinetic modifications. Because the receptor model is
|
||||
numerically computed (and not analytically tractable without
|
||||
additional knowledge of the ligand time course), a numerical solution
|
||||
is required.
|
||||
|
||||
[11] Pr is the initial release probability. The value can be computed by
|
||||
setting Pr to 1 in this file, and running the cnmodel test_synapses.py
|
||||
with the appropriate presynaptic source and postsynaptic target,
|
||||
once all other parameters are set. The Pr is used to rescale
|
||||
the AMPAR_gmax so that the total current matches the data in
|
||||
AMPA_gmax in the table (on average).
|
||||
|
||||
[12] NMDA_vshift is the voltage shift for the activation of the NMDAR's, relative
|
||||
to 0 (standard in the NMDA_Kampa model). A negative value shifts the voltage
|
||||
dependence to the right (depolarizing).
|
||||
The value of the shift here (-15 mV) was chosen based on an exploration
|
||||
of fitting functions against the NMDA-Kampa IV curve in an SGC-bushy cell
|
||||
model, and comparing them against data. The functions were the modified
|
||||
Woodhull function and a Boltzmann function, yielding values of 1.19 mM for
|
||||
k0 and 0.78 for delta (tau decay at +40 mV of 16.4 ms), and Vr -3 mV, Vh
|
||||
16 mV for the Boltzmann fit. These are close to the values reported in
|
||||
for NMDA currents in p14-p26 CBA/CaJ mice in Pliss et al. (J. Neurophys.
|
||||
102, 2627, 2009). Note: Pliss et al. agree with Cao and Oertel regarding
|
||||
an approximate 10-fold difference between AMPA and NMDA conductance in
|
||||
mouse bushy cells. An exact fit was not obtained, but no other parameters
|
||||
of the NMDA_Kampa model were changed.
|
||||
|
||||
[13] weight is the weight to use in a netcon object (NEURON) for "simple"
|
||||
synapses based on the exp2syn mechanism.
|
||||
Parameters Weight, tau1, tau2, delay and erev from comare_simple_multisynapses
|
||||
run and curve fitting (all cells)
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
add_table_data(
|
||||
"sgc_ampa_kinetics",
|
||||
row_key="field",
|
||||
col_key="post_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
AMPA receptor kinetic values obtained by fitting the model of Raman and
|
||||
Trussell (1992) to measured EPSCs in the mouse VCN.
|
||||
|
||||
Ro1, Ro2, Rc1, Rc2, and PA are kinetic constants affecting the AMPA receptor
|
||||
mechanism. tau_g and A affect the speed and amplitude of transmitter release
|
||||
(implemented in the presynaptic release mechanism).
|
||||
These parameters were selected to fit the model output to known EPSC shapes.
|
||||
|
||||
PA is a polyamine block parameter ued in the AMPAR mechanism (concentration in micromolar).
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate pyramidal octopus tuberculoventral mso
|
||||
|
||||
Ro1 107.85 [4] 39.25 [4] 39.25 [7] 39.25 [4] 107.85 [5] 39.25 [7] 107.85 [4]
|
||||
Ro2 0.6193 [4] 4.40 [4] 4.40 [7] 4.40 [4] 0.6193 [5] 4.40 [7] 0.6193 [4]
|
||||
Rc1 3.678 [4] 0.667 [4] 0.667 [7] 0.667 [4] 3.678 [5] 0.667 [7] 3.678 [4]
|
||||
Rc2 0.3212 [4] 0.237 [4] 0.237 [7] 0.237 [4] 0.3212 [5] 0.237 [7] 0.3212 [4]
|
||||
tau_g 0.10 [4] 0.25 [4] 0.25 [7] 0.25 [4] 0.10 [5] 0.25 [4] 0.10 [4]
|
||||
amp_g 0.770 [4] 1.56625 [4] 1.56625 [7] 1.56625 [4] 0.770 [5] 1.56625 [4] 0.770 [4]
|
||||
|
||||
PA 45 [12] 0.1 [12] 0.1 [7] 0.1 [12] 45 [5] 0.1 [7] 45 [12]
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
|
||||
[4] Xie & Manis 2013, Table 2
|
||||
|
||||
[5] copied from bushy cells; no direct data.
|
||||
|
||||
[7] Data copied from t-stellate column (no literature on these cells). Unpublished data suggests these
|
||||
should be slightly different, but is complicated by electrotonically distant synaptic sites that
|
||||
preclude accurate measurement of kinetics.
|
||||
|
||||
[12] Wang & Manis (unpublished)
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
add_table_data(
|
||||
"sgc_epsp_kinetics",
|
||||
row_key="field",
|
||||
col_key="post_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
EPSC shape parameters obtained from fits of Xie & Manis 2013 Equation 3 to measured EPSCs.
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate pyramidal octopus tuberculoventral
|
||||
|
||||
tau_r 0.253 [11] 0.19 [11] 0.253 [13]
|
||||
tau_f 0.16 [11] 1.073 [11] 0.16 [13]
|
||||
tau_s 0.765 [11] 3.3082 [11] 0.765 [13]
|
||||
F 0.984 [11] 0.917 [11] 0.984 [13]
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
|
||||
[11] Xie & Manis 2013, Table 3
|
||||
[13] Copied from bushy cells; no direct data
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
add_table_data(
|
||||
"sgc_release_dynamics",
|
||||
row_key="field",
|
||||
col_key="post_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
Kinetic parameters correspond to variables as described by Dittman et al.
|
||||
(2000), their Table 1.
|
||||
|
||||
F: ~ Resting release probability
|
||||
|
||||
---------------------------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate pyramidal octopus tuberculoventral
|
||||
|
||||
F 0.29366 [1] 0.43435 [1] 0.43435 [2] 0.43435 [1] 0.29366 [14] 0.43435 [1]
|
||||
k0 0.52313 [1] 0.06717 [1] 0.06717 [2] 0.06717 [1] 0.52313 [14] 0.06717 [1]
|
||||
kmax 19.33805 [1] 52.82713 [1] 52.82713 [2] 52.82713 [1] 19.33805 [14] 52.82713 [1]
|
||||
kd 0.11283 [1] 0.08209 [1] 0.08209 [2] 0.08209 [1] 0.11283 [14] 0.08209 [1]
|
||||
ks 11.531 [1] 14.24460 [1] 14.24460 [2] 14.24460 [1] 11.531 [14] 14.24460 [1]
|
||||
kf 17.78 [1] 18.16292 [1] 18.16292 [2] 18.16292 [1] 17.78 [14] 18.16292 [1]
|
||||
taud 15.16 [1] 3.98 [1] 3.98 [2] 3.98 [1] 15.16 [14] 3.98 [1]
|
||||
taus 17912.2 [1] 16917.120 [1] 16917.120 [2] 16917.120 [1] 17912.2 [14] 16917.120 [1]
|
||||
tauf 9.75 [1] 11.38 [1] 11.38 [2] 11.38 [1] 9.75 [14] 11.38 [1]
|
||||
dD 0.57771 [1] 2.46535 [1] 2.46535 [2] 2.46535 [1] 0.57771 [14] 2.46535 [1]
|
||||
dF 0.60364 [1] 1.44543 [1] 1.44543 [2] 1.44543 [1] 0.60364 [14] 1.44543 [1]
|
||||
|
||||
---------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Xie & Manis 2013, Table 1. Although independently measured in > P30 CBA/CaJ mice,
|
||||
the values are similar to the measurements from Yang and Xu-Friedman, 2008
|
||||
in P14-P21 CBA/CaJ mice.
|
||||
|
||||
[2] Data copied from t-stellate column (no literature on these cells)
|
||||
|
||||
[14] Data copied from bushy cell column (no literature on these cells)
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
add_table_data(
|
||||
"gly_kinetics",
|
||||
row_key="field",
|
||||
col_key="post_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
Kinetic parameters for glycine receptor mechanisms.
|
||||
|
||||
These are currently used for both DS and TV synapses, but should probably be
|
||||
separated in the future.
|
||||
|
||||
KV, KU, and XMax are kinetic parameters for the cleft transmitter mechanism.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate pyramidal tuberculoventral
|
||||
|
||||
KV 1e9 [1] 531.0 [1] 531.0 [1] 531.0 [2] 531.0 [2]
|
||||
KU 4.46 [1] 4.17 [1] 4.17 [1] 4.17 [2] 4.17 [2]
|
||||
XMax 0.733 [1] 0.731 [1] 0.731 [1] 0.731 [2] 0.731 [2]
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Xie & Manis 2013
|
||||
|
||||
[2] Copied from tstellate data (Kuo et al., J. Neurophysiol. indicate glycinergic IPSCs in TV
|
||||
and pyramidal cells are fast, with a decay time constant similar to that seen in tstellate
|
||||
cells). In pyramidal cells, this is consistent with the brief cross-correlation tip (Voigt
|
||||
and Young, 1980) and brief somatic current source (Manis and Brownell, 1983).
|
||||
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
add_table_data(
|
||||
"dstellate_synapse",
|
||||
row_key="field",
|
||||
col_key="post_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
DStellate Synapse values
|
||||
gly_gmax is the default value in the program (scaled by Po for the receptors). See synapses/gly_psd.py
|
||||
IPSC_cv is the coefficient of variation of the IPSC. (Not currently used in the model)
|
||||
Pr is the release probabilty (not currently used); built into release mechanism for multisite synapses.
|
||||
n_rsites is the number of release sites per dstellate terminal.
|
||||
|
||||
---------------------------------------------------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate octopus pyramidal tuberculoventral cartwheel
|
||||
|
||||
gly_gmax 2.5 [1] 1.0 [5] 1.0 [2] 0. [2] 2.0 [3] 2.0 [3] 0±0 [2]
|
||||
IPSC_cv 0.3 [3] 0.3 [3] 0.3 [3] 0.3 [3] 0.3 [3] 0.3 [3] 0.3 [3]
|
||||
Pr 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4]
|
||||
n_rsites 10 [5] 5 [5] 5 [5] 0 [2] 5 [5] 25 [5] 0 [2]
|
||||
delay 0.000 0.000 0.000 0 0.000 0.000 0
|
||||
weight 0.004131 0.004455 0.0 0 0.002228 0.012097 0
|
||||
tau1 0.187 0.152 0.152 0 0.152 0.152 0
|
||||
tau2 7.953 1.247 1.247 0 1.247 1.247 0
|
||||
erev -70.0 -70.0 -70.0 0 -70.0 -70.0 0
|
||||
---------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Estimate
|
||||
|
||||
[2] No evidence for dstellate inputs to other d stellate cells or cartwheel cells.
|
||||
Octopus cells do not get inhibitory input
|
||||
|
||||
[3] Guess
|
||||
|
||||
[4] Default value
|
||||
|
||||
[5] Guess *educated* DS->TS from Xie and Manis, 2013. 99 pA mini @ 50 mV driving ~ 2 nS
|
||||
|
||||
[6] delay from pre to post; default is 0
|
||||
|
||||
[7] Parameters Weight, tau1, tau2, delay and erev from comare_simple_multisynapses run and curve fitting (all cells)
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
|
||||
add_table_data(
|
||||
"tuberculoventral_synapse",
|
||||
row_key="field",
|
||||
col_key="post_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
Tuberculventral Synapse values
|
||||
gly_gmax is the default value in the program (scaled by Po for the receptors). See synapses/gly_psd.py
|
||||
IPSC_cv is the coefficient of variation of the IPSC. (Not currently used in the model)
|
||||
Pr is the release probabilty (not currently used)
|
||||
n_rsites is the number of release sites per tuberculoventral terminal.
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate octopus pyramidal tuberculoventral cartwheel
|
||||
|
||||
gly_gmax 5.0 [3] 3.0 [3] 3.0 [3] 0. [2] 2.1±2.9 [6] 1.8±2.3 [6] 0±0 [6]
|
||||
IPSC_cv 0.3 [3] 0.3 [3] 0.3 [3] 0.3 [3] 1.0 [3] 0.3 [3] 0.3 [3]
|
||||
Pr 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4]
|
||||
n_rsites 6 [5] 6 [5] 0 [1] 0 [2] 6 [5] 6 [5] 6 [5]
|
||||
delay 0.600 0.600 0 0 0.600 0.600 0
|
||||
weight 0.002371 0.008114 0 0 0.002705 0.002705 0
|
||||
tau1 0.190 0.149 0 0 0.149 0.149 0
|
||||
tau2 7.952 1.250 0 0 1.250 1.250 0
|
||||
erev -70.0 -70.0 0 0 -70.0 -70.0 0
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Default value from GlyPSD
|
||||
|
||||
[2] No evidence for tuberculo inputs to other d stellate cells or cartwheel cells.
|
||||
Octopus cells do not get inhibitory input
|
||||
|
||||
[3] Guess
|
||||
|
||||
[4] Default value
|
||||
|
||||
[5] Guess
|
||||
|
||||
[6] Mouse data
|
||||
TV conductance onto pyr cells: 2.1 nS SD 2.9 nS (Kuo et al., 2012)
|
||||
TV conductance onto TV cells: 1.8 ns SD 2.3 nS.
|
||||
|
||||
[7] Parameters Weight, tau1, tau2, delay and erev from comare_simple_multisynapses run and curve fitting (all cells)
|
||||
Fitting done against 200 rep average for bushy, 500 rep average for all others.
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
add_table_data(
|
||||
"cartwheel_synapse",
|
||||
row_key="field",
|
||||
col_key="post_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
Cartwheel cell synapse values
|
||||
gly_gmax is the default value in the program (scaled by Po for the receptors). See synapses/gly_psd.py
|
||||
IPSC_cv is the coefficient of variation of the IPSC. (Not currently used in the model)
|
||||
Pr is the release probabilty (not currently used)
|
||||
n_rsites is the number of release sites per cartwheel cell terminal.
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
bushy tstellate dstellate octopus pyramidal tuberculoventral cartwheel
|
||||
|
||||
gly_gmax 0.0 [3] 0.0 [3] 0.0 [3] 0. [2] 2.1±2.9 [6] 0±0 [6] 1.8±2.3 [6]
|
||||
IPSC_cv 0.3 [3] 0.3 [3] 0.3 [3] 0.3 [3] 1.0 [3] 0.3 [3] 0.3 [3]
|
||||
Pr 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4] 1.000 [4]
|
||||
n_rsites 6 [5] 6 [5] 0 [1] 0 [2] 6 [5] 6 [5] 6 [5]
|
||||
delay 0 [7] 0 0 0 0 0 0
|
||||
weight 0.01 0.01 0.01 0.0 0.01 0.01 0.01
|
||||
tau1 0.3 [5] 0.3 [5] 0.3 [5] 0.3 [5] 0.3 [5] 0.3 [5] 0.3 [5]
|
||||
tau2 2.0 [5] 2.0 [5] 2.0 [5] 2.0 [5] 2.0 [5] 2.0 [5] 2.0 [5]
|
||||
erev -70 [5] -70 [5] -70 [5] -70 [5] -70 [5] -70 [5] -70 [5]
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Default value from GlyPSD
|
||||
|
||||
[2] No evidence for cartwheel inputs to Dstellate, bushy or tstellate cells.
|
||||
Octopus cells do not get inhibitory input
|
||||
|
||||
[3] Guess
|
||||
|
||||
[4] Default value
|
||||
|
||||
[5] Guess
|
||||
|
||||
[6] Mouse data
|
||||
TV conductance onto pyr cells: 2.1 nS SD 2.9 nS (Kuo et al., 2012)
|
||||
TV conductance onto TV cells: 1.8 ns SD 2.3 nS.
|
||||
|
||||
[7] delay from pre to post; default is just 0
|
||||
|
||||
""",
|
||||
)
|
||||
|
||||
add_table_data(
|
||||
"bushy_synapse",
|
||||
row_key="field",
|
||||
col_key="post_type",
|
||||
species="mouse",
|
||||
data=u"""
|
||||
|
||||
AMPA_gmax and NMDA_gmax are the estimated average peak conductances (in nS)
|
||||
resulting from an action potential in a single presynaptic terminal under
|
||||
conditions that minimize the effects of short-term plasticity.
|
||||
AMPA_gmax are from values measured at -65 mV (or -70mV), and represent SINGLE TERMINAL
|
||||
conductances
|
||||
AMPAR_gmax are the individual synapse postsynaptic conductance
|
||||
NMDA_gmax values are taken as the fraction of the current that is NMDAR dependent
|
||||
at +40 mV (see below)
|
||||
|
||||
n_rsites is the number of release sites per terminal.
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
mso
|
||||
|
||||
AMPA_gmax 21.05±15.4 [1]
|
||||
AMPAR_gmax 4.6516398 [2]
|
||||
NMDA_gmax 0 [3]
|
||||
NMDAR_gmax 0 [3]
|
||||
EPSC_cv 0.12 [4]
|
||||
Pr 1.000 [5]
|
||||
n_rsites 36 [6]
|
||||
weight 0.01
|
||||
delay 0
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
[1] Taken from the mouse bushy cell model.
|
||||
Units are nS.
|
||||
|
||||
[2] See note [10] for the SGC-bushy synapse
|
||||
|
||||
[3] Assume no NMDA receptors at this synapse
|
||||
|
||||
[4] See SGC-bushy synapse
|
||||
|
||||
[5] Just to scale with the multisite synapse model
|
||||
|
||||
[6] This is a guess.
|
||||
|
||||
""",
|
||||
)
|
||||
72
cnmodel/data/tests/test_db.py
Normal file
72
cnmodel/data/tests/test_db.py
Normal file
@@ -0,0 +1,72 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import pytest
|
||||
import sys
|
||||
from cnmodel import data
|
||||
|
||||
|
||||
table = u"""
|
||||
|
||||
Description of data
|
||||
It has multiple lines
|
||||
|
||||
And empty lines.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
col1 col2 col3
|
||||
param1 15±6.5 [1] 2.2±1.5 [2] 0.87±0.23 [3]
|
||||
param2 3 5 0.87±0.23 [3]
|
||||
param3 3.4 7 [2]
|
||||
param4 1 [12]
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
[1] Source 1
|
||||
[2] Multiline source
|
||||
#2
|
||||
end of #2
|
||||
[3] Multiline source
|
||||
#3
|
||||
end of #3
|
||||
|
||||
[12] another
|
||||
source
|
||||
|
||||
|
||||
"""
|
||||
|
||||
data.add_table_data(
|
||||
"test_data", row_key="param", col_key="col", data=table, extra="test_kwd"
|
||||
)
|
||||
|
||||
|
||||
def test_db():
|
||||
# this should only be a problem with Python 2, so we need to
|
||||
# check which version we are running under before letting the test
|
||||
# throw the exception:
|
||||
if sys.version_info[0] == 2:
|
||||
with pytest.raises(TypeError):
|
||||
# raise exception if unicode is given in ono-unicode string
|
||||
data.add_table_data("test_data", row_key="param", col_key="col", data=u"±")
|
||||
|
||||
d = data.get("test_data", param="param1", col="col2", extra="test_kwd")
|
||||
assert d == (2.2, 1.5)
|
||||
|
||||
d = data.get(
|
||||
"test_data", param="param1", col=["col1", "col2", "col3"], extra="test_kwd"
|
||||
)
|
||||
assert d == {"col1": (15, 6.5), "col2": (2.2, 1.5), "col3": (0.87, 0.23)}
|
||||
|
||||
d = data.get(
|
||||
"test_data", param="param2", col=["col1", "col2", "col3"], extra="test_kwd"
|
||||
)
|
||||
assert d == {"col1": 3, "col2": 5, "col3": (0.87, 0.23)}
|
||||
|
||||
d = data.get(
|
||||
"test_data", param="param3", col=["col1", "col2", "col3"], extra="test_kwd"
|
||||
)
|
||||
assert d == {"col1": 3.4, "col2": None, "col3": 7}
|
||||
|
||||
s = data.get_source("test_data", param="param1", col="col2", extra="test_kwd")
|
||||
assert "end of #2" in s
|
||||
|
||||
s = data.get_source("test_data", param="param2", col="col2", extra="test_kwd")
|
||||
assert s is None
|
||||
9
cnmodel/decorator/__init__.py
Executable file
9
cnmodel/decorator/__init__.py
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Channel decorator class for cnmodel
|
||||
#
|
||||
# Paul B. Manis, Ph.D. January 2016
|
||||
#
|
||||
from neuron import h
|
||||
|
||||
from .decorator import Decorator
|
||||
392
cnmodel/decorator/decorator.py
Normal file
392
cnmodel/decorator/decorator.py
Normal file
@@ -0,0 +1,392 @@
|
||||
from __future__ import print_function
|
||||
|
||||
__author__ = "pbmanis"
|
||||
|
||||
"""
|
||||
Decorator:
|
||||
A class to insert biophysical mechanisms into a model.
|
||||
This function attempts to automatically decorate a hoc-imported model set of sections
|
||||
with appropriate conductances.
|
||||
|
||||
The class takes as input the object hf, which is an instance of morphology
|
||||
It also takes the cellType, a string that directs how conductances should be inserted.
|
||||
|
||||
"""
|
||||
|
||||
import string
|
||||
import numpy as np
|
||||
import cnmodel.util as nu
|
||||
from cnmodel.util import Params
|
||||
|
||||
|
||||
class Decorator:
|
||||
def __init__(self, cell, parMap=None, verify=False):
|
||||
|
||||
cellType = cell.type.lower()
|
||||
self.channelInfo = Params(
|
||||
newCm=1.0,
|
||||
newRa=150.0, # standard value
|
||||
newg_leak=0.000004935,
|
||||
eK_def=-85,
|
||||
eNa_def=50,
|
||||
ca_init=70e-6, # free calcium in molar
|
||||
v_init=-80, # mV
|
||||
pharmManip={
|
||||
"TTX": False,
|
||||
"ZD": False,
|
||||
"Cd": False,
|
||||
"DTX": False,
|
||||
"TEA": False,
|
||||
"XE": False,
|
||||
},
|
||||
cellType=cell.status["cellClass"],
|
||||
modelType=cell.status["modelType"],
|
||||
modelName=cell.status["modelName"],
|
||||
distanceMap=cell.hr.distanceMap,
|
||||
parMap=parMap,
|
||||
)
|
||||
self.excludeMechs = [] # ['ihvcn', 'kht', 'klt', 'nav11']
|
||||
print("modelType in dec: ", cell.status["modelType"])
|
||||
print("modelName in dec is ", cell.status["modelName"])
|
||||
print("cell type in dec: ", cellType)
|
||||
cell.channel_manager(
|
||||
modelName=cell.status["modelName"], modelType=cell.status["modelType"]
|
||||
)
|
||||
# print 'Cell: \n', dir(cell)
|
||||
# print 'mechanisms: ', cell.hr.mechanisms
|
||||
# gmapper allows us tor remap the names of mechanisms and their conductance names, which may
|
||||
# vary in the mod files.
|
||||
# The versions in the mechanisms directory here have been systematized, but this
|
||||
# dictionary may help when adding other conductances.
|
||||
|
||||
self.gbar_mapper = {
|
||||
"nacn": "gbar",
|
||||
"kht": "gbar",
|
||||
"klt": "gbar",
|
||||
"leak": "gbar",
|
||||
"ihvcn": "gbar",
|
||||
"jsrna": "gbar",
|
||||
"nav11": "gbar",
|
||||
"nacncoop": "gbar",
|
||||
"hcnobo": "gbar",
|
||||
}
|
||||
self.erev_mapper = {
|
||||
"nacn": "ena",
|
||||
"kht": "ek",
|
||||
"klt": "ek",
|
||||
"leak": "erev",
|
||||
"ihvcn": "eh",
|
||||
"jsrna": "ena",
|
||||
"nav11": "ena",
|
||||
"nacncoop": "ena",
|
||||
"hcnobo": "eh",
|
||||
}
|
||||
self.vshift_mapper = {
|
||||
"nacn": None,
|
||||
"kht": None,
|
||||
"klt": None,
|
||||
"leak": None,
|
||||
"ihvcn": None,
|
||||
"jsrna": None,
|
||||
"nav11": "vsna",
|
||||
"nacncoop": "vsna",
|
||||
"hcnobo": None,
|
||||
}
|
||||
self._biophys(cell, verify=verify)
|
||||
print(
|
||||
"\033[1;31;40m Decorator: Model Decorated with channels (if this appears more than once per cell, there is a problem)\033[0m"
|
||||
)
|
||||
|
||||
def _biophys(self, cell, verify=False):
|
||||
"""
|
||||
Inputs: run parameter structure, model parameter structure
|
||||
verify = True to run through the inserted mechanisms and see that they are really there.
|
||||
Outputs: None
|
||||
Action: Channel insertion into model
|
||||
Side Effects:
|
||||
Sets conductances in every different kind of section
|
||||
Does not update any class variables (via self).
|
||||
|
||||
original hoc code: Paul B. Manis, Ph.D.
|
||||
25 Sept. 2007
|
||||
Modified to use gca for HH formulation of calcium current
|
||||
14 Oct 2007
|
||||
converted for Python, 17 Oct 2012 (PB Manis)
|
||||
modified to use new hf hoc_reader class to access section types and mechanisms 10-14 Feb 2014 pbmanis
|
||||
"""
|
||||
# check to see if we already did this
|
||||
# createFlag = False
|
||||
cellType = self.channelInfo.cellType
|
||||
parMap = self.channelInfo.parMap
|
||||
dmap = self.channelInfo.distanceMap
|
||||
if self.channelInfo is None:
|
||||
raise Exception("biophys - no parameters or info passed!")
|
||||
if verify:
|
||||
print(
|
||||
"Biophys: Inserting channels as if cell type is {:s} with modelType {:s}".format(
|
||||
cellType, self.channelInfo.modelType
|
||||
)
|
||||
)
|
||||
|
||||
cell.hr.mechanisms = []
|
||||
for s in list(cell.hr.sec_groups.keys()):
|
||||
sectype = self.remapSectionType(s.rsplit("[")[0])
|
||||
if sectype not in cell.channelMap.keys():
|
||||
print(
|
||||
"encountered unknown section group type: %s Not decorating"
|
||||
% sectype
|
||||
)
|
||||
print("channels in map: ", cell.channelMap.keys())
|
||||
continue
|
||||
# print 'Biophys: Section type: ', sectype, 'from: ', s
|
||||
# print sectype
|
||||
# print 'channel mapping keys: ', cell.channelMap[sectype].keys()
|
||||
|
||||
# here we go through all themechanisms in the ionchannels table for this cell and compartment type
|
||||
# note that a mechanism may have multiple parameters in the table (gbar, vshft), so we:
|
||||
# a. only insert the mechanism once
|
||||
# b. only adjust the relevant parameter
|
||||
|
||||
for mechname in list(cell.channelMap[sectype].keys()):
|
||||
mech = mechname.split("_")[0] # get the part before the _
|
||||
parameter = mechname.split("_")[1] # and the part after
|
||||
if mech not in self.gbar_mapper.keys():
|
||||
print("Mechanism %s not found? " % mech)
|
||||
continue
|
||||
if mech in self.excludeMechs:
|
||||
continue
|
||||
if verify:
|
||||
print(
|
||||
"Biophys: section group: {:s} insert mechanism: {:s} at {:.8f}".format(
|
||||
s, mech, cell.channelMap[sectype][mech]
|
||||
)
|
||||
)
|
||||
if mech not in cell.hr.mechanisms:
|
||||
cell.hr.mechanisms.append(
|
||||
mech
|
||||
) # just add the mechanism to our list
|
||||
x = nu.Mechanism(mech)
|
||||
if cell.hr.sec_groups[s] == set():
|
||||
continue # no sections of this type
|
||||
for sec in cell.hr.sec_groups[
|
||||
s
|
||||
]: # insert into all the sections of this type (group)
|
||||
try:
|
||||
x.insert_into(cell.hr.get_section(sec))
|
||||
except:
|
||||
raise ValueError(
|
||||
"Failed with mech: %s " % mech
|
||||
) # fail if cannot insert.
|
||||
if verify:
|
||||
print(" inserted %s into section " % mech, sec)
|
||||
|
||||
gbar_setup = None
|
||||
gbar = 0.0
|
||||
if parameter == "gbar":
|
||||
gbar = self.gbarAdjust(
|
||||
cell, sectype, mechname, sec
|
||||
) # map density by location/distance
|
||||
gbar_setup = "%s_%s" % (
|
||||
self.gbar_mapper[mech],
|
||||
mech,
|
||||
) # map name into .mod file name
|
||||
# if parMap is not None and mech in parMap.keys(): # note, this allows parmap to have elements BESIDES mechanisms
|
||||
# if verify:
|
||||
# print 'parMap[mech]', mech, parMap[mech], gbar,
|
||||
# gbar = gbar * parMap[mech] # change gbar here...
|
||||
# if verify:
|
||||
print("####### new gbar: ", gbar)
|
||||
|
||||
vshift_setup = None
|
||||
vshift = 0.0
|
||||
# print 'Parameter: ', parameter, mech, self.vshift_mapper[mech]
|
||||
if parameter == "vshift" and self.vshift_mapper[mech] is not None:
|
||||
vshift_setup = "%s_%s" % (
|
||||
self.vshift_mapper[mech],
|
||||
mech,
|
||||
) # map voltage shift
|
||||
vshift = cell.channelMap[sectype][mechname]
|
||||
print(
|
||||
"********* mech: gbar, vshift: ", gbar, vshift, vshift_setup
|
||||
)
|
||||
exit()
|
||||
|
||||
cell.hr.h.Ra = self.channelInfo.newRa
|
||||
for sec in cell.hr.sec_groups[
|
||||
s
|
||||
]: # now set conductances and other parameters as requested
|
||||
cell.hr.get_section(sec).Ra = self.channelInfo.newRa # set Ra here
|
||||
if gbar_setup is not None:
|
||||
setattr(
|
||||
cell.hr.get_section(sec), gbar_setup, gbar
|
||||
) # set conductance magnitude
|
||||
# print('gbar_setup: %s %s' % (sectype, gbar_setup), gbar)
|
||||
if vshift_setup is not None:
|
||||
try:
|
||||
setattr(
|
||||
cell.hr.get_section(sec), vshift_setup, vshift
|
||||
) # set conductance magnitude
|
||||
except:
|
||||
print(dir(cell.hr.get_section(sec)))
|
||||
raise ValueError(
|
||||
" cannot set mechanism attribute %s ... %s "
|
||||
% (vshift_setup, vshift)
|
||||
)
|
||||
# print('vshift_setup: %s %s' % (sectype, vshift_setup), vshift)
|
||||
|
||||
if hasattr(
|
||||
cell, "channelErevMap"
|
||||
): # may not always have this mapping
|
||||
secobj = cell.hr.get_section(
|
||||
sec
|
||||
) # get the NEURON section object
|
||||
mechsinsec = cell.get_mechs(
|
||||
secobj
|
||||
) # get list of mechanisms in this section
|
||||
if (
|
||||
mech in mechsinsec
|
||||
): # confirm that the mechanism is really there
|
||||
setrev = (
|
||||
False
|
||||
) # We try two ways for different mechanisms - just flag it
|
||||
try:
|
||||
setattr(
|
||||
secobj,
|
||||
self.erev_mapper[mech],
|
||||
cell.channelErevMap[sectype][mech],
|
||||
)
|
||||
setrev = True
|
||||
continue # don't bother with second approach
|
||||
except:
|
||||
raise ValueError("erev set failed")
|
||||
pass # no error
|
||||
try:
|
||||
setattr(
|
||||
secobj(),
|
||||
self.erev_mapper[mech] + "_" + mech,
|
||||
cell.channelErevMap[sectype][mech],
|
||||
)
|
||||
setrev = True
|
||||
except:
|
||||
raise ValueError("Erev2 set failed")
|
||||
pass # no error report
|
||||
if (
|
||||
not setrev
|
||||
): # here is our error report - soft, not crash.
|
||||
print(
|
||||
"Failed to set reversal potential in section %s for mechanism %s"
|
||||
% (sec, mech)
|
||||
)
|
||||
# if mech in mechinsec and mech in self.vshift_mapper.keys():
|
||||
# try:
|
||||
# setattr(secobj, self.vshift_mapper[mech], cell.channelVshiftMap[sectype][mech])
|
||||
# except:
|
||||
# raise ValueError('Failed to set vshift for mech: %s sectpe: %s' % (mech, sectype[mech]))
|
||||
|
||||
if verify:
|
||||
self.channelValidate(cell)
|
||||
return cell
|
||||
|
||||
def gbarAdjust(self, cell, sectype, mech, sec):
|
||||
gbar = cell.channelMap[sectype][mech]
|
||||
gbar_orig = gbar
|
||||
if sectype not in cell.distMap.keys(): # no map for this section type
|
||||
return gbar
|
||||
elif mech not in cell.distMap[sectype].keys():
|
||||
return gbar
|
||||
# mecanism exists in the distMap, so we will map gbar to distance from soma
|
||||
method = cell.distMap[sectype][mech]["gradient"] # grab the type
|
||||
gminf = cell.distMap[sectype][mech]["gminf"]
|
||||
rate = cell.distMap[sectype][mech]["lambda"]
|
||||
# print('sectype: %s mech: %s method: %s rate: %s' % (sectype, mech, method, rate))
|
||||
if method == "flat":
|
||||
return gbar
|
||||
if sec in self.channelInfo.distanceMap.keys():
|
||||
dist = self.channelInfo.distanceMap[sec]
|
||||
else: # the sec should be in the map, but there could be a coding error that would break that relationship
|
||||
raise NameError(
|
||||
"gbarAdjust in channel_decorate.py: section %s not in distance map"
|
||||
% sec
|
||||
)
|
||||
if method == "linear": # rate is "half" point drop
|
||||
# print('doing linear, orig gbar: ', gbar)
|
||||
gbar = gbar - dist * (gbar - gminf) / rate
|
||||
if gbar < 0.0:
|
||||
gbar = 0.0 # clip
|
||||
# print('sec dist: %f final gbar: %f' % (dist, gbar))
|
||||
elif method in ["exp", "expdown"]:
|
||||
gbar = (gbar - gminf) * np.exp(-dist / rate) + gminf
|
||||
if gbar < 0.0:
|
||||
gbar = 0.0
|
||||
# print 'gbaradjust: orig/adj: ', gbar_orig, gbar, method, dist, sectype
|
||||
return gbar
|
||||
|
||||
def channelValidate(self, cell, verify=False):
|
||||
"""
|
||||
verify mechanisms insertions -
|
||||
go through all the groups, and find inserted conductances and their values
|
||||
print the results to the terminal
|
||||
"""
|
||||
print("\nChannel Validation")
|
||||
print(" Looking for sec_groups: ", sorted(cell.hr.sec_groups.keys()))
|
||||
print(" Available Channel Maps: ", sorted(cell.channelMap.keys()))
|
||||
secstuff = {}
|
||||
for s in list(cell.hr.sec_groups.keys()):
|
||||
sectype = self.remapSectionType(s.rsplit("[")[0])
|
||||
if sectype not in cell.channelMap.keys():
|
||||
if sectype in ["undefined"]: # skip undefined sections
|
||||
continue
|
||||
print(
|
||||
"\033[1;31;40m Validation: encountered unknown section group type: %s Cannot Validate"
|
||||
% sectype
|
||||
)
|
||||
print("Cell morphology file: %s \033[0m" % cell.morphology_file)
|
||||
continue
|
||||
# print 'Validating Section: %s' % s
|
||||
for mech in list(cell.channelMap[sectype].keys()):
|
||||
if mech not in self.gbar_mapper.keys():
|
||||
continue
|
||||
if mech in self.excludeMechs:
|
||||
continue
|
||||
if verify:
|
||||
print(
|
||||
"\tSection: %-15ss found mechanism: %-8ss at %.5f"
|
||||
% (s, mech, cell.channelMap[sectype][mech])
|
||||
)
|
||||
x = nu.Mechanism(
|
||||
mech
|
||||
) # , {gmapper[mech]: self.channelMap[cellType][sectype][mech]})
|
||||
setup = "%s_%s" % (self.gbar_mapper[mech], mech)
|
||||
for sec in cell.hr.sec_groups[s]:
|
||||
bar = getattr(cell.hr.get_section(sec), setup)
|
||||
# print 'mech', mech
|
||||
# print 'bar: ', bar
|
||||
try:
|
||||
Erev = getattr(cell.hr.get_section(sec), self.erev_mapper[mech])
|
||||
except:
|
||||
Erev = -999.0
|
||||
# print 'erev: ', Erev
|
||||
if sec in secstuff.keys():
|
||||
secstuff[sec] += ", g_%s = %g [%.1f]" % (mech, bar, Erev)
|
||||
else:
|
||||
secstuff[sec] = "(%10s) g_%-6s = %g [%.1f] " % (
|
||||
sectype,
|
||||
mech,
|
||||
bar,
|
||||
Erev,
|
||||
)
|
||||
if verify:
|
||||
for i, k in enumerate(secstuff.keys()):
|
||||
print("**%-20s " % k, secstuff[k])
|
||||
|
||||
def remapSectionType(self, sectype):
|
||||
if sectype in ["AXON_0"]:
|
||||
sectype = "axon"
|
||||
|
||||
if sectype in ["initseg", "initialsegment"]:
|
||||
sectype = "initialsegment"
|
||||
if sectype in ["dendscaled_0", "dendscaled_1", "dendscaled_2", "dendrite"]:
|
||||
sectype = "dendrite"
|
||||
if sectype in ["apical_dendrite"]:
|
||||
sectype = "secondarydendrite"
|
||||
return sectype
|
||||
109
cnmodel/mechanisms/CaPCalyx.mod
Normal file
109
cnmodel/mechanisms/CaPCalyx.mod
Normal file
@@ -0,0 +1,109 @@
|
||||
TITLE CaPCalyx.mod The presynaptic calcium current at the MNTB calyx of Held
|
||||
|
||||
COMMENT
|
||||
|
||||
NEURON implementation of Calcium current from Borst and Sakmann, 1998.
|
||||
Equations are basic HH; parameters are taken from Figure 8 legend in that paper.
|
||||
|
||||
Original implementation by Paul B. Manis, October 2007
|
||||
|
||||
Contact: pmanis@med.unc.edu
|
||||
|
||||
Modified 2/2014: Use Derivative block format.
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX CaPCalyx
|
||||
USEION ca READ eca WRITE ica
|
||||
RANGE gbar, gcap, ica
|
||||
GLOBAL minf, taum, alpha, beta
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
: celsius = 22 (degC) : model is defined on measurements made at 23-24 deg in Germany
|
||||
celsius (degC)
|
||||
dt (ms)
|
||||
: eca = 43.9 (mV)
|
||||
eca (mV)
|
||||
gbar = 0.01 (mho/cm2) <0,1e9> : target is 48.9 nS total
|
||||
alpha (1/ms)
|
||||
beta (1/ms)
|
||||
}
|
||||
|
||||
STATE {
|
||||
m
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
ica (mA/cm2)
|
||||
gcap (mho/cm2)
|
||||
minf (1)
|
||||
taum (ms)
|
||||
|
||||
}
|
||||
|
||||
LOCAL mexp
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
|
||||
gcap = gbar*m*m
|
||||
ica = gcap*(v - eca)
|
||||
}
|
||||
|
||||
UNITSOFF
|
||||
|
||||
INITIAL {
|
||||
trates(v)
|
||||
m = minf
|
||||
}
|
||||
|
||||
DERIVATIVE states { : Computes state variables m
|
||||
rates(v) : at the current v and dt.
|
||||
m' = (minf - m)/taum
|
||||
:m = m + mexp*(minf-m)
|
||||
:VERBATIM
|
||||
: return 0;
|
||||
:ENDVERBATIM
|
||||
}
|
||||
|
||||
LOCAL q10
|
||||
|
||||
PROCEDURE rates(v) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
|
||||
q10 = 3^((celsius - 24)/10) : if you don't like room temp, it can be changed!
|
||||
|
||||
minf = (1 / (1 + exp(-(v + 23.2) / 9.1)))
|
||||
|
||||
alpha = 1.78*exp(v/23.3)
|
||||
beta = 0.140*exp(-v/15.0)
|
||||
taum = 1/(alpha + beta)
|
||||
}
|
||||
|
||||
PROCEDURE trates(v) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
LOCAL minc
|
||||
TABLE minf, mexp
|
||||
DEPEND dt, celsius FROM -150 TO 150 WITH 300
|
||||
|
||||
rates(v) : not consistently executed from here if usetable_hh == 1
|
||||
: so don't expect the tau values to be tracking along with
|
||||
: the inf values in hoc
|
||||
|
||||
minc = -dt * q10
|
||||
mexp = 1 - exp(minc/taum)
|
||||
}
|
||||
|
||||
UNITSON
|
||||
134
cnmodel/mechanisms/Gly5GC.mod
Executable file
134
cnmodel/mechanisms/Gly5GC.mod
Executable file
@@ -0,0 +1,134 @@
|
||||
TITLE detailed model of Glycine receptors
|
||||
|
||||
COMMENT
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Kinetic model of Glycine-A receptors
|
||||
====================================
|
||||
|
||||
C -- C1 -- C2 -- O1
|
||||
| |
|
||||
D1 -- D2 -- D3
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
This Model is based on:
|
||||
Gentet LJ, Clements JD Binding site stoichiometry and the effects of
|
||||
phosphorylation on human alpha1 homomeric glycine receptors J Physiol (Lond)
|
||||
2002 vol. 544 (Pt 1) pp. 97-106, Figure 7.
|
||||
|
||||
Written by Paul Manis, UNC Chapel Hill, 2009
|
||||
Kinetic values are estimated from VCN glycine receptors.
|
||||
|
||||
This model has desensitization states.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
This mod file does not include mechanisms for the release and time course
|
||||
of transmitter; it is to be used in conjunction with a sepearate mechanism
|
||||
to describe the release of transmitter and that provides the concentration
|
||||
of transmitter in the synaptic cleft (to be connected to pointer C here).
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
NEURON {
|
||||
POINT_PROCESS GLYaGC
|
||||
POINTER XMTR
|
||||
RANGE C0, C1, C2, D1, D2, D3, O1, Open
|
||||
RANGE g, gmax, f1, f2
|
||||
RANGE Erev
|
||||
RANGE k1, km1, a1, b1, d1, r1, d2, r2, d3, r3, rd, dd
|
||||
NONSPECIFIC_CURRENT i
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
(mV) = (millivolt)
|
||||
(pS) = (picosiemens)
|
||||
(umho) = (micromho)
|
||||
(mM) = (milli/liter)
|
||||
(uM) = (micro/liter)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
|
||||
Erev = -70 (mV) : reversal potential
|
||||
gmax = 500 (pS) : maximal conductance
|
||||
|
||||
: Rates
|
||||
: bushy cell
|
||||
|
||||
k1 = 12.81 (/uM /ms) : binding
|
||||
km1 = 0.0087 (/ms) : unbinding
|
||||
a1 = 0.0194 (/ms) : opening
|
||||
b1 = 1.138 (/ms) : closing
|
||||
r1 = 5.19 (/ms) : desense 1
|
||||
d1 = 0.000462 (/ms) : return from d1
|
||||
r2 = 0.731 (/ms) : return from deep state
|
||||
d2 = 1.641 (/ms) : going to deep state
|
||||
r3 = 3.817 (/ms) : return from deep state
|
||||
d3 = 1.806 (/ms) : going to deep state
|
||||
rd = 1.0 (/ms)
|
||||
dd = 1.0 (/ms)
|
||||
}
|
||||
|
||||
|
||||
ASSIGNED {
|
||||
v (mV) : postsynaptic voltage
|
||||
i (nA) : current = g*(v - Erev)
|
||||
g (pS) : conductance
|
||||
XMTR (mM) : pointer to glycine concentration
|
||||
|
||||
f1 (/ms) : binding
|
||||
f2 (/ms) : binding
|
||||
Open (1)
|
||||
}
|
||||
|
||||
STATE {
|
||||
: Channel states (all fractions)
|
||||
C0 : unbound
|
||||
C1 : single bound
|
||||
C2 : double bound
|
||||
D1 : desense, bound
|
||||
O1 : open
|
||||
D2 : Desense
|
||||
D3 : Desense
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
XMTR = 0
|
||||
C0 = 1
|
||||
C1 = 0
|
||||
C2 = 0
|
||||
O1 = 0
|
||||
D1 = 0
|
||||
D2 = 0
|
||||
D3 = 0
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE kstates METHOD sparse
|
||||
Open = (O1)
|
||||
g = gmax * Open
|
||||
i = (1e-6) * g * (v - Erev)
|
||||
}
|
||||
|
||||
KINETIC kstates {
|
||||
|
||||
f1 = k1 * (1e3) * XMTR
|
||||
f2 = k1 * (1e3) * XMTR
|
||||
|
||||
~ C0 <-> C1 (f1,km1)
|
||||
~ C1 <-> C2 (f2,12.5*km1)
|
||||
~ C2 <-> O1 (a1,b1)
|
||||
~ C1 <-> D1 (r1, d1)
|
||||
~ C2 <-> D2 (r2, d2)
|
||||
~ D1 <-> D2 (rd, dd)
|
||||
~ D2 <-> D3 (r3, d3)
|
||||
|
||||
CONSERVE C0+C1+C2+D1+D2+D3+O1 = 1
|
||||
}
|
||||
149
cnmodel/mechanisms/Gly5PL.mod
Executable file
149
cnmodel/mechanisms/Gly5PL.mod
Executable file
@@ -0,0 +1,149 @@
|
||||
TITLE detailed model of Glycine receptors
|
||||
|
||||
COMMENT
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Kinetic model of Glycine-A receptors: Pascal Legendre (Mauthner Cell)
|
||||
====================================
|
||||
|
||||
|
||||
|
||||
C0--C1--C2--O1
|
||||
|
|
||||
C3--O2
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
This mod file does not include mechanisms for the release and time course
|
||||
of transmitter; it is to be used in conjunction with a sepearate mechanism
|
||||
to describe the release of transmitter and that provides the concentration
|
||||
of transmitter in the synaptic cleft (to be connected to pointer C here).
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Modified Paul Manis, UNC Chapel Hill, 2009
|
||||
Name, pointer name, kinetics are range variables, and kinetic values
|
||||
are estimated from VCN glycine receptors.
|
||||
|
||||
Note: This model does not have a desensitization state.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
NEURON {
|
||||
POINT_PROCESS GLYaPL
|
||||
POINTER XMTR
|
||||
RANGE C0, C1, C2, C3, O1, O2, Open
|
||||
RANGE g, gmax, f1, f2
|
||||
RANGE Erev
|
||||
RANGE kon, koff, a1, b1, a2, b2, r, d
|
||||
RANGE CellType : 0 for bushy, 1 for stellate
|
||||
NONSPECIFIC_CURRENT i
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
(mV) = (millivolt)
|
||||
(pS) = (picosiemens)
|
||||
(umho) = (micromho)
|
||||
(mM) = (milli/liter)
|
||||
(uM) = (micro/liter)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
|
||||
Erev = -70 (mV) : reversal potential
|
||||
gmax = 500 (pS) : maximal conductance
|
||||
CellType = 1 (1) : define cell type parameters
|
||||
|
||||
: Rates
|
||||
|
||||
: Stellate cell fit (1/1/10; excellent fit)
|
||||
|
||||
: kon = 0.0236 (/uM /ms) : binding
|
||||
: koff = 2.4 (/ms) : unbinding
|
||||
: a1 = 1.707 (/ms) : opening
|
||||
: b1 = 8.95 (/ms) : closing
|
||||
: a2 = 0.325 (/ms) : opening
|
||||
: b2 = 5.871 (/ms) : closing
|
||||
: r = 2.019 (/ms) : return from deep state
|
||||
: d = 28.87 (/ms) : going to deep state
|
||||
|
||||
:if psdtype == 'glyfast': fit from 3/5/2010. error = 0.174 maxopen = 0.0385
|
||||
: See synapses.py
|
||||
a1 = 1.000476 (/ms) : opening
|
||||
a2 = 0.137903 (/ms) : opening
|
||||
b1 = 1.700306 (/ms) : closing
|
||||
koff = 13.143132 (/ms) : unbinding
|
||||
kon = 0.038634 (/ms) : binding
|
||||
r = 0.842504 (/ms) : return from deep state
|
||||
b2 = 8.051435 (/ms) : closing
|
||||
d = 12.821820 (/ms) : going to deep state
|
||||
|
||||
}
|
||||
|
||||
|
||||
ASSIGNED {
|
||||
v (mV) : postsynaptic voltage
|
||||
i (nA) : current = g*(v - Erev)
|
||||
g (pS) : conductance
|
||||
XMTR (mM) : pointer to glycine concentration
|
||||
|
||||
f1 (/ms) : binding
|
||||
f2 (/ms) : binding
|
||||
koff2 (/ms)
|
||||
Open (1)
|
||||
}
|
||||
|
||||
STATE {
|
||||
: Channel states (all fractions)
|
||||
C0 : unbound
|
||||
C1 : single bound
|
||||
C2 : double bound
|
||||
C3 : bound but closed state to O2
|
||||
O1 : open
|
||||
O2 : open
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
|
||||
XMTR = 0.0
|
||||
C0 = 1
|
||||
C1 = 0
|
||||
C2 = 0
|
||||
C3 = 0
|
||||
O1 = 0
|
||||
O2 = 0
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE kstates METHOD sparse
|
||||
:VERBATIM
|
||||
: if (CGly > 0.0) {
|
||||
: fprintf(stderr, "t = %f Xmtr = %f\n", t, XMTR);
|
||||
: }
|
||||
: ENDVERBATIM
|
||||
Open = (O1 + O2)
|
||||
g = gmax * Open
|
||||
i = (1e-6) * g * (v - Erev)
|
||||
}
|
||||
|
||||
KINETIC kstates {
|
||||
|
||||
f1 = 2.0 * kon * (1e3) * XMTR
|
||||
f2 = kon * (1e3) * XMTR
|
||||
koff2 = 2.0 * koff
|
||||
|
||||
~ C0 <-> C1 (f1,koff)
|
||||
~ C1 <-> C2 (f2,koff2)
|
||||
~ C2 <-> O1 (a1,b1)
|
||||
~ C2 <-> C3 (d, r)
|
||||
~ C3 <-> O2 (a2,b2)
|
||||
|
||||
CONSERVE C0+C1+C2+C3+O1+O2 = 1
|
||||
}
|
||||
147
cnmodel/mechanisms/Gly5State.mod
Executable file
147
cnmodel/mechanisms/Gly5State.mod
Executable file
@@ -0,0 +1,147 @@
|
||||
TITLE detailed model of Glycine receptors
|
||||
|
||||
COMMENT
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Kinetic model of Glycine-A receptors
|
||||
====================================
|
||||
|
||||
|
||||
|
||||
C -- C1 -- C2
|
||||
| |
|
||||
O1 O2
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
This mod file does not include mechanisms for the release and time course
|
||||
of transmitter; it is to be used in conjunction with a sepearate mechanism
|
||||
to describe the release of transmitter and that provides the concentration
|
||||
of transmitter in the synaptic cleft (to be connected to pointer C here).
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Based on models
|
||||
|
||||
Destexhe, A., Mainen, Z.F. and Sejnowski, T.J. Kinetic models of
|
||||
synaptic transmission. In: Methods in Neuronal Modeling (2nd edition;
|
||||
edited by Koch, C. and Segev, I.), MIT press, Cambridge, 1998, pp. 1-25.
|
||||
|
||||
(electronic copy available at http://cns.iaf.cnrs-gif.fr)
|
||||
|
||||
Written by Alain Destexhe, Laval University, 1995
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Modified Paul Manis, UNC Chapel Hill, 2009
|
||||
Changed name, pointer name, kinetics are range variables, and kinetic values
|
||||
are estimated from VCN glycine receptors.
|
||||
|
||||
This model does not have a desensitization state.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
NEURON {
|
||||
POINT_PROCESS GLYa5
|
||||
POINTER XMTR
|
||||
RANGE C0, C1, C2, O1, O2, Open
|
||||
RANGE g, gmax, f1, f2
|
||||
RANGE Erev
|
||||
RANGE kf1, kf2, kb1, kb2, a1, b1, a2, b2
|
||||
NONSPECIFIC_CURRENT i
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
(mV) = (millivolt)
|
||||
(pS) = (picosiemens)
|
||||
(umho) = (micromho)
|
||||
(mM) = (milli/liter)
|
||||
(uM) = (micro/liter)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
|
||||
Erev = -70 (mV) : reversal potential
|
||||
gmax = 500 (pS) : maximal conductance
|
||||
|
||||
: Rates
|
||||
|
||||
: from fits to averaged ipsc data, stellate cells 1/1/10
|
||||
|
||||
: kf1 = 0.002930 (/uM /ms) : binding
|
||||
: kf2 = 0.005936 (/uM /ms) : binding
|
||||
: kb1 = 2.793 (/ms) : unbinding
|
||||
: kb2 = 1.445 (/ms) : unbinding
|
||||
: a1 = 1e-6 (/ms) : opening
|
||||
: b1 = 129.0 (/ms) : closing
|
||||
: a2 = 5.10 (/ms) : opening
|
||||
: b2 = 2.79 (/ms) : closing
|
||||
|
||||
: from fits to averaged ipsc data, bushy cells 1/1/10
|
||||
|
||||
kf1 = 0.0278 (/uM /ms) : binding
|
||||
kf2 = 1e-6 (/uM /ms) : binding
|
||||
kb1 = 0.000054 (/ms) : unbinding
|
||||
kb2 = 0.000855 (/ms) : unbinding
|
||||
a1 = 1e-6 (/ms) : opening
|
||||
b1 = 129.0 (/ms) : closing
|
||||
a2 = 5.10 (/ms) : opening
|
||||
b2 = 2.79 (/ms) : closing
|
||||
|
||||
}
|
||||
|
||||
|
||||
ASSIGNED {
|
||||
v (mV) : postsynaptic voltage
|
||||
i (nA) : current = g*(v - Erev)
|
||||
g (pS) : conductance
|
||||
XMTR (mM) : pointer to glycine concentration
|
||||
|
||||
f1 (/ms) : binding
|
||||
f2 (/ms) : binding
|
||||
Open (1)
|
||||
}
|
||||
|
||||
STATE {
|
||||
: Channel states (all fractions)
|
||||
C0 : unbound
|
||||
C1 : single bound
|
||||
C2 : double bound
|
||||
O1 : open
|
||||
O2 : open
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
C0 = 1
|
||||
C1 = 0
|
||||
C2 = 0
|
||||
O1 = 0
|
||||
O2 = 0
|
||||
XMTR = 0.0
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE kstates METHOD sparse
|
||||
Open = (O1 + O2)
|
||||
g = gmax * Open
|
||||
i = (1e-6) * g * (v - Erev)
|
||||
}
|
||||
|
||||
KINETIC kstates {
|
||||
|
||||
f1 = kf1 * (1e3) * XMTR
|
||||
f2 = kf2 * (1e3) * XMTR
|
||||
|
||||
~ C0 <-> C1 (f1,kb1)
|
||||
~ C1 <-> C2 (f2,kb2)
|
||||
~ C1 <-> O1 (a1,b1)
|
||||
~ C2 <-> O2 (a2,b2)
|
||||
|
||||
CONSERVE C0+C1+C2+O1+O2 = 1
|
||||
}
|
||||
131
cnmodel/mechanisms/Gly6S.mod
Executable file
131
cnmodel/mechanisms/Gly6S.mod
Executable file
@@ -0,0 +1,131 @@
|
||||
TITLE Model of glycine receptors
|
||||
|
||||
COMMENT
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Kinetic model of glycine receptors
|
||||
===============================
|
||||
|
||||
6-state gating model with
|
||||
2 open states provide dual exponential response.
|
||||
|
||||
O1
|
||||
|
|
||||
C0 -- C1 -- C2 -- O2
|
||||
|
|
||||
D1
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
This mod file does not include mechanisms for the release and time course
|
||||
of transmitter; it is to be used in conjunction with a sepearate mechanism
|
||||
to describe the release of transmitter and that provides the concentration
|
||||
of transmitter in the synaptic cleft (to be connected to pointer C here).
|
||||
|
||||
Default parameters are set for a miniature EPSC.
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Paul B. Manis, Ph.D. 28 Dec 2009
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
ENDCOMMENT
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
NEURON {
|
||||
POINT_PROCESS Gly6S
|
||||
POINTER XMTR
|
||||
RANGE C0, C1, C2, D1, O1, O2, Open
|
||||
RANGE Erev
|
||||
RANGE Rb, Ru1, Ru2, Rd, Rr, Ro1, Rc1, Ro2, Rc2
|
||||
RANGE g, rb, gmax
|
||||
RANGE CellType : 0 is bushy, 1 is stellate
|
||||
NONSPECIFIC_CURRENT i
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
(mV) = (millivolt)
|
||||
(pS) = (picosiemens)
|
||||
(umho) = (micromho)
|
||||
(mM) = (milli/liter)
|
||||
(uM) = (micro/liter)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
|
||||
Erev = -70 (mV) : reversal potential
|
||||
gmax = 500 (pS) : maximal conductance
|
||||
CellType = 0 (1) : Cell type definition.
|
||||
: Rates
|
||||
: Bushy cell IPSCs: (rates can be changed externally)
|
||||
: Set per Fits 8 March 2010 (see Synapses.py as well)
|
||||
Rd = 1.177999 (/ms) : desensitization
|
||||
Rr = 0.000005 (/ms) : resensitization
|
||||
Rb = 0.009403 (/mM /ms): binding
|
||||
: diffusion limited
|
||||
Ru2 = 0.000086 (/ms) : unbinding (2nd site)
|
||||
Ro1 = 0.187858 (/ms) : opening (fast)
|
||||
Ro2 = 1.064426 (/ms) : opening (slow)
|
||||
Ru1 = 0.028696 (/ms) : unbinding (1st site)
|
||||
Rc1 = 0.103625 (/ms) : closing
|
||||
Rc2 = 1.730578 (/ms) : closing
|
||||
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
v (mV) : postsynaptic voltage
|
||||
i (nA) : current = g*(v - Erev)
|
||||
g (pS) : conductance
|
||||
XMTR (mM) : pointer to glutamate concentration
|
||||
rbind (/ms) : binding
|
||||
Open (1)
|
||||
}
|
||||
|
||||
STATE {
|
||||
: Channel states (all fractions)
|
||||
C0 : unbound
|
||||
C1 : single gly bound
|
||||
C2 : double gly bound
|
||||
D1 : double gly bound, desensitized
|
||||
O1 : double gly bound, open state 1
|
||||
O2 : double gly bound, open state 2
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
|
||||
XMTR = 0
|
||||
C0 = 1
|
||||
C1 = 0
|
||||
C2 = 0
|
||||
D1 = 0
|
||||
O1 = 0
|
||||
O2 = 0
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE kstates METHOD sparse
|
||||
:VERBATIM
|
||||
: if (XMTR > 0.1) {
|
||||
: fprintf(stderr, "t = %f XMTR = %f\n", t, XMTR);
|
||||
: }
|
||||
: ENDVERBATIM
|
||||
Open = (O1 + O2)
|
||||
g = gmax * Open
|
||||
i = (1e-6)*g*(v-Erev)
|
||||
}
|
||||
|
||||
|
||||
KINETIC kstates {
|
||||
|
||||
rbind = Rb * (1e3) * XMTR
|
||||
|
||||
~ C0 <-> C1 (rbind,Ru1)
|
||||
~ C1 <-> C2 (rbind*2.0,Ru2)
|
||||
~ C2 <-> O1 (Ro1,Rc1)
|
||||
~ C2 <-> D1 (Rd,Rr)
|
||||
~ C2 <-> O2 (Ro2,Rc2)
|
||||
CONSERVE C0+C1+C2+D1+O1+O2 = 1
|
||||
}
|
||||
64
cnmodel/mechanisms/Iclamp2.mod
Normal file
64
cnmodel/mechanisms/Iclamp2.mod
Normal file
@@ -0,0 +1,64 @@
|
||||
COMMENT
|
||||
|
||||
Iclamp2.mod: Electrode current injection, revised for our own use
|
||||
I specifically needed more step changes in a single waveform than
|
||||
were provided by the default code. This routine gives us 5 levels:
|
||||
holding, 3 steps, and a final (holding?) level.
|
||||
|
||||
This version generates a pulse of duration at amplitude I for
|
||||
onset times in the vector onset[STEP] and durations in dur[STEP]
|
||||
Each pulse is independent and pulses _could_ overlap.
|
||||
|
||||
Since this is an electrode current, positive values of I depolarize the cell
|
||||
and in the presence of the extracellular mechanism there will be a change
|
||||
in vext since I is not a transmembrane current but a current injected
|
||||
directly to the inside of the cell.
|
||||
|
||||
(modified and borrowed extensively from other Neuron code,
|
||||
2001-2002. Paul B. Manis)
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
DEFINE NSTEP 5 : maximum number of steps supported in this mechanism
|
||||
|
||||
NEURON {
|
||||
POINT_PROCESS IClamp2
|
||||
RANGE onset, dur, amp, i
|
||||
ELECTRODE_CURRENT i
|
||||
}
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
PARAMETER {
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
i (nA)
|
||||
index
|
||||
onset[NSTEP] (ms)
|
||||
dur[NSTEP] (ms)
|
||||
amp[NSTEP] (nA)
|
||||
pu
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
i = 0 (nA)
|
||||
index = 0
|
||||
pu = 0
|
||||
}
|
||||
:
|
||||
: at each onset time, a pulse of duration dur is generated.
|
||||
:
|
||||
|
||||
BREAKPOINT {
|
||||
i = 0
|
||||
FROM index = 0 TO NSTEP-1 {
|
||||
if(t > onset[index]) {
|
||||
if(t < (dur[index]+onset[index])) {
|
||||
i = i + amp[index] : allows overlap
|
||||
} : end of if condition
|
||||
} :end of second if condition
|
||||
} : end of "FROM" (for) loop
|
||||
} : end of breakpoint
|
||||
142
cnmodel/mechanisms/NMDA.mod
Normal file
142
cnmodel/mechanisms/NMDA.mod
Normal file
@@ -0,0 +1,142 @@
|
||||
TITLE NMDA receptor--one of the two input stimulation of our model
|
||||
|
||||
: This mechanism is taken from the Neuron data base "exp2syn.mod"
|
||||
: The original comment are below between "COMMENT" and "ENDCOMMENT".
|
||||
:
|
||||
: Our modifications:
|
||||
:
|
||||
: 1.We added a single receptor conductance factor: "g_max=0.000045 (uS)".
|
||||
: An event of weight 1 generates a peak conductance of 1*g_max.
|
||||
: The weight is equal to the number of ampa receptors open at peak conductance
|
||||
:
|
||||
: 2.The NMDA receptors are simulated using a slow rise time constant
|
||||
: and a double-expontial decay time constant
|
||||
|
||||
: The kinetic rate constants and channel conductance are taken from Franks KM, Bartol TM and Sejnowski TJ
|
||||
: A Monte Carlo model reveals independent signaling at central glutamatergic synapses
|
||||
: J Biophys (2002) 83(5):2333-48
|
||||
: and Spruston N, Jonas P and Sakmann B
|
||||
: Dendritic glutamate receptor channels in rat hippocampal CA3 and CA1 neurons
|
||||
: J Physiol (1995) 482(2): 325-352
|
||||
: correctd for physiological tempterature with Q10 from Hestrin S, Sah P and Nicoll RA
|
||||
: Mechanisms generating the time course of dual component excitatory synaptic currents
|
||||
: recorded in hippocampal slices
|
||||
: Neuron (1990) 5: 247-253
|
||||
:
|
||||
: Written by Lei Tian on 04/12/06
|
||||
|
||||
|
||||
|
||||
COMMENT
|
||||
Two state kinetic scheme synapse described by rise time tau1,
|
||||
and decay time constant tau2. The normalized peak condunductance is 1.
|
||||
Decay time MUST be greater than rise time.
|
||||
|
||||
The solution of A->G->bath with rate constants 1/tau1 and 1/tau2 is
|
||||
A = a*exp(-t/tau1) and
|
||||
G = a*tau2/(tau2-tau1)*(-exp(-t/tau1) + exp(-t/tau2))
|
||||
where tau1 < tau2
|
||||
|
||||
If tau2-tau1 -> 0 then we have a alphasynapse.
|
||||
and if tau1 -> 0 then we have just single exponential decay.
|
||||
|
||||
The factor is evaluated in the
|
||||
initial block such that an event of weight 1 generates a
|
||||
peak conductance of 1.
|
||||
|
||||
Because the solution is a sum of exponentials, the
|
||||
coupled equations can be solved as a pair of independent equations
|
||||
by the more efficient cnexp method.
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
POINT_PROCESS nmda
|
||||
RANGE tau1, tau2, tau3, e, i, g_max, g, A, B, C ,k
|
||||
NONSPECIFIC_CURRENT i
|
||||
GLOBAL total,i2,g2
|
||||
: EXTERNAL Area_canmda
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(uS) = (microsiemens)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
tau1 = 3.18 (ms) <1e-9,1e9> :rise time constant
|
||||
tau2 = 57.14 (ms) <1e-9,1e9> :decay time constant
|
||||
tau3 = 2000 (ms) <1e-9,1e9> :decay time constant
|
||||
|
||||
g_max= 0.000045 (uS) : single channel conductance
|
||||
e = 0 (mV)
|
||||
mg = 1 (mM)
|
||||
|
||||
Area (cm2)
|
||||
k = 1e-06 (mA/nA)
|
||||
Area_canmda = 1
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
v (mV)
|
||||
i (nA)
|
||||
factor
|
||||
total (uS)
|
||||
g (uS)
|
||||
|
||||
g2 (uS) : plot 'g' and 'i' in "nmda.mod".
|
||||
i2 (mA/cm2) : global variables read in "canmda.mod" as 'inmda' and 'gnmda' to give us
|
||||
}
|
||||
|
||||
STATE {
|
||||
A (uS)
|
||||
B (uS)
|
||||
C (uS)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
LOCAL t_peak
|
||||
total = 0
|
||||
if (tau1/tau2 > .9999) {
|
||||
tau1 = .9999*tau2
|
||||
}
|
||||
A = 0
|
||||
B = 0
|
||||
C = 0
|
||||
|
||||
factor=0.8279 :from matlab to make the peak of the conductance curve shape to be 1*weight (then multiply with g_max)
|
||||
factor = 1/factor
|
||||
|
||||
Area = Area_canmda
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE state METHOD cnexp
|
||||
|
||||
g = g_max*(B*0.8+C*0.2-A)
|
||||
i = g*(v - e)*1/(1+(exp(0.08(/mV) * -v)*(mg / 0.69)))
|
||||
|
||||
g2=g :global variable can be read in 'canmda.mod'
|
||||
i2=i*k/Area :to get a current in 'mA/cm2' and send it to 'canmda.mod'
|
||||
}
|
||||
|
||||
DERIVATIVE state {
|
||||
A' = -A/tau1
|
||||
B' = -B/tau2
|
||||
C' = -C/tau3
|
||||
}
|
||||
|
||||
NET_RECEIVE(weight (uS)) {
|
||||
state_discontinuity(A, weight*factor)
|
||||
state_discontinuity(B, weight*factor)
|
||||
state_discontinuity(C, weight*factor)
|
||||
total = total+weight
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
212
cnmodel/mechanisms/NMDA_Kampa.mod
Normal file
212
cnmodel/mechanisms/NMDA_Kampa.mod
Normal file
@@ -0,0 +1,212 @@
|
||||
TITLE kinetic NMDA receptor model
|
||||
|
||||
COMMENT
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Kinetic model of NMDA receptors
|
||||
===============================
|
||||
|
||||
10-state gating model:
|
||||
Kampa et al. (2004) J Physiol
|
||||
|
||||
U -- Cl -- O
|
||||
\ | \ \
|
||||
\ | \ \
|
||||
UMg -- ClMg - OMg
|
||||
| |
|
||||
D1 |
|
||||
| \ |
|
||||
D2 \ |
|
||||
\ D1Mg
|
||||
\ |
|
||||
D2Mg
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Based on voltage-clamp recordings of NMDA receptor-mediated currents in
|
||||
nucleated patches of rat neocortical layer 5 pyramidal neurons (Kampa 2004),
|
||||
this model was fit with AxoGraph directly to experimental recordings in
|
||||
order to obtain the optimal values for the parameters.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
This mod file does not include mechanisms for the release and time course
|
||||
of transmitter; it should to be used in conjunction with a separate mechanism
|
||||
to describe the release of transmitter and timecourse of the concentration
|
||||
of transmitter in the synaptic cleft (to be connected to pointer XMTR here).
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
See details of NEURON kinetic models in:
|
||||
|
||||
Destexhe, A., Mainen, Z.F. and Sejnowski, T.J. Kinetic models of
|
||||
synaptic transmission. In: Methods in Neuronal Modeling (2nd edition;
|
||||
edited by Koch, C. and Segev, I.), MIT press, Cambridge, 1996.
|
||||
|
||||
|
||||
Written by Bjoern Kampa in 2004
|
||||
Lightly modified, Paul Manis 2010.
|
||||
Note that data were taken at 23 deg C
|
||||
Q10 was taken from native receptors:
|
||||
Korinek M, Sedlacek M, Cais O, Dittert I, Vyklicky L Jr. Temperature
|
||||
dependence of N-methyl-D-aspartate receptor channels and N-methyl-D-aspartate
|
||||
receptor excitatory postsynaptic currents. Neuroscience. 2010 Feb
|
||||
3;165(3):736-48. Epub 2009 Oct 31. PubMed PMID: 19883737.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
ENDCOMMENT
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
|
||||
POINT_PROCESS NMDA_Kampa
|
||||
POINTER XMTR
|
||||
RANGE U, Cl, D1, D2, Open, MaxOpen, UMg, ClMg, D1Mg, D2Mg, OMg
|
||||
RANGE g, gmax, vshift, Erev, rb, rmb, rmu, rbMg,rmc1b,rmc1u,rmc2b,rmc2u
|
||||
GLOBAL mg, Rb, Ru, Rd1, Rr1, Rd2, Rr2, Ro, Rc, Rmb, Rmu
|
||||
GLOBAL RbMg, RuMg, Rd1Mg, Rr1Mg, Rd2Mg, Rr2Mg, RoMg, RcMg
|
||||
GLOBAL Rmd1b,Rmd1u,Rmd2b,Rmd2u,rmd1b,rmd1u,rmd2b,rmd2u
|
||||
GLOBAL Rmc1b,Rmc1u,Rmc2b,Rmc2u
|
||||
GLOBAL vmin, vmax, valence, memb_fraction
|
||||
NONSPECIFIC_CURRENT i
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
(mV) = (millivolt)
|
||||
(pS) = (picosiemens)
|
||||
(umho) = (micromho)
|
||||
(mM) = (milli/liter)
|
||||
(uM) = (micro/liter)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
|
||||
Erev = 5 (mV) : reversal potential
|
||||
gmax = 500 (pS) : maximal conductance
|
||||
mg = 1 (mM) : external magnesium concentration
|
||||
vmin = -120 (mV)
|
||||
vmax = 100 (mV)
|
||||
valence = -2 : parameters of voltage-dependent Mg block
|
||||
memb_fraction = 0.8
|
||||
vshift = 0.0 (mV)
|
||||
Q10 = 2.0 : temperature sensitivity (see above)
|
||||
|
||||
: Maximum open probability with Mode=0 (no rectification).
|
||||
: This is determined empirically by holding XMTR at a large
|
||||
: value and v=40mV for 100 timesteps and measuring the
|
||||
: maximum value of Open.
|
||||
MaxOpen = 0.01988893957 (1)
|
||||
|
||||
: Rates
|
||||
|
||||
Rb = 10e-3 (/uM /ms) : binding
|
||||
Ru = 5.6e-3 (/ms) : unbinding
|
||||
Ro = 10e-3 (/ms) : opening
|
||||
Rc = 273e-3 (/ms) : closing
|
||||
: Rd1 = 2.2e-3 (/ms) : fast desensitisation
|
||||
Rd1 = 0.1 (/ms) : fast desensitisation
|
||||
Rr1 = 1.6e-3 (/ms) : fast resensitisation
|
||||
: Rd2 = 0.43e-3 (/ms) : slow desensitisation
|
||||
Rd2 = 1e-4 (/ms) : slow desensitisation
|
||||
Rr2 = 0.5e-3 (/ms) : slow resensitisation
|
||||
Rmb = 0.05e-3 (/uM /ms) : Mg binding Open
|
||||
Rmu = 12800e-3 (/ms) : Mg unbinding Open
|
||||
Rmc1b = 0.00005e-3 (/uM /ms) : Mg binding Closed
|
||||
Rmc1u = 2.438312e-3 (/ms) : Mg unbinding Closed
|
||||
Rmc2b = 0.00005e-3 (/uM /ms) : Mg binding Closed2
|
||||
Rmc2u = 5.041915e-3 (/ms) : Mg unbinding Closed2
|
||||
Rmd1b = 0.00005e-3 (/uM /ms) : Mg binding Desens1
|
||||
Rmd1u = 2.98874e-3 (/ms) : Mg unbinding Desens1
|
||||
Rmd2b = 0.00005e-3 (/uM /ms) : Mg binding Desens2
|
||||
Rmd2u = 2.953408e-3 (/ms) : Mg unbinding Desens2
|
||||
RbMg = 10e-3 (/uM /ms) : binding with Mg
|
||||
RuMg = 17.1e-3 (/ms) : unbinding with Mg
|
||||
RoMg = 10e-3 (/ms) : opening with Mg
|
||||
RcMg = 548e-3 (/ms) : closing with Mg
|
||||
Rd1Mg = 2.1e-3 (/ms) : fast desensitisation with Mg
|
||||
Rr1Mg = 0.87e-3 (/ms) : fast resensitisation with Mg
|
||||
Rd2Mg = 0.26e-3 (/ms) : slow desensitisation with Mg
|
||||
Rr2Mg = 0.42e-3 (/ms) : slow resensitisation with Mg
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
v (mV) : postsynaptic voltage
|
||||
i (nA) : current = g*(v - Erev)
|
||||
g (pS) : conductance
|
||||
XMTR (mM) : pointer to glutamate concentration
|
||||
|
||||
rb (/ms) : binding, [glu] dependent
|
||||
rmb (/ms) : blocking V and [Mg] dependent
|
||||
rmu (/ms) : unblocking V and [Mg] dependent
|
||||
rbMg (/ms) : binding, [glu] dependent
|
||||
rmc1b (/ms) : blocking V and [Mg] dependent
|
||||
rmc1u (/ms) : unblocking V and [Mg] dependent
|
||||
rmc2b (/ms) : blocking V and [Mg] dependent
|
||||
rmc2u (/ms) : unblocking V and [Mg] dependent
|
||||
rmd1b (/ms) : blocking V and [Mg] dependent
|
||||
rmd1u (/ms) : unblocking V and [Mg] dependent
|
||||
rmd2b (/ms) : blocking V and [Mg] dependent
|
||||
rmd2u (/ms) : unblocking V and [Mg] dependent
|
||||
|
||||
qfac : Q10
|
||||
celsius (degC)
|
||||
}
|
||||
|
||||
STATE {
|
||||
: Channel states (all fractions)
|
||||
U : unbound
|
||||
Cl : closed
|
||||
D1 : desensitised 1
|
||||
D2 : desensitised 2
|
||||
Open : open
|
||||
UMg : unbound with Mg
|
||||
ClMg : closed with Mg
|
||||
D1Mg : desensitised 1 with Mg
|
||||
D2Mg : desensitised 2 with Mg
|
||||
OMg : open with Mg
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
U = 1
|
||||
qfac = Q10^((celsius-23)/10 (degC))}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE kstates METHOD sparse
|
||||
|
||||
g = gmax * Open / MaxOpen
|
||||
i = (1e-6) * g * (v - Erev)
|
||||
}
|
||||
|
||||
KINETIC kstates {
|
||||
|
||||
rb = Rb * (1e3) * XMTR
|
||||
rbMg = RbMg * (1e3) * XMTR
|
||||
rmb = Rmb * mg * (1e3) * exp((v-40+vshift) * valence * memb_fraction /25 (mV))
|
||||
rmu = Rmu * exp((-1)*(v-40+vshift) * valence * (1-memb_fraction) /25 (mV))
|
||||
rmc1b = Rmc1b * mg * (1e3) * exp((v-40+vshift) * valence * memb_fraction /25 (mV))
|
||||
rmc1u = Rmc1u * exp((-1)*(v-40+vshift) * valence * (1-memb_fraction) /25 (mV))
|
||||
rmc2b = Rmc2b * mg * (1e3) * exp((v-40+vshift) * valence * memb_fraction /25 (mV))
|
||||
rmc2u = Rmc2u * exp((-1)*(v-40+vshift) * valence * (1-memb_fraction) /25 (mV))
|
||||
rmd1b = Rmd1b * mg * (1e3) * exp((v-40+vshift) * valence * memb_fraction /25 (mV))
|
||||
rmd1u = Rmd1u * exp((-1)*(v-40+vshift) * valence * (1-memb_fraction) /25 (mV))
|
||||
rmd2b = Rmd2b * mg * (1e3) * exp((v-40+vshift) * valence * memb_fraction /25 (mV))
|
||||
rmd2u = Rmd2u * exp((-1)*(v-40+vshift) * valence * (1-memb_fraction) /25 (mV))
|
||||
|
||||
~ U <-> Cl (rb*qfac,Ru*qfac)
|
||||
~ Cl <-> Open (Ro*qfac,Rc*qfac)
|
||||
~ Cl <-> D1 (Rd1*qfac,Rr1*qfac)
|
||||
~ D1 <-> D2 (Rd2*qfac,Rr2*qfac)
|
||||
~ Open <-> OMg (rmb*qfac,rmu*qfac)
|
||||
~ UMg <-> ClMg (rbMg*qfac,RuMg*qfac)
|
||||
~ ClMg <-> OMg (RoMg*qfac,RcMg*qfac)
|
||||
~ ClMg <-> D1Mg (Rd1Mg*qfac,Rr1Mg*qfac)
|
||||
~ D1Mg <-> D2Mg (Rd2Mg*qfac,Rr2Mg*qfac)
|
||||
~ U <-> UMg (rmc1b*qfac,rmc1u*qfac)
|
||||
~ Cl <-> ClMg (rmc2b*qfac,rmc2u*qfac)
|
||||
~ D1 <-> D1Mg (rmd1b*qfac,rmd1u*qfac)
|
||||
~ D2 <-> D2Mg (rmd2b*qfac,rmd2u*qfac)
|
||||
|
||||
CONSERVE U+Cl+D1+D2+Open+UMg+ClMg+D1Mg+D2Mg+OMg = 1
|
||||
}
|
||||
125
cnmodel/mechanisms/adex.mod
Normal file
125
cnmodel/mechanisms/adex.mod
Normal file
@@ -0,0 +1,125 @@
|
||||
: AdEx GIF model
|
||||
|
||||
: This implementation is for the equations in:
|
||||
: Naud R, Marcille N, Clopath C, Gerstner W. Firing patterns in the adaptive
|
||||
: exponential integrate-and-fire model. Biol Cybern. 2008 Nov;99(4-5):335-47. doi:
|
||||
: 10.1007/s00422-008-0264-7. Epub 2008 Nov 15. PubMed PMID: 19011922; PubMed
|
||||
: Central PMCID: PMC2798047.
|
||||
|
||||
: Which in turn is based on:
|
||||
: Brette R, Gerstner W. Adaptive exponential integrate-and-fire model as an
|
||||
: effective description of neuronal activity. J Neurophysiol. 2005
|
||||
: Nov;94(5):3637-42. Epub 2005 Jul 13. PubMed PMID: 16014787.
|
||||
:
|
||||
: Paul B. Manis
|
||||
: 9 Nov 2017, Washington DC
|
||||
:
|
||||
|
||||
|
||||
NEURON {
|
||||
: ARTIFICIAL_CELL AdEx
|
||||
SUFFIX AdEx
|
||||
RANGE gl, el, delt, vt, vr, w, b, cm, is, a, tauw
|
||||
RANGE refract, Vm
|
||||
NONSPECIFIC_CURRENT i
|
||||
: m plays the role of voltage
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
cm = 200 (pF)
|
||||
el = -70 (mV) : leak (RMP)
|
||||
gl = 10 (nS) : resting input R
|
||||
delt = 2 (mV) : spike threshold sharpness
|
||||
vt = -50 (mV)
|
||||
vr = -58 (mV): reset value after a spike
|
||||
a = 2 (nS)
|
||||
b = 0 (pA)
|
||||
is = 0 (pA)
|
||||
tauw = 30 (ms)
|
||||
refract = 1 (ms)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
i (mA/cm2)
|
||||
t0(ms) : time of last spike
|
||||
refractory : flag indicating when in a refractory period
|
||||
}
|
||||
|
||||
STATE {
|
||||
w
|
||||
Vm
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
Vm = el
|
||||
t0 = t
|
||||
w = 0
|
||||
|
||||
refractory = 0 : 0-integrates input, 1-refractory
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
|
||||
if (refractory == 0 && Vm <= 0.) {
|
||||
states()
|
||||
}
|
||||
if (refractory == 1) {
|
||||
if ((t-t0) >= refract){
|
||||
refractory = 0
|
||||
Vm = vr
|
||||
states()
|
||||
}
|
||||
else {
|
||||
Vm = 0.
|
||||
}
|
||||
}
|
||||
if (refractory == 0 && Vm > 0.) {
|
||||
refractory = 1
|
||||
t0 = t
|
||||
Vm = 0.
|
||||
w = w + b
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DERIVATIVE states { : update adaptation variable w
|
||||
LOCAL eterm, et
|
||||
w' = (a*(Vm - el) - w)/tauw
|
||||
eterm = (Vm-vt)/delt
|
||||
if (eterm > 700 ) { : prevent overflow of the exponential term
|
||||
: (it would be better to estimate the value... but for this
|
||||
: implementation, not necessary as this will be the term
|
||||
: that drives the model to spike - after that V is reset
|
||||
: so the time evolution no longer matters)
|
||||
et = 700.
|
||||
}
|
||||
else {
|
||||
et = exp(eterm)
|
||||
}
|
||||
Vm' = ( -gl*(Vm-el) + gl*delt*et + is - w)/cm
|
||||
}
|
||||
|
||||
|
||||
COMMENT
|
||||
NET_RECEIVE (w) {
|
||||
if (refractory == 0) { : inputs integrated only when excitable
|
||||
i = -gl*(v-el) + gl*delt*exp((Vm-vt)/delt) - w
|
||||
m = i/cm
|
||||
t0 = t
|
||||
states()
|
||||
if (m > 0) {
|
||||
refractory = 1
|
||||
m = 0
|
||||
net_send(refractory, refractory)
|
||||
net_event(t)
|
||||
}
|
||||
} else if (flag == 1) { : ready to integrate again
|
||||
t0 = t
|
||||
refractory = 0
|
||||
m = vr
|
||||
}
|
||||
}
|
||||
ENDCOMMENT
|
||||
224
cnmodel/mechanisms/ampa_trussell.mod
Normal file
224
cnmodel/mechanisms/ampa_trussell.mod
Normal file
@@ -0,0 +1,224 @@
|
||||
TITLE Model of AMPA receptors
|
||||
|
||||
COMMENT
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Kinetic model of AMPA receptors
|
||||
===============================
|
||||
|
||||
6-state gating model:
|
||||
(scheme 1 from Raman and Trussell, Neuron 9:173-186, 1992)
|
||||
2 open states provide dual exponential response.
|
||||
|
||||
O1
|
||||
|
|
||||
C -- C1 -- C2 -- O2
|
||||
|
|
||||
D
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
This mod file does not include mechanisms for the release and time course
|
||||
of transmitter; it is to be used in conjunction with a separate mechanism
|
||||
to describe the release of transmitter and that provides the concentration
|
||||
of transmitter in the synaptic cleft (to be connected to pointer C here).
|
||||
|
||||
Default parameters are set for a miniature EPSC.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Code based on Destexhe's ampa5.mod
|
||||
|
||||
B. Graham, Dept. of Computing Science & Maths, University of Stirling
|
||||
(Contact: b.graham@cs.stir.ac.uk)
|
||||
(previously IANC, Division of Informatics, University of Edinburgh)
|
||||
|
||||
CNS 2000 Version (19/11/02)
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Further modified:
|
||||
|
||||
Paul Manis (Otolaryngology/HNS and Cell and Molecular Physiology,
|
||||
UNC Chapel Hill. contact: pmanis@med.unc.edu)
|
||||
|
||||
3/15/2005 Modifications:
|
||||
|
||||
1. Added Q10/qfac to allow temperature scaling. All rates in the state model
|
||||
are changed by the same factor. A Q10 of 1.5 gives a decay tau (single
|
||||
exponential fit using Praxis algorithm in NEURON; using ampa_kinetics.hoc)
|
||||
of about 850 usec at 22 deg C and 570 usec at 33 deg C. These are consistent
|
||||
with the Raman and Trussell 1992 measurements in avians. The 850 usec is a
|
||||
bit fast for an EPSC, and could probably be tuned by adjustment of some of
|
||||
the parameters below.
|
||||
|
||||
2. Brought several variables out to global (rather than range) so that we
|
||||
can change them - Q10 and gmax in particular. note that gmax is in pS. Only
|
||||
local conductance etc. is in specified as RANGE.
|
||||
|
||||
3. Max open probability is less than unity, so a gmax of 2500 yields 100 pA
|
||||
at -60 mV. Therefore scaling by mini size must take this into account.
|
||||
|
||||
3/28/2005 Paul B. Manis
|
||||
Added rectification to AMPA R. Rectification is controlled by
|
||||
polyamine-style block of receptor. See Donevan and Rogawski, 1995; Washburn
|
||||
et al., 1997. The equations used here are from Washburn et al. The values
|
||||
given in the equation at the break point were determined from EPSCs in 5
|
||||
21-d old DBA mice. Blocker = 45 (uM), Kd = 31.32, zd = 1.029. Note that this
|
||||
should also reduce the maximal conductance. Mode: if 1, use rectifying; if
|
||||
0, use non-rectifying. Default is 1
|
||||
|
||||
This point process uses XMTR as the transmitter concentration to operate on
|
||||
the receptor kinetics. XMTR should be provided by another process that
|
||||
controls release (e.g., COH calyx of Held, etc). An advantage of this is
|
||||
that whatever release process is present, glutamate accumulates in the
|
||||
cleft, and can drive desensitization etc.
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
ENDCOMMENT
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
POINT_PROCESS AMPATRUSSELL
|
||||
POINTER XMTR
|
||||
RANGE C0, C1, C2, D, O1, O2
|
||||
|
||||
RANGE Rb, Ru1, Ru2, Rd, Rr, Ro1, Rc1, Ro2, Rc2, Open, MaxOpen
|
||||
GLOBAL vmin, vmax
|
||||
GLOBAL Q10, Mode
|
||||
GLOBAL zd, Kd0
|
||||
RANGE g, rb, gmax, PA, Erev
|
||||
NONSPECIFIC_CURRENT i
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
(mV) = (millivolt)
|
||||
(pS) = (picosiemens)
|
||||
(umho) = (micromho)
|
||||
(mM) = (milli/liter)
|
||||
(uM) = (micro/liter)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
|
||||
Erev = 7 (mV) : reversal potential
|
||||
gmax = 10 (pS) : maximal conductance
|
||||
vmin = -120 (mV)
|
||||
vmax = 100 (mV)
|
||||
Q10 = 1.5 : temperature sensitivity
|
||||
Mode = 0 : flag to control rectification calculation
|
||||
|
||||
: polyamine block parameters (Wang & Manis unpublished data)
|
||||
zd = 1.032
|
||||
PA = 45
|
||||
Kd0 = 31.e-6
|
||||
|
||||
: Rates
|
||||
|
||||
Rb = 13 (/mM /ms): binding
|
||||
: diffusion limited (DO NOT ADJUST)
|
||||
Ru1 = 0.3 (/ms) : unbinding (1st site)
|
||||
Ru2 = 200 (/ms) : unbinding (2nd site)
|
||||
Rd = 30.0 (/ms) : desensitization (WAS30.0)
|
||||
Rr = 0.02 (/ms) : resensitization
|
||||
Ro1 = 100 (/ms) : opening (fast)
|
||||
Rc1 = 2 (/ms) : closing
|
||||
Ro2 = 2 (/ms) : opening (slow)
|
||||
Rc2 = 0.25 (/ms) : closing
|
||||
|
||||
Open = 0 (1) : total of all open states
|
||||
|
||||
: Maximum open probability with Mode=0 (no rectification).
|
||||
: This is determined empirically by holding XMTR at a large
|
||||
: value for 100 timesteps and measuring the maximum value
|
||||
: of Open.
|
||||
MaxOpen = 0.72418772400 (1)
|
||||
|
||||
aflag = 1 : Flag for control of printout of initial values.....
|
||||
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
v (mV) : postsynaptic voltage
|
||||
i (nA) : current = g*(v - Erev)
|
||||
g (pS) : conductance
|
||||
g0 (pS) : conductance for voltage-dependent block by polyamines
|
||||
gvdep (pS) : voltage-dependence of conductance
|
||||
XMTR (mM) : pointer to glutamate concentration
|
||||
rb (/ms) : binding
|
||||
qfac : q10 factor for rate scaling
|
||||
celsius (degC)
|
||||
|
||||
}
|
||||
|
||||
STATE {
|
||||
: Channel states (all fractions)
|
||||
C0 : unbound
|
||||
C1 : single glu bound
|
||||
C2 : double glu bound
|
||||
D : single glu bound, desensitized
|
||||
O1 : open state 1
|
||||
O2 : open state 2
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
usetable = 0
|
||||
C0=1
|
||||
C1=0
|
||||
C2=0
|
||||
D=0
|
||||
O1=0
|
||||
O2=0
|
||||
Open = 0
|
||||
qfac = Q10^((celsius-22)/10)
|
||||
: VERBATIM
|
||||
: fprintf(stdout, "AMPA.MOD gmax: %f Q10 = %f celsius = %f\n", gmax, Q10, celsius);
|
||||
: ENDVERBATIM
|
||||
gvdepcalc(v)
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE kstates METHOD sparse
|
||||
: VERBATIM
|
||||
: fprintf(stderr, "kstates @ t=%7.2f Rb: %f XMTR: %f: gmax: %f, o1: %f o2: %f\n", t, Rb, XMTR, gmax, O1, O2);
|
||||
: ENDVERBATIM
|
||||
|
||||
gvdepcalc(v)
|
||||
Open = O1 + O2
|
||||
g = gmax * Open / MaxOpen
|
||||
if ( Mode == 1) {
|
||||
g0 = 1.0 + 0.6*exp((v-50)/40) : eq. 5 of Washburn et al., 1997, slightly modified
|
||||
gvdep = g0*(1/(1+PA/(Kd0*exp(-zd*v/25.3))))
|
||||
i = (1e-6) * g * gvdep * (v - Erev)
|
||||
}
|
||||
else {
|
||||
i = (1e-6)*g*(v-Erev)
|
||||
}
|
||||
}
|
||||
|
||||
KINETIC kstates {
|
||||
|
||||
rb = Rb * XMTR
|
||||
|
||||
~ C0 <-> C1 (rb*qfac,Ru1*qfac)
|
||||
~ C1 <-> C2 (rb*qfac,Ru2*qfac)
|
||||
~ C2 <-> D (Rd*qfac,Rr*qfac)
|
||||
~ C2 <-> O1 (Ro1*qfac,Rc1*qfac)
|
||||
~ C2 <-> O2 (Ro2*qfac,Rc2*qfac)
|
||||
CONSERVE C0+C1+C2+D+O1+O2 = 1
|
||||
}
|
||||
|
||||
LOCAL g0
|
||||
PROCEDURE gvdepcalc(v) {
|
||||
TABLE gvdep DEPEND PA, Kd0, zd FROM -100 TO 100 WITH 200
|
||||
: VERBATIM
|
||||
: fprintf(stderr, "gvdepcalc starts ");
|
||||
: ENDVERBATIM
|
||||
g0 = 1.0 + 0.6*exp((v-50)/40) : eq. 5 of Washburn et al., 1997, slightly modified
|
||||
gvdep = g0*(1/(1+PA/(Kd0*exp(-zd*v/25.3))))
|
||||
: VERBATIM
|
||||
: fprintf(stderr, "& ends\n");
|
||||
: ENDVERBATIM
|
||||
}
|
||||
129
cnmodel/mechanisms/atm.mod
Normal file
129
cnmodel/mechanisms/atm.mod
Normal file
@@ -0,0 +1,129 @@
|
||||
: ATM GIF model
|
||||
|
||||
: This implementation the adaptive theshold model (ATM) is for the equations in:
|
||||
: Fontaine, B., Benichourx, V., Joris, P.X., and Brette, R. Prediciting
|
||||
: spike timing in hhigy synchronous auditory neurons at different sound
|
||||
: levels. J. Neurophysiol. 110: 1672-1688, 2013.
|
||||
|
||||
: Which in turn is based on:
|
||||
: Brette R, Gerstner W. Adaptive exponential integrate-and-fire model as an
|
||||
: effective description of neuronal activity. J Neurophysiol. 2005
|
||||
: Nov;94(5):3637-42. Epub 2005 Jul 13. PubMed PMID: 16014787.
|
||||
:
|
||||
: Paul B. Manis
|
||||
: 2 December 2017, Chapel Hill, NC
|
||||
:
|
||||
: Incomplete version
|
||||
|
||||
NEURON {
|
||||
: ARTIFICIAL_CELL ATM
|
||||
SUFFIX ATM
|
||||
RANGE gl, el, delt, vt, vr, alpha, beta, cm, is, a, tauw
|
||||
RANGE refract, Vm
|
||||
NONSPECIFIC_CURRENT i
|
||||
: m plays the role of voltage
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
cm = 200 (pF)
|
||||
el = -70 (mV) : leak (RMP)
|
||||
gl = 10 (nS) : resting input R
|
||||
delt = 2 (mV) : spike threshold sharpness
|
||||
vr = -58 (mV): reset value after a spike
|
||||
a = 2 (1)
|
||||
b = 2 (1)
|
||||
beta = 0 (1)
|
||||
alpha = 0
|
||||
is = 0 (pA)
|
||||
taut = 30 (ms) : threshold tau
|
||||
refract = 1 (ms)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
i (mA/cm2)
|
||||
t0 (ms) : time of last spike
|
||||
refractory : flag indicating when in a refractory period
|
||||
}
|
||||
|
||||
STATE {
|
||||
w
|
||||
Vm
|
||||
vt
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
Vm = el
|
||||
t0 = t
|
||||
a = 0
|
||||
b = 0
|
||||
|
||||
refractory = 0 : 0-integrates input, 1-refractory
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
|
||||
if (refractory == 0 && Vm <= 0.) {
|
||||
states()
|
||||
}
|
||||
if (refractory == 1) {
|
||||
if ((t-t0) >= refract){
|
||||
refractory = 0
|
||||
Vm = vr
|
||||
states()
|
||||
}
|
||||
else {
|
||||
Vm = 0.
|
||||
}
|
||||
}
|
||||
if (refractory == 0 && Vm > 0.) {
|
||||
refractory = 1
|
||||
t0 = t
|
||||
Vm = 0.
|
||||
w = w + b
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DERIVATIVE states { : update adaptation variable w
|
||||
LOCAL eterm, et
|
||||
vt' = (a*i - vt)/taut
|
||||
COMMENT
|
||||
eterm = (Vm-vt)/delt
|
||||
if (eterm > 700 ) { : prevent overflow of the exponential term
|
||||
: (it would be better to estimate the value... but for this
|
||||
: implementation, not necessary as this will be the term
|
||||
: that drives the model to spike - after that V is reset
|
||||
: so the time evolution no longer matters)
|
||||
et = 700.
|
||||
}
|
||||
else {
|
||||
et = exp(eterm)
|
||||
}
|
||||
ENDCOMMENT
|
||||
Vm' = gl*( -(Vm-el) + i)/cm
|
||||
}
|
||||
|
||||
|
||||
COMMENT
|
||||
NET_RECEIVE (w) {
|
||||
if (refractory == 0) { : inputs integrated only when excitable
|
||||
i = -gl*(v-el) + gl*delt*exp((Vm-vt)/delt) - w
|
||||
m = i/cm
|
||||
t0 = t
|
||||
states()
|
||||
if (m > 0) {
|
||||
refractory = 1
|
||||
m = 0
|
||||
net_send(refractory, refractory)
|
||||
net_event(t)
|
||||
}
|
||||
} else if (flag == 1) { : ready to integrate again
|
||||
t0 = t
|
||||
refractory = 0
|
||||
m = vr
|
||||
}
|
||||
}
|
||||
ENDCOMMENT
|
||||
98
cnmodel/mechanisms/bkpkj.mod
Normal file
98
cnmodel/mechanisms/bkpkj.mod
Normal file
@@ -0,0 +1,98 @@
|
||||
: BK-type Purkinje calcium-activated potassium current
|
||||
: Created 8/19/02 - nwg
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX bkpkj
|
||||
USEION k READ ek WRITE ik
|
||||
USEION ca READ cai
|
||||
RANGE gbar, ik, gbkpkj
|
||||
GLOBAL minf, mtau, hinf, htau, zinf, ztau
|
||||
GLOBAL m_vh, m_k, mtau_y0, mtau_vh1, mtau_vh2, mtau_k1, mtau_k2
|
||||
GLOBAL z_coef, ztau
|
||||
GLOBAL h_y0, h_vh, h_k, htau_y0, htau_vh1, htau_vh2, htau_k1, htau_k2
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mV) = (millivolt)
|
||||
(mA) = (milliamp)
|
||||
(mM) = (milli/liter)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
gbar = 0.007 (mho/cm2)
|
||||
|
||||
m1 (ms)
|
||||
m_vh = -28.9 (mV)
|
||||
m_k = 6.2 (mV)
|
||||
mtau_y0 = 0.505 (ms) : 0.000505 (s)
|
||||
mtau_vh1 = -33.3 (mV)
|
||||
mtau_k1 = -10 (mV)
|
||||
mtau_vh2 = 86.4 (mV)
|
||||
mtau_k2 = 10.1 (mV)
|
||||
|
||||
z_coef = 0.001 (mM)
|
||||
ztau = 1 (ms)
|
||||
|
||||
h_y0 = 0.085
|
||||
h_vh = -32 (mV)
|
||||
h_k = 5.8 (mV)
|
||||
htau_y0 = 1.9 (ms) : 0.0019 (s)
|
||||
htau_vh1 = -54.2 (mV)
|
||||
htau_k1 = -12.9 (mV)
|
||||
htau_vh2 = 48.5 (mV)
|
||||
htau_k2 = 5.2 (mV)
|
||||
|
||||
ek (mV)
|
||||
cai (mM)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gbkpkj (mho/cm2)
|
||||
minf
|
||||
mtau (ms)
|
||||
hinf
|
||||
htau (ms)
|
||||
zinf
|
||||
|
||||
ik (mA/cm2)
|
||||
}
|
||||
|
||||
STATE {
|
||||
m FROM 0 TO 1
|
||||
z FROM 0 TO 1
|
||||
h FROM 0 TO 1
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gbkpkj = gbar * m * m * m * z * z * h
|
||||
ik = gbkpkj * (v - ek)
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
|
||||
m' = (minf - m) / mtau
|
||||
h' = (hinf - h) / htau
|
||||
z' = (zinf - z) / ztau
|
||||
}
|
||||
|
||||
PROCEDURE rates(Vm (mV)) {
|
||||
LOCAL v
|
||||
v = Vm + 5
|
||||
minf = 1 / (1 + exp(-(v - (m_vh)) / m_k))
|
||||
m1 = mtau_y0 + (1. (ms)/(exp((v+ mtau_vh1)/mtau_k1)))
|
||||
mtau = m1 + (1. (ms)) * exp((v+mtau_vh2)/mtau_k2)
|
||||
zinf = 1/(1 + z_coef / cai)
|
||||
hinf = h_y0 + (1-h_y0) / (1+exp((v - h_vh)/h_k))
|
||||
htau = (htau_y0 + (1 (ms))/(exp((v + htau_vh1)/htau_k1)+exp((v+htau_vh2)/htau_k2)))
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
m = minf
|
||||
z = zinf
|
||||
h = hinf
|
||||
}
|
||||
157
cnmodel/mechanisms/cabpump.mod
Normal file
157
cnmodel/mechanisms/cabpump.mod
Normal file
@@ -0,0 +1,157 @@
|
||||
TITLE Calcium ion accumulation and diffusion with pump
|
||||
: The internal coordinate system is set up in PROCEDURE coord_cadifus()
|
||||
: and must be executed before computing the concentrations.
|
||||
: The scale factors set up in this procedure do not have to be recomputed
|
||||
: when diam or DFree are changed.
|
||||
: The amount of calcium in an annulus is ca[i]*diam^2*vol[i] with
|
||||
: ca[0] being the second order correct concentration at the exact edge
|
||||
: and ca[NANN-1] being the concentration at the exact center
|
||||
|
||||
? interface
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX cadifpmp
|
||||
USEION ca READ cao, ica WRITE cai, ica
|
||||
RANGE ica_pmp, last_ica_pmp, k1, k2, k3, k4, DFree
|
||||
GLOBAL vol, pump0
|
||||
}
|
||||
|
||||
DEFINE NANN 10
|
||||
|
||||
UNITS {
|
||||
(mV) = (millivolt)
|
||||
(molar) = (1/liter)
|
||||
(mM) = (millimolar)
|
||||
(um) = (micron)
|
||||
(mA) = (milliamp)
|
||||
(mol) = (1)
|
||||
FARADAY = (faraday) (coulomb)
|
||||
PI = (pi) (1)
|
||||
R = (k-mole) (joule/degC)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
DFree = 0.6 (um2/ms) <0,1e9>
|
||||
beta = 50 <0, 1e9>
|
||||
|
||||
k1 = 5e8 (/mM-s) <0, 1e10>:optional mm formulation
|
||||
k2 = .25e6 (/s) <0, 1e10>
|
||||
k3 = .5e3 (/s) <0, 1e10>
|
||||
k4 = 5e0 (/mM-s) <0, 1e10>
|
||||
pump0 = 3e-14 (mol/cm2) <0, 1e9> : set to 0 in hoc if this pump not wanted
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
celsius (degC)
|
||||
diam (um)
|
||||
v (millivolt)
|
||||
cao (mM)
|
||||
cai (mM)
|
||||
ica (mA/cm2)
|
||||
vol[NANN] (1) : gets extra cm2 when multiplied by diam^2
|
||||
ica_pmp (mA/cm2)
|
||||
area1 (um2)
|
||||
c1 (1+8 um5/ms)
|
||||
c2 (1-10 um2/ms)
|
||||
c3 (1-10 um2/ms)
|
||||
c4 (1+8 um5/ms)
|
||||
ica_pmp_last (mA/cm2)
|
||||
}
|
||||
|
||||
CONSTANT {
|
||||
volo = 1 (liter)
|
||||
}
|
||||
|
||||
STATE {
|
||||
ca[NANN] (mM) <1e-6> : ca[0] is equivalent to cai
|
||||
pump (mol/cm2) <1e-15>
|
||||
pumpca (mol/cm2) <1e-15>
|
||||
}
|
||||
|
||||
INITIAL {LOCAL total
|
||||
parms()
|
||||
FROM i=0 TO NANN-1 {
|
||||
ca[i] = cai
|
||||
}
|
||||
pumpca = cai*pump*c1/c2
|
||||
total = pumpca + pump
|
||||
if (total > 1e-9) {
|
||||
pump = pump*(pump/total)
|
||||
pumpca = pumpca*(pump/total)
|
||||
}
|
||||
ica_pmp = 0
|
||||
ica_pmp_last = 0
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE state METHOD sparse
|
||||
ica_pmp_last = ica_pmp
|
||||
ica = ica_pmp
|
||||
: printf("Breakpoint t=%g v=%g cai=%g ica=%g\n", t, v, cai, ica)
|
||||
}
|
||||
|
||||
LOCAL frat[NANN] : gets extra cm when multiplied by diam
|
||||
|
||||
PROCEDURE coord() {
|
||||
LOCAL r, dr2
|
||||
: cylindrical coordinate system with constant annuli thickness to
|
||||
: center of cell. Note however that the first annulus is half thickness
|
||||
: so that the concentration is second order correct spatially at
|
||||
: the membrane or exact edge of the cell.
|
||||
: note ca[0] is at edge of cell
|
||||
: ca[NANN-1] is at center of cell
|
||||
r = 1/2 :starts at edge (half diam)
|
||||
dr2 = r/(NANN-1)/2 :half thickness of annulus
|
||||
vol[0] = 0
|
||||
frat[0] = 2*r
|
||||
FROM i=0 TO NANN-2 {
|
||||
vol[i] = vol[i] + PI*(r-dr2/2)*2*dr2 :interior half
|
||||
r = r - dr2
|
||||
frat[i+1] = 2*PI*r/(2*dr2) :exterior edge of annulus
|
||||
: divided by distance between centers
|
||||
r = r - dr2
|
||||
vol[i+1] = PI*(r+dr2/2)*2*dr2 :outer half of annulus
|
||||
}
|
||||
}
|
||||
|
||||
KINETIC state {
|
||||
: printf("Solve begin t=%g v=%g cai=%g ica_pmp=%g\n", t, v, cai, ica_pmp)
|
||||
COMPARTMENT i, (1+beta)*diam*diam*vol[i]*1(um) {ca}
|
||||
COMPARTMENT (1e10)*area1 {pump pumpca}
|
||||
COMPARTMENT volo*(1e15) {cao}
|
||||
? kinetics
|
||||
~ pumpca <-> pump + cao (c3, c4)
|
||||
ica_pmp = (1e-4)*2*FARADAY*(f_flux - b_flux)/area1
|
||||
: all currents except pump
|
||||
~ ca[0] << (-(ica-ica_pmp_last)*PI*diam*1(um)*(1e4)*frat[0]/(2*FARADAY))
|
||||
:diffusion
|
||||
FROM i=0 TO NANN-2 {
|
||||
~ ca[i] <-> ca[i+1] (DFree*frat[i+1]*1(um), DFree*frat[i+1]*1(um))
|
||||
}
|
||||
:pump
|
||||
~ ca[0] + pump <-> pumpca (c1, c2)
|
||||
cai = ca[0] : this assignment statement is used specially by cvode
|
||||
: printf("Solve end cai=%g ica=%g ica_pmp=%g ica_pmp_last=%g\n",
|
||||
: cai, ica, ica_pmp,ica_pmp_last)
|
||||
}
|
||||
|
||||
PROCEDURE parms() {
|
||||
coord()
|
||||
area1 = 2*PI*(diam/2) * 1(um)
|
||||
c1 = (1e7)*area1 * k1
|
||||
c2 = (1e7)*area1 * k2
|
||||
c3 = (1e7)*area1 * k3
|
||||
c4 = (1e7)*area1 * k4
|
||||
}
|
||||
|
||||
FUNCTION ss() (mM) {
|
||||
SOLVE state STEADYSTATE sparse
|
||||
ss = cai
|
||||
}
|
||||
|
||||
COMMENT
|
||||
At this time, conductances (and channel states and currents are
|
||||
calculated at the midpoint of a dt interval. Membrane potential and
|
||||
concentrations are calculated at the edges of a dt interval. With
|
||||
secondorder=2 everything turns out to be second order correct.
|
||||
ENDCOMMENT
|
||||
50
cnmodel/mechanisms/cadiff.mod
Normal file
50
cnmodel/mechanisms/cadiff.mod
Normal file
@@ -0,0 +1,50 @@
|
||||
: Ca diffusion in a Purkinje cell
|
||||
: Created 8/15/02 - nwg
|
||||
|
||||
NEURON {
|
||||
SUFFIX cadiff
|
||||
USEION ca READ ica, cai WRITE cai
|
||||
RANGE ca
|
||||
GLOBAL depth, beta
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mV) = (millivolt)
|
||||
(mA) = (milliamp)
|
||||
(mM) = (milli/liter)
|
||||
(um) = (micron)
|
||||
}
|
||||
|
||||
CONSTANT {
|
||||
F = 9.6485e4 (coul)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
cai (mM)
|
||||
dt (ms)
|
||||
|
||||
depth = 0.1 (um)
|
||||
beta = 1 (/ms)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
ica (mA/cm2)
|
||||
}
|
||||
|
||||
STATE {
|
||||
ca (mM)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
ca = 0.0001
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
ca = ca + (10000.0) * dt * ( ( -1/(2*F)*ica / (depth)) - (0.0001) * beta * ca )
|
||||
|
||||
if ( ca < 1e-4 ) {: minimum 100 nM Ca
|
||||
ca = 1e-4
|
||||
}
|
||||
|
||||
cai = ca
|
||||
}
|
||||
100
cnmodel/mechanisms/cadyn.mod
Normal file
100
cnmodel/mechanisms/cadyn.mod
Normal file
@@ -0,0 +1,100 @@
|
||||
TITLE decay of submembrane calcium concentration
|
||||
:
|
||||
: Internal calcium concentration due to calcium currents and pump.
|
||||
: Differential equations.
|
||||
:
|
||||
: This file contains two mechanisms:
|
||||
:
|
||||
: 1. Simple model of ATPase pump with 3 kinetic constants (Destexhe 1992)
|
||||
:
|
||||
: Cai + P <-> CaP -> Cao + P (k1,k2,k3)
|
||||
:
|
||||
: A Michaelis-Menten approximation is assumed, which reduces the complexity
|
||||
: of the system to 2 parameters:
|
||||
: kt = <tot enzyme concentration> * k3 -> TIME CONSTANT OF THE PUMP
|
||||
: kd = k2/k1 (dissociation constant) -> EQUILIBRIUM CALCIUM VALUE
|
||||
: The values of these parameters are chosen assuming a high affinity of
|
||||
: the pump to calcium and a low transport capacity (cfr. Blaustein,
|
||||
: TINS, 11: 438, 1988, and references therein).
|
||||
:
|
||||
: For further information about this this mechanism, see Destexhe, A.
|
||||
: Babloyantz, A. and Sejnowski, TJ. Ionic mechanisms for intrinsic slow
|
||||
: oscillations in thalamic relay neurons. Biophys. J. 65: 1538-1552, 1993.
|
||||
:
|
||||
:
|
||||
: 2. Simple first-order decay or buffering:
|
||||
:
|
||||
: Cai + B <-> ...
|
||||
:
|
||||
: which can be written as:
|
||||
:
|
||||
: dCai/dt = (cainf - Cai) / taur
|
||||
:
|
||||
: where cainf is the equilibrium intracellular calcium value (usually
|
||||
: in the range of 200-300 nM) and taur is the time constant of calcium
|
||||
: removal. The dynamics of submembranal calcium is usually thought to
|
||||
: be relatively fast, in the 1-10 millisecond range (see Blaustein,
|
||||
: TINS, 11: 438, 1988).
|
||||
:
|
||||
: All variables are range variables
|
||||
:
|
||||
: Written by Alain Destexhe, Salk Institute, Nov 12, 1992
|
||||
:
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
NEURON {
|
||||
SUFFIX cadyn
|
||||
USEION ca READ ica, cai WRITE cai
|
||||
RANGE depth,kt,kd,cainf,taur
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(molar) = (1/liter) : moles do not appear in units
|
||||
(mM) = (millimolar)
|
||||
(um) = (micron)
|
||||
(mA) = (milliamp)
|
||||
(msM) = (ms mM)
|
||||
}
|
||||
|
||||
CONSTANT {
|
||||
FARADAY = 96489 (coul) : moles do not appear in units
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
depth = .1 (um) : depth of shell
|
||||
taur = 1e10 (ms) : remove first-order decay
|
||||
cainf = 1.4e-1 (mM)
|
||||
kt = 1e-4 (mM/ms)
|
||||
kd = 1e-4 (mM)
|
||||
}
|
||||
|
||||
STATE {
|
||||
cai (mM)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
cai = kd
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
ica (mA/cm2)
|
||||
drive_channel (mM/ms)
|
||||
drive_pump (mM/ms)
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE state METHOD cnexp
|
||||
}
|
||||
|
||||
DERIVATIVE state {
|
||||
|
||||
drive_channel = - (10000) * ica / (2 * FARADAY * depth)
|
||||
|
||||
if (drive_channel <= 0.) { drive_channel = 0. } : cannot pump inward
|
||||
|
||||
drive_pump = -kt * cai / (cai + kd ) : Michaelis-Menten
|
||||
|
||||
cai' = drive_channel + drive_pump + (cainf-cai)/taur
|
||||
}
|
||||
|
||||
86
cnmodel/mechanisms/cap.mod
Normal file
86
cnmodel/mechanisms/cap.mod
Normal file
@@ -0,0 +1,86 @@
|
||||
: HH P-type Calcium current
|
||||
: Created 8/13/02 - nwg
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX cap
|
||||
USEION ca READ cai, cao WRITE ica
|
||||
RANGE pcabar, ica
|
||||
RANGE minf, mtau
|
||||
RANGE monovalConc, monovalPerm
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mV) = (millivolt)
|
||||
(mA) = (milliamp)
|
||||
(mM) = (milli/liter)
|
||||
F = 9.6485e4 (coul)
|
||||
R = 8.3145 (joule/degC)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius (degC)
|
||||
|
||||
pcabar = 0.00005 (cm/s)
|
||||
monovalConc = 140 (mM)
|
||||
monovalPerm = 0
|
||||
|
||||
cai (milli/liter)
|
||||
cao (milli/liter)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
ica (mA/cm2)
|
||||
minf
|
||||
mtau (ms)
|
||||
T (degC)
|
||||
E (volts)
|
||||
}
|
||||
|
||||
STATE {
|
||||
m
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
m = minf
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
ica = (1e3) * pcabar * m * ghk(v, cai, cao, 2)
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
m' = (minf - m)/mtau
|
||||
}
|
||||
|
||||
FUNCTION ghk( v(mV), ci(mM), co(mM), z) (coul/cm3) { LOCAL Ci
|
||||
T = celsius + 273.19 : Kelvin
|
||||
E = (1e-3) * v
|
||||
Ci = ci + (monovalPerm) * (monovalConc) : Monovalent permeability
|
||||
if (fabs(1-exp(-z*(F*E)/(R*T))) < 1e-6) { : denominator is small -> Taylor series
|
||||
ghk = (1e-6) * z * F * (Ci-co*exp(-z*(F*E)/(R*T)))*(1-(z*(F*E)/(R*T)))
|
||||
} else {
|
||||
ghk = (1e-6) * z^2*(E*F^2)/(R*T)*(Ci-co*exp(-z*(F*E)/(R*T)))/(1-exp(-z*(F*E)/(R*T)))
|
||||
}
|
||||
}
|
||||
|
||||
PROCEDURE rates (v (mV)) {
|
||||
UNITSOFF
|
||||
minf = 1/(1+exp(-(v - (-19)) / 5.5))
|
||||
mtau = (mtau_func(v)) * 1e3
|
||||
UNITSON
|
||||
}
|
||||
|
||||
FUNCTION mtau_func( v (mV) ) (ms) {
|
||||
UNITSOFF
|
||||
if (v > -50) {
|
||||
mtau_func = .000191 + .00376*exp(-((v-(-41.9))/27.8)^2)
|
||||
} else {
|
||||
mtau_func = .00026367 + .1278 * exp(.10327*v)
|
||||
}
|
||||
UNITSON
|
||||
}
|
||||
71
cnmodel/mechanisms/capmp.mod
Normal file
71
cnmodel/mechanisms/capmp.mod
Normal file
@@ -0,0 +1,71 @@
|
||||
NEURON {
|
||||
SUFFIX capmp
|
||||
USEION ca READ cao, ica, cai WRITE cai, ica
|
||||
RANGE tau, width, cabulk, ica, pump0
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(um) = (micron)
|
||||
(molar) = (1/liter)
|
||||
(mM) = (millimolar)
|
||||
(uM) = (micromolar)
|
||||
(mA) = (milliamp)
|
||||
(mol) = (1)
|
||||
FARADAY = (faraday) (coulomb)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
width = 0.1 (um)
|
||||
tau = 1 (ms)
|
||||
k1 = 5e8 (/mM-s)
|
||||
k2 = 0.25e6 (/s)
|
||||
k3 = 0.5e3 (/s)
|
||||
k4 = 5e0 (/mM-s)
|
||||
cabulk = 0.1 (uM)
|
||||
pump0 = 3e-14 (mol/cm2)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
cao (mM) : 2
|
||||
cai (mM) : 100e-6
|
||||
ica (mA/cm2)
|
||||
ica_pmp (mA/cm2)
|
||||
ica_pmp_last (mA/cm2)
|
||||
}
|
||||
|
||||
STATE {
|
||||
cam (uM) <1e-6>
|
||||
pump (mol/cm2) <1e-16>
|
||||
capump (mol/cm2) <1e-16>
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
ica = 0
|
||||
ica_pmp = 0
|
||||
ica_pmp_last = 0
|
||||
SOLVE pmp STEADYSTATE sparse
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE pmp METHOD sparse
|
||||
ica_pmp_last = ica_pmp
|
||||
ica = ica_pmp
|
||||
}
|
||||
|
||||
KINETIC pmp {
|
||||
~ cabulk <-> cam (width/tau, width/tau)
|
||||
~ cam + pump <-> capump ((1e7)*k1, (1e10)*k2)
|
||||
~ capump <-> cao + pump ((1e10)*k3, (1e10)*k4)
|
||||
ica_pmp = (1e-7)*2*FARADAY*(f_flux - b_flux)
|
||||
|
||||
: ica_pmp_last vs ica_pmp needed because of STEADYSTATE calculation
|
||||
~ cam << (-(ica - ica_pmp_last)/(2*FARADAY)*(1e7))
|
||||
|
||||
CONSERVE pump + capump = (1e13)*pump0
|
||||
COMPARTMENT width {cam} : volume has dimensions of um
|
||||
COMPARTMENT (1e13) {pump capump} : area is dimensionless
|
||||
COMPARTMENT 1(um) {cabulk}
|
||||
COMPARTMENT (1e3)*1(um) {cao}
|
||||
|
||||
cai = (0.001)*cam
|
||||
}
|
||||
32
cnmodel/mechanisms/capump.mod
Normal file
32
cnmodel/mechanisms/capump.mod
Normal file
@@ -0,0 +1,32 @@
|
||||
NEURON {
|
||||
SUFFIX capump
|
||||
USEION ca READ cai WRITE ica
|
||||
RANGE vmax, kmp, ica
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(uM) = (micro/liter)
|
||||
(mM) = (milli/liter)
|
||||
(mA) = (milliamp)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
vmax = .0667 (mA/cm2) <0, 1e6>: at 6.3 deg, Q10 = 3
|
||||
kmp = .2 (uM) <0, 1e6>
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
celsius (degC)
|
||||
ica (mA/cm2)
|
||||
cai (mM)
|
||||
}
|
||||
|
||||
LOCAL Q, s_celsius
|
||||
|
||||
BREAKPOINT {
|
||||
if (s_celsius*1(degC) != celsius) {
|
||||
s_celsius = celsius
|
||||
Q = 3^((celsius - 6.3)/10 (degC))
|
||||
}
|
||||
ica = vmax*Q*cai/(cai + (.001)*kmp) / 5.18
|
||||
}
|
||||
88
cnmodel/mechanisms/cleftXmtr.mod
Executable file
88
cnmodel/mechanisms/cleftXmtr.mod
Executable file
@@ -0,0 +1,88 @@
|
||||
COMMENT
|
||||
cleftXmtr
|
||||
|
||||
This is simple state model that generates "cleft" transmitter, through
|
||||
the following scheme:
|
||||
|
||||
A netreceive block receives the driving event. This forces XV (the vesicle
|
||||
state) to be set to XMax to mimic the release of a vesicle.
|
||||
Then:
|
||||
XV --> XC --> XU
|
||||
where XV is the vesicle transmitter, XC is the cleft transmitter and
|
||||
XU is transmitter that has been taken up. The forward rates are finite, and the
|
||||
reverse rates are 0 (XU is an absorbing state)
|
||||
|
||||
The forward rate kv1 mimics simple first-order diffusion across the cleft
|
||||
The forward rate ku1 mimics simple first-order uptake from the cleft
|
||||
|
||||
The concentration XC is available to the program as Xmtr.
|
||||
XMax is the max cleft concentration of transmitter.
|
||||
|
||||
Because vesicle release events at a single presynaptic terminal can be nearly
|
||||
simultaneous, it is important that this mechanism does not have a refractory
|
||||
period. We also assume that the uptake mechanism is not saturable.
|
||||
|
||||
Paul B. Manis, Ph.D.
|
||||
UNC Chapel Hill
|
||||
3 Jan 2010
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
DEFINE NSTEP 5
|
||||
|
||||
NEURON {
|
||||
POINT_PROCESS cleftXmtr
|
||||
POINTER pre
|
||||
RANGE KV, KU, XMax
|
||||
RANGE CXmtr, preThresh
|
||||
}
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
PARAMETER { : Parameters are chosen from best fit to stellate cell data in VCN
|
||||
KV = 531 (/ms) <0,1e9> : release rate from vesicle
|
||||
KU = 4.17 (/ms) <0,1e3> : uptake rate
|
||||
XMax = 0.731 (mM)
|
||||
preThresh = 0
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
pre
|
||||
CXmtr (mM)
|
||||
preLast (1)
|
||||
tLast
|
||||
}
|
||||
|
||||
STATE {
|
||||
XV : Vesicle transmitter (just released)
|
||||
XC : Cleft transmitter (e.g., at receptor)
|
||||
XU : Uptake state (dead state... )
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
XV = 0
|
||||
XC = 0 (mM)
|
||||
XU = 0
|
||||
CXmtr = 0.0
|
||||
preLast = 0.0
|
||||
tLast = 0.0
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE kstates METHOD sparse
|
||||
CXmtr = XC*XMax
|
||||
}
|
||||
|
||||
KINETIC kstates {
|
||||
~ XV <-> XC (KV, 0.0)
|
||||
~ XC <-> XU (KU, 0.0)
|
||||
: note that this mechanism has no CONSERVATION : XU can accumulate as much
|
||||
: as needed.
|
||||
}
|
||||
|
||||
NET_RECEIVE(conc (mM)) { : detect and cause a release event
|
||||
XV = XV + 1
|
||||
}
|
||||
65
cnmodel/mechanisms/gly.mod
Executable file
65
cnmodel/mechanisms/gly.mod
Executable file
@@ -0,0 +1,65 @@
|
||||
TITLE Gly synapse
|
||||
|
||||
COMMENT
|
||||
MODIFIED to be a faster GLY synapse, taken from GABA synapse
|
||||
Paul B. Manis - 7 Feb 2000
|
||||
|
||||
simple alpha-synapse that generates a single PSP
|
||||
*********************************************
|
||||
reference: McCormick, Wang & Huguenard (1993)
|
||||
Cerebral Cortex 3(5), 387-398
|
||||
found in: cat reticular nucleus of thalamus
|
||||
*********************************************
|
||||
Assembled for MyFirstNEURON by Arthur Houweling
|
||||
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
NEURON {
|
||||
POINT_PROCESS GlySynapse
|
||||
USEION cl READ ecl VALENCE 1
|
||||
: negative valence not accepted by nrnivmodl
|
||||
RANGE onset, gmaxIPSP, e, g, i, w
|
||||
NONSPECIFIC_CURRENT i
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
(mV) = (millivolt)
|
||||
(nS) = (nanomho)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
onset= 25 (ms)
|
||||
gmaxIPSP= 0 (nS)
|
||||
w= 1 : weight factor for gmaxIPSP
|
||||
ecl (mV)
|
||||
v (mV)
|
||||
celsius (degC)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
i (nA)
|
||||
g (nS)
|
||||
tadj
|
||||
}
|
||||
|
||||
UNITSOFF
|
||||
INITIAL {
|
||||
tadj = 3^((celsius-23.5)/10)
|
||||
}
|
||||
|
||||
BREAKPOINT { LOCAL tt
|
||||
tt= (t-onset)*tadj
|
||||
if ((t>onset)&&(tt<740)) {
|
||||
: the exp() function does not accept arguments smaller than -745
|
||||
g = w*gmaxIPSP * exp(-tt/15) * (1-exp(-tt/0.5))/0.84
|
||||
}
|
||||
else {g = 0}
|
||||
: -ecl because negative valences can not be specified
|
||||
i = g * (v-(-ecl))
|
||||
}
|
||||
UNITSON
|
||||
|
||||
196
cnmodel/mechanisms/gly2.mod
Executable file
196
cnmodel/mechanisms/gly2.mod
Executable file
@@ -0,0 +1,196 @@
|
||||
COMMENT
|
||||
-----------------------------------------------------------------------------
|
||||
Simple synaptic mechanism derived for first order kinetics of
|
||||
binding of transmitter to postsynaptic receptors.
|
||||
|
||||
A. Destexhe & Z. Mainen, The Salk Institute, March 12, 1993.
|
||||
Last modif. Sept 8, 1993.
|
||||
|
||||
Reference:
|
||||
|
||||
Destexhe, A., Mainen, Z. and Sejnowski, T.J. An efficient method for
|
||||
computing synaptic conductances based on a kinetic model of receptor binding.
|
||||
Neural Computation, 6: 14-18, 1994.
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
During the arrival of the presynaptic spike (detected by threshold
|
||||
crossing), it is assumed that there is a brief pulse (duration=Cdur)
|
||||
of neurotransmitter C in the synaptic cleft (the maximal concentration
|
||||
of C is Cmax). Then, C is assumed to bind to a receptor Rc according
|
||||
to the following first-order kinetic scheme:
|
||||
|
||||
Rc + C ---(Alpha)--> Ro (1)
|
||||
<--(Beta)---
|
||||
|
||||
where Rc and Ro are respectively the closed and open form of the
|
||||
postsynaptic receptor, Alpha and Beta are the forward and backward
|
||||
rate constants. If R represents the fraction of open gates Ro,
|
||||
then one can write the following kinetic equation:
|
||||
|
||||
dR/dt = Alpha * C * (1-R) - Beta * R (2)
|
||||
|
||||
and the postsynaptic current is given by:
|
||||
|
||||
Isyn = gmax * R * (V-Erev) (3)
|
||||
|
||||
where V is the postsynaptic potential, gmax is the maximal conductance
|
||||
of the synapse and Erev is the reversal potential.
|
||||
|
||||
If C is assumed to occur as a pulse in the synaptic cleft, such as
|
||||
|
||||
C _____ . . . . . . Cmax
|
||||
| |
|
||||
_____| |______ . . . 0
|
||||
t0 t1
|
||||
|
||||
then one can solve the kinetic equation exactly, instead of solving
|
||||
one differential equation for the state variable and for each synapse,
|
||||
which would be greatly time consuming...
|
||||
|
||||
Equation (2) can be solved as follows:
|
||||
|
||||
1. during the pulse (from t=t0 to t=t1), C = Cmax, which gives:
|
||||
|
||||
R(t-t0) = Rinf + [ R(t0) - Rinf ] * exp (- (t-t0) / Rtau ) (4)
|
||||
|
||||
where
|
||||
Rinf = Alpha * Cmax / (Alpha * Cmax + Beta)
|
||||
and
|
||||
Rtau = 1 / (Alpha * Cmax + Beta)
|
||||
|
||||
2. after the pulse (t>t1), C = 0, and one can write:
|
||||
|
||||
R(t-t1) = R(t1) * exp (- Beta * (t-t1) ) (5)
|
||||
|
||||
There is a pointer called "pre" which must be set to the variable which
|
||||
is supposed to trigger synaptic release. This variable is usually the
|
||||
presynaptic voltage but it can be the presynaptic calcium concentration,
|
||||
or other. Prethresh is the value of the threshold at which the release is
|
||||
initiated.
|
||||
|
||||
Once pre has crossed the threshold value given by Prethresh, a pulse
|
||||
of C is generated for a duration of Cdur, and the synaptic conductances
|
||||
are calculated accordingly to eqs (4-5). Another event is not allowed to
|
||||
occur for Deadtime milliseconds following after pre rises above threshold.
|
||||
|
||||
The user specifies the presynaptic location in hoc via the statement
|
||||
connect pre_GABA[i] , v.section(x)
|
||||
|
||||
where x is the arc length (0 - 1) along the presynaptic section (the currently
|
||||
specified section), and i is the synapse number (Which is located at the
|
||||
postsynaptic location in the usual way via
|
||||
postsynaptic_section {loc_GABA(i, x)}
|
||||
Notice that loc_GABA() must be executed first since that function also
|
||||
allocates space for the synapse.
|
||||
-----------------------------------------------------------------------------
|
||||
GLY SYNAPSE (GLY receptors)
|
||||
|
||||
currently parameters are same as GABA-A until I get the Harty data in here
|
||||
P. Manis 2/10/2000
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
ENDCOMMENT
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
NEURON {
|
||||
POINT_PROCESS GLY2
|
||||
POINTER pre
|
||||
RANGE C, R, R0, R1, g, gmax, Erev, lastrelease, Prethresh
|
||||
NONSPECIFIC_CURRENT i
|
||||
GLOBAL Cmax, Cdur, Alpha, Beta, Deadtime, Rinf, Rtau
|
||||
}
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
(mV) = (millivolt)
|
||||
(umho) = (micromho)
|
||||
(mM) = (milli/liter)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
|
||||
Cmax = 1 (mM) : max transmitter concentration
|
||||
Cdur = 1 (ms) : transmitter duration (rising phase)
|
||||
Alpha = 0.53 (/ms mM) : forward (binding) rate
|
||||
Beta = 0.18 (/ms) : backward (unbinding) rate
|
||||
Erev = -80 (mV) : reversal potential
|
||||
Prethresh = 0 : voltage level nec for release
|
||||
Deadtime = 1 (ms) : mimimum time between release events
|
||||
gmax (umho) : maximum conductance
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
v (mV) : postsynaptic voltage
|
||||
i (nA) : current = g*(v - Erev)
|
||||
g (umho) : conductance
|
||||
C (mM) : transmitter concentration
|
||||
R : fraction of open channels
|
||||
R0 : open channels at start of release
|
||||
R1 : open channels at end of release
|
||||
Rinf : steady state channels open
|
||||
Rtau (ms) : time constant of channel binding
|
||||
pre : pointer to presynaptic variable
|
||||
lastrelease (ms) : time of last spike
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
R = 0
|
||||
C = 0
|
||||
R0 = 0
|
||||
R1 = 0
|
||||
Rinf = Cmax*Alpha / (Cmax*Alpha + Beta)
|
||||
Rtau = 1 / ((Alpha * Cmax) + Beta)
|
||||
lastrelease = -999
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE release
|
||||
g = gmax * R
|
||||
i = g*(v - Erev)
|
||||
}
|
||||
|
||||
PROCEDURE release() { LOCAL q
|
||||
:will crash if user hasn't set pre with the connect statement
|
||||
|
||||
q = ((t - lastrelease) - Cdur) : time since last release ended
|
||||
|
||||
: ready for another release?
|
||||
if (q > Deadtime) {
|
||||
if (pre > Prethresh) { : spike occured?
|
||||
C = Cmax : start new release
|
||||
R0 = R
|
||||
lastrelease = t
|
||||
}
|
||||
|
||||
} else if (q < 0) { : still releasing?
|
||||
|
||||
: do nothing
|
||||
|
||||
} else if (C == Cmax) { : in dead time after release
|
||||
R1 = R
|
||||
C = 0.
|
||||
}
|
||||
|
||||
if (C > 0) { : transmitter being released?
|
||||
|
||||
R = Rinf + (R0 - Rinf) * exptable (- (t - lastrelease) / Rtau)
|
||||
|
||||
} else { : no release occuring
|
||||
|
||||
R = R1 * exptable (- Beta * (t - (lastrelease + Cdur)))
|
||||
}
|
||||
|
||||
VERBATIM
|
||||
return 0;
|
||||
ENDVERBATIM
|
||||
}
|
||||
|
||||
FUNCTION exptable(x) {
|
||||
TABLE FROM -10 TO 10 WITH 2000
|
||||
|
||||
if ((x > -10) && (x < 10)) {
|
||||
exptable = exp(x)
|
||||
} else {
|
||||
exptable = 0.
|
||||
}
|
||||
}
|
||||
101
cnmodel/mechanisms/hcno.mod
Normal file
101
cnmodel/mechanisms/hcno.mod
Normal file
@@ -0,0 +1,101 @@
|
||||
TITLE h current for Octopus cells of Cochlear Nucleus
|
||||
: From Bal and Oertel (2000)
|
||||
: M.Migliore Oct. 2001
|
||||
: Modified, P. Manis July 2014.
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX hcno
|
||||
NONSPECIFIC_CURRENT i
|
||||
RANGE gbar, eh, gh
|
||||
GLOBAL hinf, tau1, tau2
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(pS) = (picosiemens)
|
||||
(um) = (micron)
|
||||
R = (k-mole)(joule/degC)
|
||||
F = (faraday)(kilocoulombs)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
gbar = 0.0005 (mho/cm2)
|
||||
|
||||
vhalf1 = -50 (mV) : v 1/2 for forward
|
||||
vhalf2 = -84 (mV) : v 1/2 for backward
|
||||
gm1 = 0.3 :(mV) : slope for forward
|
||||
gm2 = 0.6 : (mV) : slope for backward
|
||||
zeta1 = 3 : (/ms)
|
||||
zeta2 = 3 : (/ms)
|
||||
a01 = 0.008 (/ms)
|
||||
a02 = 0.0029 (/ms)
|
||||
frac = 0.0
|
||||
c0 = 273.16 (degC)
|
||||
thinf = -66 (mV) : inact inf slope
|
||||
qinf = 7 (mV) : inact inf slope
|
||||
q10tau = 4.5 : from Magee (1998)
|
||||
v (mV)
|
||||
q10g = 2.0 : Rothman...
|
||||
}
|
||||
|
||||
|
||||
ASSIGNED {
|
||||
celsius (degC)
|
||||
i (mA/cm2)
|
||||
gh (mho/cm2)
|
||||
eh (mV) : must be explicitly def. in hoc
|
||||
hinf
|
||||
tau1 (ms)
|
||||
tau2 (ms)
|
||||
qg () : computed q10 for gnabar based on q10g
|
||||
q10 ()
|
||||
ssih
|
||||
}
|
||||
|
||||
|
||||
STATE { h1 h2 }
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD derivimplicit
|
||||
gh = qg*gbar*(h1*frac + h2*(1.0-frac))
|
||||
i = gh * (v - eh)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
qg = q10g^((celsius-33.0)/10.0 (degC)) :note original measurements made at 33 C
|
||||
q10 = q10tau^((celsius - 22.0)/10.0 (degC)) : if you don't like room temp, it can be changed!
|
||||
rates(v)
|
||||
h1=hinf
|
||||
h2=hinf
|
||||
ssih = 0.
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
h1' = (hinf - h1)/tau1
|
||||
h2' = (hinf - h2)/tau2
|
||||
}
|
||||
|
||||
PROCEDURE rates(v (mV)) {
|
||||
tau1 = bet1(v)/(q10*a01*(1.0+alp1(v)))
|
||||
tau2 = bet2(v)/(q10*a02*(1.0+alp2(v)))
|
||||
hinf = 1.0/(1.0+exp((v-thinf)/qinf))
|
||||
}
|
||||
|
||||
FUNCTION alp1(v(mV)) {
|
||||
alp1 = exp(1e-3*zeta1*(v-vhalf1)*F/(R*(c0+celsius)))
|
||||
}
|
||||
|
||||
FUNCTION bet1(v(mV)) {
|
||||
bet1 = exp(1.e-3*zeta1*gm1*(v-vhalf1)*F/(R*(c0+celsius)))
|
||||
}
|
||||
|
||||
FUNCTION alp2(v(mV)) {
|
||||
alp2 = exp(1.e-3*zeta2*(v-vhalf2)*F/(R*(c0+celsius)))
|
||||
}
|
||||
|
||||
FUNCTION bet2(v(mV)) {
|
||||
bet2 = exp(1.e-3*zeta2*gm2*(v-vhalf2)*F/(R*(c0+celsius)))
|
||||
}
|
||||
103
cnmodel/mechanisms/hcno_bo.mod
Normal file
103
cnmodel/mechanisms/hcno_bo.mod
Normal file
@@ -0,0 +1,103 @@
|
||||
TITLE h current for Octopus cells of Cochlear Nucleus
|
||||
: From Bal and Oertel (2000)
|
||||
|
||||
: Modified, P. Manis July 2014, 2017
|
||||
: Parameters from McGinley et al. paper
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX hcnobo
|
||||
NONSPECIFIC_CURRENT i
|
||||
RANGE gbar, eh, gh, q10tau
|
||||
GLOBAL hinf, tau1, tau2
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(pS) = (picosiemens)
|
||||
(um) = (micron)
|
||||
R = (k-mole)(joule/degC)
|
||||
F = (faraday)(kilocoulombs)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
gbar = 0.0005 (mho/cm2)
|
||||
|
||||
vhalf1 = -70 (mV) : -50 (mV) : v 1/2 for forward
|
||||
vhalf2 = -84 (mV) : v 1/2 for backward
|
||||
gm1 = 0.3 :(mV) : slope for forward
|
||||
gm2 = 0.6 : (mV) : slope for backward
|
||||
zeta1 = 3 : (/ms)
|
||||
: zeta2 = 3 : (/ms)
|
||||
a01 = 4.8e-3 (/ms) : was 0.008
|
||||
a02 = 2.9e-3 (/ms) : was 0.0029 (/ms)
|
||||
frac = 0.8
|
||||
c0 = 273.16 (degC)
|
||||
thinf = -72.4 (mV) : inact inf slope
|
||||
qinf = 5.3 (mV) : inact inf slope
|
||||
q10tau = 4.5 : from Magee (1998)
|
||||
v (mV)
|
||||
}
|
||||
|
||||
|
||||
ASSIGNED {
|
||||
celsius (degC)
|
||||
i (mA/cm2)
|
||||
gh (mho/cm2)
|
||||
eh (mV) : must be explicitly def. in hoc
|
||||
hinf
|
||||
tau1 (ms)
|
||||
tau2 (ms)
|
||||
q10 ()
|
||||
ssih
|
||||
ct
|
||||
}
|
||||
|
||||
|
||||
STATE { h1 h2 }
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
: SOLVE states METHOD derivimplicit
|
||||
gh = gbar*(h1*frac + h2*(1.0-frac))
|
||||
i = gh * (v - eh)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
ct = 1e-3*zeta1*F/(R*(c0+celsius))
|
||||
|
||||
q10 = q10tau^((celsius - 33.0)/10.0 (degC)) : Measurements at 33
|
||||
rates(v)
|
||||
h1=hinf
|
||||
h2=hinf
|
||||
ssih = 0.
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
h1' = (hinf - h1)/tau1
|
||||
h2' = (hinf - h2)/tau2
|
||||
}
|
||||
|
||||
PROCEDURE rates(v (mV)) {
|
||||
tau1 = bet1(v)/(q10*a01*(1.0+alp1(v)))
|
||||
tau2 = bet2(v)/(q10*a02*(1.0+alp2(v)))
|
||||
hinf = 1.0/(1.0+exp((v-thinf)/qinf))
|
||||
}
|
||||
|
||||
FUNCTION alp1(v(mV)) {
|
||||
alp1 = exp((v-vhalf1)*ct)
|
||||
}
|
||||
|
||||
FUNCTION bet1(v(mV)) {
|
||||
bet1 = exp(gm1*(v-vhalf1)*ct)
|
||||
}
|
||||
|
||||
FUNCTION alp2(v(mV)) {
|
||||
alp2 = exp((v-vhalf2)*ct)
|
||||
}
|
||||
|
||||
FUNCTION bet2(v(mV)) {
|
||||
bet2 = exp(gm2*(v-vhalf2)*ct)
|
||||
}
|
||||
48
cnmodel/mechanisms/iStim.mod
Executable file
48
cnmodel/mechanisms/iStim.mod
Executable file
@@ -0,0 +1,48 @@
|
||||
COMMENT
|
||||
iStim
|
||||
|
||||
This is a point current injection (like an electrode).
|
||||
Positive values of the amplitude depolarize the cell
|
||||
and in the presence of the extracellular mechanism there will be a change
|
||||
in vext since i is not a transmembrane current but a current injected
|
||||
directly to the inside of the cell.
|
||||
|
||||
This is meant to be used with Vector Play...
|
||||
ENDCOMMENT
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
DEFINE NSTEP 5
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
POINT_PROCESS iStim
|
||||
RANGE dur, delay, iMax
|
||||
ELECTRODE_CURRENT i
|
||||
}
|
||||
UNITS {
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
PARAMETER {
|
||||
dur (ms) <0,1e9>
|
||||
delay (ms) <0,1e9>
|
||||
iMax (nA)
|
||||
}
|
||||
ASSIGNED {
|
||||
i (nA)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
i = 0
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
COMMENT
|
||||
if(t < delay || t > (delay+dur)) {
|
||||
i = 0
|
||||
}
|
||||
if(t >= delay && t <= (delay+dur)) {
|
||||
i = iMax
|
||||
}
|
||||
ENDCOMMENT
|
||||
}
|
||||
56
cnmodel/mechanisms/ihpkj.mod
Normal file
56
cnmodel/mechanisms/ihpkj.mod
Normal file
@@ -0,0 +1,56 @@
|
||||
: Ih current
|
||||
: Created 8/6/02 - nwg
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX hpkj
|
||||
NONSPECIFIC_CURRENT i
|
||||
RANGE gbar, gh, eh
|
||||
GLOBAL ninf, ntau
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(S) = (siemens)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
|
||||
gbar = .0001 (S/cm2)
|
||||
|
||||
eh = -30 (mV)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gh (mho/cm2)
|
||||
i (mA/cm2)
|
||||
ninf
|
||||
ntau (ms)
|
||||
}
|
||||
|
||||
STATE {
|
||||
n
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
n = ninf
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gh = gbar * n
|
||||
i = gh*(v - eh)
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
n' = (ninf - n)/ntau
|
||||
}
|
||||
|
||||
PROCEDURE rates(v (mV)) {
|
||||
ninf = 1/(1+exp((v+90.1(mV))/9.9(mV)))
|
||||
ntau = (1000) * (0.19 (s) + 0.72 (s)*exp(-((v-(-81.5(mV)))/11.9(mV))^2))
|
||||
}
|
||||
134
cnmodel/mechanisms/ihpyr.mod
Normal file
134
cnmodel/mechanisms/ihpyr.mod
Normal file
@@ -0,0 +1,134 @@
|
||||
TITLE ihpyr.mod DCN pyramidal cell model H-current
|
||||
|
||||
COMMENT
|
||||
|
||||
This model is part a Dorsal Cochlear Nucleus Pyramidal point cell
|
||||
based on kinetic data from Kanold and Manis (1999) and Kanold's dissertation (1999)
|
||||
|
||||
-- 15 Jan 1999 P. Manis
|
||||
|
||||
Added export of start states for some variables to do perturbation tests
|
||||
These start values replace the "inf" values used in the initialization procedure
|
||||
Note that if the start variable is set to a value less than 0,
|
||||
then the default initialization will be done. Typically I use a value of -1 for this flagging
|
||||
Note also that it is possible to set the initial values > 1 but this is meaningless in terms of
|
||||
the present equations.
|
||||
-- 5 Feb 1999 P. Manis
|
||||
|
||||
Added Patrick's version of ih as ihpyr
|
||||
Model is from Destexhe and Babloyantz 1993; Destexhe et al. 1993
|
||||
|
||||
|
||||
2/10/02. P. Manis.
|
||||
7/23/2014 P. Manis - separated from pyr.mod.
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
}
|
||||
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX ihpyr
|
||||
USEION na READ ena WRITE ina
|
||||
USEION k READ ek WRITE ik
|
||||
NONSPECIFIC_CURRENT i
|
||||
: USEION h READ eh WRITE ih VALENCE 1
|
||||
RANGE eh
|
||||
:
|
||||
RANGE gh, kh_m_inf, kh_n_inf, aih, gbar, ghvshift
|
||||
RANGE kh_m_tau, kh_n_tau
|
||||
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius (degC)
|
||||
dt (ms)
|
||||
ek (mV) : = -81.5 (mV)
|
||||
ena (mV) : = 50.0 (mV)
|
||||
gbar = 0.00025 (mho/cm2) <0,1e9>
|
||||
ghvshift = 0 (mV)
|
||||
eh (mV) : = -43.0(mV)
|
||||
}
|
||||
|
||||
STATE {
|
||||
khm khn
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gh (mho/cm2)
|
||||
ina (mA/cm2)
|
||||
ik (mA/cm2)
|
||||
ih (mA/cm2)
|
||||
i (mA/cm2)
|
||||
kh_m_inf kh_n_inf
|
||||
kh_m_tau kh_n_tau
|
||||
aih
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
aih = khm*khn
|
||||
gh = gbar*aih
|
||||
ih = gh*(v - eh)
|
||||
i = ih
|
||||
}
|
||||
|
||||
UNITSOFF
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
khm = kh_m_inf
|
||||
khn = kh_n_inf
|
||||
}
|
||||
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
khm' = (kh_m_inf - khm) / kh_m_tau
|
||||
khn' = (kh_n_inf - khn) / kh_n_tau
|
||||
}
|
||||
|
||||
|
||||
LOCAL q10
|
||||
|
||||
PROCEDURE rates(v(mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
q10 = 3^((celsius - 22)/10 (degC))
|
||||
|
||||
:"kh" adaptation of Destexhe hyp-activated cation current by Patrick Kanold
|
||||
kh_m_inf = kh_m(v)
|
||||
kh_n_inf = kh_n(v)
|
||||
kh_m_tau = kh_mt(v)
|
||||
kh_n_tau = kh_nt(v)
|
||||
}
|
||||
|
||||
: Make these as functions so we can view them from hoc, although this
|
||||
: may slow things down a bit
|
||||
|
||||
|
||||
FUNCTION kh_m(x (mV)) {
|
||||
kh_m = 1/(1+exp((x+68.9+ghvshift)/6.5))
|
||||
}
|
||||
|
||||
FUNCTION kh_n(x (mV)) {
|
||||
kh_n = 1/(1+exp((x+68.9+ghvshift)/6.5)) : same as kh_m, but for completeness, compute this
|
||||
}
|
||||
|
||||
FUNCTION kh_mt(v (mV)) {
|
||||
kh_mt = exp((v+183.6+ghvshift)/15.24)
|
||||
}
|
||||
|
||||
FUNCTION kh_nt(v (mV)) {
|
||||
kh_nt = exp((v+158.6+ghvshift)/11.2)/(1+exp((v+75+ghvshift)/5.5))
|
||||
}
|
||||
|
||||
|
||||
|
||||
142
cnmodel/mechanisms/ihpyr_adj.mod
Normal file
142
cnmodel/mechanisms/ihpyr_adj.mod
Normal file
@@ -0,0 +1,142 @@
|
||||
TITLE ihpyr_adj.mod DCN pyramidal cell model H-current
|
||||
|
||||
COMMENT
|
||||
|
||||
This model is part a Dorsal Cochlear Nucleus Pyramidal point cell
|
||||
based on kinetic data from Kanold and Manis (1999) and Kanold's dissertation (1999)
|
||||
|
||||
-- 15 Jan 1999 P. Manis
|
||||
|
||||
Added export of start states for some variables to do perturbation tests
|
||||
These start values replace the "inf" values used in the initialization procedure
|
||||
Note that if the start variable is set to a value less than 0,
|
||||
then the default initialization will be done. Typically I use a value of -1 for this flagging
|
||||
Note also that it is possible to set the initial values > 1 but this is meaningless in terms of
|
||||
the present equations.
|
||||
-- 5 Feb 1999 P. Manis
|
||||
|
||||
Added Patrick's version of ih as ihpyr
|
||||
Model is from Destexhe and Babloyantz 1993; Destexhe et al. 1993
|
||||
|
||||
|
||||
2/10/02. P. Manis.
|
||||
7/23/2014 P. Manis - separated from pyr.mod.
|
||||
|
||||
7/23/2018 P. Manis - created "ihpyr_adj"
|
||||
ihpyr_adj has an adjustable q10 for fitting against experimental data
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
}
|
||||
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX ihpyr_adj
|
||||
USEION na READ ena WRITE ina
|
||||
USEION k READ ek WRITE ik
|
||||
NONSPECIFIC_CURRENT i
|
||||
: USEION h READ eh WRITE ih VALENCE 1
|
||||
RANGE eh
|
||||
:
|
||||
RANGE gh, kh_m_inf, kh_n_inf, aih, gbar, ghvshift
|
||||
RANGE kh_m_tau, kh_n_tau
|
||||
GLOBAL q10, q10f
|
||||
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius (degC)
|
||||
dt (ms)
|
||||
ek (mV) : = -81.5 (mV)
|
||||
ena (mV) : = 50.0 (mV)
|
||||
gbar = 0.00025 (mho/cm2) <0,1e9>
|
||||
ghvshift = 0 (mV)
|
||||
eh (mV) : = -43.0(mV)
|
||||
q10 = 3.0 (1)
|
||||
}
|
||||
|
||||
STATE {
|
||||
khm khn
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gh (mho/cm2)
|
||||
ina (mA/cm2)
|
||||
ik (mA/cm2)
|
||||
ih (mA/cm2)
|
||||
i (mA/cm2)
|
||||
kh_m_inf kh_n_inf
|
||||
kh_m_tau kh_n_tau
|
||||
aih
|
||||
q10f (1)
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
aih = khm*khn
|
||||
gh = gbar*aih
|
||||
ih = gh*(v - eh)
|
||||
i = ih
|
||||
}
|
||||
|
||||
UNITSOFF
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
khm = kh_m_inf
|
||||
khn = kh_n_inf
|
||||
}
|
||||
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
khm' = (kh_m_inf - khm) / kh_m_tau
|
||||
khn' = (kh_n_inf - khn) / kh_n_tau
|
||||
}
|
||||
|
||||
|
||||
: LOCAL q10f
|
||||
|
||||
PROCEDURE rates(v(mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
q10f = q10^((celsius - 22)/10 (degC))
|
||||
|
||||
:"kh" adaptation of Destexhe hyp-activated cation current by Patrick Kanold
|
||||
: adding q10 does not shift activation curves
|
||||
kh_m_inf = kh_m(v)
|
||||
kh_n_inf = kh_n(v)
|
||||
: adding the q10 just changes the rate for the taus (1/(a+b))
|
||||
kh_m_tau = kh_mt(v)/q10f
|
||||
kh_n_tau = kh_nt(v)/q10f
|
||||
}
|
||||
|
||||
: Make these as functions so we can view them from hoc, although this
|
||||
: may slow things down a bit
|
||||
|
||||
|
||||
FUNCTION kh_m(x (mV)) {
|
||||
kh_m = 1/(1+exp((x+68.9+ghvshift)/6.5))
|
||||
}
|
||||
|
||||
FUNCTION kh_n(x (mV)) {
|
||||
kh_n = 1/(1+exp((x+68.9+ghvshift)/6.5)) : same as kh_m, but for completeness, compute this
|
||||
}
|
||||
|
||||
FUNCTION kh_mt(v (mV)) {
|
||||
kh_mt = exp((v+183.6+ghvshift)/15.24)
|
||||
}
|
||||
|
||||
FUNCTION kh_nt(v (mV)) {
|
||||
kh_nt = exp((v+158.6+ghvshift)/11.2)/(1+exp((v+75+ghvshift)/5.5))
|
||||
}
|
||||
|
||||
|
||||
|
||||
155
cnmodel/mechanisms/ihsgc_apical.mod
Executable file
155
cnmodel/mechanisms/ihsgc_apical.mod
Executable file
@@ -0,0 +1,155 @@
|
||||
TITLE ihsgc-apical.mod - Spiral Ganglion Cell Ih current for Apical Region
|
||||
|
||||
COMMENT
|
||||
Ih for Spiral ganglion cells.
|
||||
Kinetcs are based on average fits to mouse SGCs,
|
||||
This model is for just the apical cell group.
|
||||
Data used to establish the kinetic parameters were collected by
|
||||
Qing Liu and Robin Davis (Rutgers).
|
||||
Data were taken at room temperature.
|
||||
Kinetic parameters were extracted by curve fitting for fast and
|
||||
slow components from activation and deactivation (using
|
||||
the program Ihfit4b.py).
|
||||
|
||||
Implementation by Paul B. Manis, January-April, 2012.
|
||||
Revised December 2013, January 2014.
|
||||
# of parameters in the fit were decreased (tau uses one v and scale factor).
|
||||
Parameters are shown in the tables in Liu et al., JARO 2014.
|
||||
|
||||
March 13, 2014: Corrected version with boltzmax for slow component
|
||||
July 2014: made threadsafe, changed solver
|
||||
|
||||
pmanis@med.unc.edu
|
||||
|
||||
Note: vshift parameter is nominally 0. This parameter can
|
||||
shift the entire activation and rate curves, keeping them
|
||||
in register for each component of the conductance.
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX ihsgcApical
|
||||
NONSPECIFIC_CURRENT i
|
||||
RANGE gbar, gh, ih, eh, vshift
|
||||
RANGE vh, k, vhs, ks
|
||||
RANGE rinf, rtau, sinf, stau
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius = 22 (degC)
|
||||
dt (ms)
|
||||
gbar = 0.00318 (mho/cm2) <0,1e9>
|
||||
eh = -41 (mV)
|
||||
|
||||
: Parameters from kinetic analysis
|
||||
: Format for NEURON MOD file:
|
||||
|
||||
: (Run on date = 2014-01-01 12:55:35.786524 )
|
||||
|
||||
: lmfit, Constrained model t(v) = DC + 1/(a * exp((v+vh)/k1) + a*exp(-(v+vh)/k2))
|
||||
: A. Fast component (Fast trace):
|
||||
|
||||
: Boltzmann:
|
||||
vh = -101.831 (mV)
|
||||
k = 12.431 (mV)
|
||||
vshift = 0.0 (mV)
|
||||
afast = 0.4225 : fraction that is fast.
|
||||
|
||||
: Tau
|
||||
taufac = 1.0 (1)
|
||||
taumin = 0 (ms)
|
||||
tausc1 = 0.00445778 (/ms) : (ms)
|
||||
vtau1 = 87.0705 (mV)
|
||||
kfac1 = 53.0338 (mV)
|
||||
kfac2 = 21.5365 (mV)
|
||||
|
||||
|
||||
: B. Slow component (Cyan trace):
|
||||
: (Run on date = 2014-01-01 12:55:35.786883 )
|
||||
|
||||
: Boltzmann:
|
||||
svh1 = -86.762 (mV)
|
||||
sk1 = 4.430 (mV) : double boltzmann
|
||||
svh2 = -115.227 (mV)
|
||||
sk2 = 9.675 (mV)
|
||||
svshift = 0.0 (mV)
|
||||
sba2 = 0.400557 : relative amplitude slow component 2 compared to slow 1 (slow2/(slow2+slow1))
|
||||
aslow = 0.5775 : total slow
|
||||
boltzmax = 0.5019571 : normalization factor
|
||||
: (computed numerically in Sage to make double boltz max = 1.0)
|
||||
|
||||
: stau
|
||||
staufac = 1.0 (1)
|
||||
staumin = 0 (ms)
|
||||
stausc1 = 0.00093656 (/ms) : (ms)
|
||||
svtau1 = 89.6097 (mV)
|
||||
skfac1 = 25.392 (mV)
|
||||
skfac2 = 26.4195 (mV)
|
||||
|
||||
}
|
||||
|
||||
STATE {
|
||||
r
|
||||
s
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gh (mho/cm2)
|
||||
i (mA/cm2)
|
||||
ih (mA/cm2)
|
||||
rinf
|
||||
rtau (ms)
|
||||
sinf
|
||||
stau (ms)
|
||||
q10 ()
|
||||
}
|
||||
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gh = gbar*(afast*(r^2)+aslow*s) : Balance between fast and slow determined by afast and aslow
|
||||
ih = gh*(v - eh)
|
||||
i = ih
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
q10 = 3.0^((celsius - 22.0)/10.0 (degC)) : adjust for temperature...
|
||||
rates(v)
|
||||
r = rinf
|
||||
s = sinf
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
r' = (rinf - r)/rtau
|
||||
s' = (sinf - s)/stau
|
||||
}
|
||||
|
||||
LOCAL rt, st
|
||||
PROCEDURE rates(v (mV)) { : Computes rate and activation at voltage = v.
|
||||
|
||||
: fast component - standard HH-like kinetics.
|
||||
rinf = 1.0 / (1+exp((v - vh + vshift) / k))^0.5
|
||||
rt = tausc1*exp((v + vtau1 + vshift) / kfac1) + tausc1*exp(-(v + vtau1 + vshift) / kfac2)
|
||||
rtau = (taumin + taufac/rt)
|
||||
|
||||
: slow component
|
||||
: double boltzman activation function (decreasing conductance), unequal sharing.
|
||||
sinf = 1. / (1 + exp((v - svh1 + vshift) / sk1))
|
||||
st = 1. / (1 + exp((v - svh2 + vshift) / sk2))
|
||||
sinf = (1-sba2)*sinf - sba2*st
|
||||
sinf = sinf/boltzmax : make sinf [0..1]
|
||||
stau = staufac / (stausc1*exp((v + svtau1 + vshift) / skfac1) + stausc1*exp(-(v + svtau1 + vshift) / skfac2))
|
||||
stau = (stau + staumin)
|
||||
}
|
||||
|
||||
154
cnmodel/mechanisms/ihsgc_basalmiddle.mod
Executable file
154
cnmodel/mechanisms/ihsgc_basalmiddle.mod
Executable file
@@ -0,0 +1,154 @@
|
||||
TITLE ihsgc-basalmiddle.mod - Spiral Ganglion Cell Ih current for basal and middle Regions
|
||||
|
||||
COMMENT
|
||||
Ih for Spiral ganglion cells.
|
||||
Kinetcs are based on average fits to mouse SGCs,
|
||||
This model is for the basal and middle cell groups (averaged).
|
||||
Data used to establish the kinetic parameters were collected by
|
||||
Qing Liu and Robin Davis (Rutgers).
|
||||
Data were taken at room temperature.
|
||||
Kinetic parameters were extracted by curve fitting for fast and
|
||||
slow components from activation and deactivation (using
|
||||
the program Ihfit4b.py).
|
||||
|
||||
Implementation by Paul B. Manis, January-April, 2012.
|
||||
Revised December 2013, January 2014.
|
||||
# of parameters in the fit were decreased (tau uses one v and scale factor).
|
||||
Parameters are shown in the tables in Liu et al., JARO 2014.
|
||||
|
||||
March 13, 2014: Corrected version with boltzmax for slow component
|
||||
July 2014: made threadsafe, changed solver
|
||||
|
||||
pmanis@med.unc.edu
|
||||
|
||||
Note: vshift parameter is nominally 0. This parameter can
|
||||
shift the entire activation and rate curves, keeping them
|
||||
in register for each component of the conductance.
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX ihsgcBasalMiddle
|
||||
NONSPECIFIC_CURRENT i
|
||||
RANGE gbar, gh, ih, eh, vshift
|
||||
RANGE vh, k, vhs, ks
|
||||
RANGE rinf, rtau, sinf, stau
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius = 22 (degC)
|
||||
dt (ms)
|
||||
gbar = 0.00318 (mho/cm2) <0,1e9>
|
||||
eh = -41 (mV)
|
||||
|
||||
: Parameters from kinetic analysis
|
||||
: Formatted for NEURON MOD file
|
||||
: (Run on date = 2014-01-01 12:52:22.776598 )
|
||||
|
||||
: lmfit, Constrained model t(v) = DC + 1/(a * exp((v+vh)/k1) + a*exp(-(v+vh)/k2))
|
||||
: A. Fast component (Fast trace):
|
||||
|
||||
: Boltzmann:
|
||||
vh = -105.298 (mV)
|
||||
k = 12.359 (mV)
|
||||
vshift = 0.0 (mV)
|
||||
afast = 0.4471 : fraction that is fast.
|
||||
|
||||
: Tau
|
||||
taufac = 1.0 (1)
|
||||
taumin = 0 (ms)
|
||||
tausc1 = 0.00417518 (/ms)
|
||||
vtau1 = 87.0836 (mV)
|
||||
kfac1 = 28.1667 (mV)
|
||||
kfac2 = 21.4809 (mV)
|
||||
|
||||
|
||||
: B. Slow component:
|
||||
: (Run on date = 2014-01-01 12:52:22.777259 )
|
||||
: Boltzmann:
|
||||
svh1 = -91.860 (mV)
|
||||
sk1 = 4.883 (mV) : double boltzmann
|
||||
svh2 = -110.209 (mV)
|
||||
sk2 = 3.927 (mV)
|
||||
svshift = 0.0 (mV)
|
||||
sba2 = 0.337216 : relative amplitude slow component 2 compared to slow 1 (slow2/(slow2+slow1))
|
||||
aslow = 0.5529 : total slow
|
||||
boltzmax = 0.5551729 : normalization factor
|
||||
: (computed numerically in Sage to make double boltz max = 1.0)
|
||||
|
||||
: stau
|
||||
staufac = 1.0 (1)
|
||||
staumin = 0 (ms)
|
||||
stausc1 = 0.00104354 (/ms)
|
||||
svtau1 = 105.816 (mV)
|
||||
skfac1 = 40.0291 (mV)
|
||||
skfac2 = 20.2273 (mV)
|
||||
|
||||
}
|
||||
|
||||
STATE {
|
||||
r
|
||||
s
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gh (mho/cm2)
|
||||
i (mA/cm2)
|
||||
ih (mA/cm2)
|
||||
rinf
|
||||
rtau (ms)
|
||||
sinf
|
||||
stau (ms)
|
||||
q10 ()
|
||||
}
|
||||
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gh = gbar*(afast*(r^2)+aslow*s) : Balance between fast and slow determined by afast and aslow
|
||||
ih = gh*(v - eh)
|
||||
i = ih
|
||||
}
|
||||
|
||||
|
||||
INITIAL {
|
||||
q10 = 3.0^((celsius - 22.0)/10.0 (degC)) : adjust for temperature...
|
||||
rates(v)
|
||||
r = rinf
|
||||
s = sinf
|
||||
}
|
||||
|
||||
DERIVATIVE states { : Updates state variables r and s
|
||||
rates(v) : at the current voltage
|
||||
r' = (rinf - r )/rtau
|
||||
s' = (sinf - s)/stau
|
||||
}
|
||||
|
||||
LOCAL rt, st
|
||||
PROCEDURE rates(v (mV)) { : Computes rate and activation at voltage = v.
|
||||
|
||||
: fast component - standard HH-like kinetics.
|
||||
rinf = 1.0 / (1+exp((v - vh + vshift) / k))^0.5
|
||||
rt = tausc1*exp((v + vtau1 + vshift) / kfac1) + tausc1*exp(-(v + vtau1 + vshift) / kfac2)
|
||||
rtau = (taumin + taufac/rt)
|
||||
|
||||
: slow component
|
||||
: double boltzman activation function (decreasing conductance), unequal sharing.
|
||||
sinf = 1. / (1 + exp((v - svh1 + vshift) / sk1))
|
||||
st = 1. / (1 + exp((v - svh2 + vshift) / sk2))
|
||||
sinf = (1-sba2)*sinf - sba2*st
|
||||
sinf = sinf/boltzmax : make sinf [0..1]
|
||||
|
||||
stau = staufac / (stausc1*exp((v + svtau1 + vshift) / skfac1) + stausc1*exp(-(v + svtau1 + vshift) / skfac2))
|
||||
stau = (stau + staumin)
|
||||
}
|
||||
79
cnmodel/mechanisms/ihvcn.mod
Normal file
79
cnmodel/mechanisms/ihvcn.mod
Normal file
@@ -0,0 +1,79 @@
|
||||
TITLE jsr.mod VCN conductances
|
||||
|
||||
COMMENT
|
||||
Ih for VCN neurons - average from several studies in auditory neurons
|
||||
|
||||
Implementation by Paul B. Manis, April (JHU) and Sept, (UNC)1999.
|
||||
revised 2/28/04 pbm
|
||||
|
||||
pmanis@med.unc.edu
|
||||
|
||||
Modifed implementation; includes all temperature scaling, passes modlunit
|
||||
7/10/2014 pbm
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX ihvcn
|
||||
NONSPECIFIC_CURRENT i
|
||||
RANGE gbar, gh, i, eh
|
||||
GLOBAL rinf, rtau
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
dt (ms)
|
||||
gbar = 0.00318 (mho/cm2) <0,1e9>
|
||||
q10tau = 3.0
|
||||
}
|
||||
|
||||
STATE {
|
||||
r
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
celsius (degC)
|
||||
gh (mho/cm2)
|
||||
eh (mV)
|
||||
i (mA/cm2)
|
||||
rinf
|
||||
rtau (ms)
|
||||
q10 ()
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
|
||||
gh = gbar*r
|
||||
i = gh*(v - eh)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
q10 = q10tau^((celsius - 22)/10 (degC)) : if you don't like room temp, it can be changed!
|
||||
rates(v)
|
||||
r = rinf
|
||||
}
|
||||
|
||||
DERIVATIVE states { :Computes state variables m, h, and n
|
||||
rates(v) : at the current v and dt.
|
||||
r' = (rinf - r)/rtau
|
||||
}
|
||||
|
||||
PROCEDURE rates(v (mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
|
||||
rinf = 1 / (1+exp((v + 76) / 7 (mV)))
|
||||
rtau = (100000 (ms)/ (237*exp((v+60) / 12 (mV)) + 17*exp(-(v+60) / 14 (mV)))) + 25
|
||||
rtau = rtau/q10
|
||||
|
||||
}
|
||||
|
||||
188
cnmodel/mechanisms/inav11.mod
Executable file
188
cnmodel/mechanisms/inav11.mod
Executable file
@@ -0,0 +1,188 @@
|
||||
:
|
||||
: ichanWT2005.mod
|
||||
:
|
||||
: Alan Goldin Lab, University of California, Irvine
|
||||
: Jay Lickfett - Last Modified: 6 July 2005
|
||||
:
|
||||
: This file is the Nav1.1 wild-type channel model described in:
|
||||
:
|
||||
: Barela et al. An Epilepsy Mutation in the Sodium Channel SCN1A That Decreases
|
||||
: Channel Excitability. J. Neurosci. 26(10): p. 2714-2723
|
||||
:
|
||||
:
|
||||
: The model is derived from the one described in:
|
||||
:
|
||||
: Spampanato et al. (2004a) Increased Neuronal Firing in Computer Simulations
|
||||
: of Sodium Channel Mutations that Cause Generalized Epilepsy with Febrile Seizures Plus.
|
||||
: Journal of Neurophysiology 91:2040-2050
|
||||
:
|
||||
: and
|
||||
:
|
||||
: Spampanato et al. (2004b) A Novel Epilepsy Mutation
|
||||
: in the Sodium Channel SCN1A Identifies a Cytoplasmic Domain for
|
||||
: Beta Subunit Interaction. J. Neurosci. 24(44):10022-10034
|
||||
:
|
||||
|
||||
: delayed rectifier removed (p.b.manis 2/22/2009)
|
||||
|
||||
|
||||
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(uF) = (microfarad)
|
||||
(molar) = (1/liter)
|
||||
(nA) = (nanoamp)
|
||||
(mM) = (millimolar)
|
||||
(um) = (micron)
|
||||
(S) = (siemens)
|
||||
FARADAY = 96520 (coul)
|
||||
R = 8.3134 (joule/degC)
|
||||
|
||||
}
|
||||
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX nav11
|
||||
USEION na READ ena WRITE ina VALENCE 1
|
||||
RANGE gna
|
||||
RANGE gbar
|
||||
RANGE minf, mtau, hinf, htau, sinf, stau, inat, m, h, s
|
||||
RANGE vsna : voltage shift parameter
|
||||
}
|
||||
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 100 WITH 100 (ms)}
|
||||
|
||||
|
||||
PARAMETER {
|
||||
vsna = 4.3 (mV)
|
||||
celsius (degC)
|
||||
dt (ms)
|
||||
ena (mV)
|
||||
:enat = 50 (mV)
|
||||
gbar = 0.1 (mho/cm2)
|
||||
q10 = 3.0 (1)
|
||||
}
|
||||
|
||||
|
||||
ASSIGNED {
|
||||
|
||||
v (mV)
|
||||
gna (mho/cm2)
|
||||
ina (mA/cm2)
|
||||
minf hinf sinf
|
||||
mtau (ms) htau (ms) stau (ms)
|
||||
mexp hexp sexp
|
||||
: vsna (mV)
|
||||
}
|
||||
|
||||
|
||||
STATE {
|
||||
m h s
|
||||
}
|
||||
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gna = gbar*m*m*m*h*s
|
||||
ina = gna*(v - ena)
|
||||
}
|
||||
|
||||
|
||||
UNITSOFF
|
||||
|
||||
|
||||
INITIAL {
|
||||
|
||||
trates(v)
|
||||
|
||||
m = minf
|
||||
h = hinf
|
||||
s = sinf
|
||||
|
||||
}
|
||||
|
||||
|
||||
DERIVATIVE states { : Computes state variables m, h, s and n
|
||||
: at the current v and dt.
|
||||
rates(v)
|
||||
m' = (minf - m)/mtau
|
||||
h' = (hinf - h)/htau
|
||||
s' = (sinf - s)/stau
|
||||
|
||||
}
|
||||
|
||||
|
||||
LOCAL qt
|
||||
|
||||
|
||||
PROCEDURE rates(v (mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
|
||||
LOCAL alpha, beta, sum
|
||||
qt = q10^((celsius - 22)/10) : original recordings in Barela et al made at "room temperature"
|
||||
|
||||
|
||||
: "m" sodium activation system
|
||||
minf = f_minf(v)
|
||||
mtau = f_mtau(v)/qt
|
||||
|
||||
: "h" sodium fast inactivation system
|
||||
hinf = f_hinf(v)
|
||||
htau = f_htau(v)/qt
|
||||
|
||||
: "s" sodium slow inactivation system
|
||||
sinf = f_sinf(v)
|
||||
stau = f_stau(v)/qt
|
||||
|
||||
}
|
||||
|
||||
|
||||
PROCEDURE trates(v (mV)) { :Build table with rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
LOCAL tinc
|
||||
|
||||
TABLE minf, mexp, hinf, hexp, sinf, sexp, mtau, htau, stau
|
||||
DEPEND dt, celsius FROM -100 TO 100 WITH 200
|
||||
|
||||
rates(v) : not consistently executed from here if usetable_hh == 1
|
||||
: so don't expect the tau values to be tracking along with
|
||||
: the inf values in hoc
|
||||
|
||||
tinc = -dt : * q10 q10 is handled in rates, above
|
||||
mexp = 1 - exp(tinc/mtau)
|
||||
hexp = 1 - exp(tinc/htau)
|
||||
sexp = 1 - exp(tinc/stau)
|
||||
}
|
||||
|
||||
FUNCTION f_minf(v (mV)) {
|
||||
f_minf = 1/(1+exp(-(v+27.4+vsna)*4.7*0.03937))
|
||||
|
||||
}
|
||||
FUNCTION f_mtau(v (mV)) {
|
||||
f_mtau = 0.15
|
||||
}
|
||||
|
||||
FUNCTION f_hinf(v (mV)) {
|
||||
f_hinf = 1/(1+exp((v+41.9+vsna)/6.7))
|
||||
}
|
||||
|
||||
FUNCTION f_htau(v (mV)) {
|
||||
f_htau = 23.12*exp(-0.5*((v+77.58+vsna)/43.92)^2)
|
||||
}
|
||||
|
||||
|
||||
FUNCTION f_sinf(v (mV)) {
|
||||
f_sinf = 1/(1+exp((v+46.0+vsna)/6.6))
|
||||
}
|
||||
|
||||
FUNCTION f_stau(v (mV)) {
|
||||
f_stau = 1000*140.4*exp(-0.5*((v+71.3+vsna)/30.9)^2)
|
||||
}
|
||||
|
||||
|
||||
UNITSON
|
||||
|
||||
136
cnmodel/mechanisms/jsrnaf.mod
Normal file
136
cnmodel/mechanisms/jsrnaf.mod
Normal file
@@ -0,0 +1,136 @@
|
||||
TITLE jsrnaf.mod VCN Na conductance, fast model
|
||||
|
||||
COMMENT
|
||||
gnaf is the modified form used in his
|
||||
1993 M.S. thesis (as in Rothman et al., J. Neurophysiol. 70:2562, 1993),
|
||||
with rapid recovery from inactivation for potentials below rest.
|
||||
|
||||
Implementation by Paul B. Manis, April and Sept, 1999.
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
? interface
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX jsrna
|
||||
USEION na READ ena WRITE ina
|
||||
RANGE gbar
|
||||
RANGE gna, vsna
|
||||
RANGE minf, hinf, mtau, htau
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
dt (ms)
|
||||
ena = 55 (mV)
|
||||
gbar = 0.25 (mho/cm2) <0,1e9>
|
||||
vsna = 0 (mV)
|
||||
q10 = 3.0 (1)
|
||||
}
|
||||
|
||||
STATE {
|
||||
m h
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gna (mho/cm2)
|
||||
ina (mA/cm2)
|
||||
minf hinf
|
||||
mtau (ms) htau (ms)
|
||||
celsius (degC)
|
||||
}
|
||||
|
||||
LOCAL mexp, hexp
|
||||
|
||||
? currents
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gna = gbar*(m^3)*h
|
||||
ina = gna*(v - ena)
|
||||
}
|
||||
|
||||
UNITSOFF
|
||||
|
||||
INITIAL {
|
||||
trates(v)
|
||||
m = minf
|
||||
h = hinf
|
||||
}
|
||||
|
||||
DERIVATIVE states { :Computes state variables m, h, and n
|
||||
trates(v) : at the current v and dt.
|
||||
m' = (minf - m)/mtau
|
||||
h' = (hinf - h)/htau
|
||||
}
|
||||
|
||||
LOCAL qt
|
||||
|
||||
PROCEDURE rates(v (mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
LOCAL alpha, beta, sum
|
||||
|
||||
qt = q10^((celsius - 22)/10 (degC)) : R&M'03 used 3
|
||||
|
||||
: Note qt temperature here cancels in minf (a/(a+b))
|
||||
:"m" sodium activation system - JSR
|
||||
alpha = -0.36*qt*vtrap((v+49),-3)
|
||||
beta = 0.4*qt*vtrap((v+58),20)
|
||||
sum = alpha + beta
|
||||
mtau = 1/sum
|
||||
minf = alpha/sum
|
||||
|
||||
:"h" sodium inactivation system - JSR
|
||||
alpha = 2.4*qt/(1+exp((v+68-vsna)/3 (mV))) + 0.8*qt/(1+exp(v+61.3-vsna))
|
||||
beta = 3.6*qt/(1+exp(-(v+21-vsna)/10 (mV)))
|
||||
sum = alpha + beta
|
||||
htau = 1/sum
|
||||
hinf = alpha/sum
|
||||
|
||||
|
||||
|
||||
|
||||
: jsr modified sodium channel - defined in terms of alpha and beta this time
|
||||
: am = (0.36*q10*(v+49))/(1-exp(-((v+49)/3)))
|
||||
: am = -(0.36*q10*vtrap(-(v+49),3))
|
||||
: bm = -(0.40*q10*(v+58))/(1-exp((v+58)/20))
|
||||
: bm = (0.40*q10*vtrap((v+58),20))
|
||||
: ah = ((2.4*q10)/(1+exp((v+68)/3))) + (0.8*qten/(1+exp(v+61.3)))
|
||||
: bh = (3.6*q10)/(1+exp(-(v+21)/10))
|
||||
|
||||
: minf = am/(am+bm)
|
||||
: hinf = ah/(ah+bh)
|
||||
|
||||
: mtau = 1/(am+bm)
|
||||
: htau = 1/(ah+bh)
|
||||
|
||||
}
|
||||
|
||||
PROCEDURE trates(v (mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
LOCAL tinc
|
||||
|
||||
rates(v) : not consistently executed from here if usetable_hh == 1
|
||||
: so don't expect the tau values to be tracking along with
|
||||
: the inf values in hoc
|
||||
|
||||
tinc = -dt : * q10 # handled in rates now
|
||||
mexp = 1 - exp(tinc/mtau)
|
||||
hexp = 1 - exp(tinc/htau)
|
||||
}
|
||||
|
||||
FUNCTION vtrap(x,y) { :Traps for 0 in denominator of rate eqns.
|
||||
if (fabs(x/y) < 1e-6) {
|
||||
vtrap = y*(1 - x/y/2)
|
||||
}else{
|
||||
vtrap = x/(exp(x/y) - 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
104
cnmodel/mechanisms/ka.mod
Normal file
104
cnmodel/mechanisms/ka.mod
Normal file
@@ -0,0 +1,104 @@
|
||||
TITLE klt.mod The low threshold conductance of cochlear nucleus neurons
|
||||
|
||||
COMMENT
|
||||
|
||||
NEURON implementation of Jason Rothman's measurements of VCN conductances.
|
||||
|
||||
This file implements the transient potassium current found in ventral cochlear
|
||||
nucleus "Type I" cells, which are largely "stellate" or "multipolar" cells (Manis and
|
||||
Marx, 1991; Rothman and Manis, 2003a,b; Manis et al, 1996). The current is likely
|
||||
mediated by Kv4.2 potassium channel subunits, but this has not been directly
|
||||
demonstrated. The specific implementation is described in Rothman and Manis, J.
|
||||
Neurophysiol. 2003, in the appendix. Measurements were made from isolated
|
||||
neurons from adult guinea pig, under reasonably stringent voltage clamp conditions.
|
||||
The measured current is sensitive to 4-aminopyridine.
|
||||
Original implementation by Paul B. Manis, April (JHU) and Sept, (UNC)1999.
|
||||
|
||||
File split implementaiton, April 1, 2004.
|
||||
|
||||
Contact: pmanis@med.unc.edu
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX ka
|
||||
USEION k READ ek WRITE ik
|
||||
RANGE gbar, gka, ik
|
||||
GLOBAL ainf, binf, cinf, atau, btau, ctau
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
dt (ms)
|
||||
gbar = 0.00477 (mho/cm2) <0,1e9>
|
||||
q10tau = 3.0
|
||||
q10g = 2.0
|
||||
}
|
||||
|
||||
STATE {
|
||||
a b c
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
celsius (degC) : model is defined on measurements made at room temp in Baltimore
|
||||
ik (mA/cm2)
|
||||
ek (mV)
|
||||
gka (mho/cm2)
|
||||
ainf binf cinf
|
||||
atau (ms) btau (ms) ctau (ms)
|
||||
qg () : computed q10 for gnabar based on q10g
|
||||
q10 ()
|
||||
}
|
||||
|
||||
LOCAL aexp, bexp, cexp
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
|
||||
gka = gbar*(a^4)*b*c
|
||||
ik = gka*(v - ek)
|
||||
|
||||
}
|
||||
|
||||
|
||||
INITIAL {
|
||||
qg = q10g^((celsius-22)/10 (degC))
|
||||
q10 = q10tau^((celsius - 22)/10 (degC)) : if you don't like room temp, it can be changed!
|
||||
rates(v)
|
||||
a = ainf
|
||||
b = binf
|
||||
c = cinf
|
||||
}
|
||||
|
||||
DERIVATIVE states { :Computes state variables m, h, and n
|
||||
rates(v) : at the current v and dt.
|
||||
a' = (ainf - a)/atau
|
||||
b' = (binf - b)/btau
|
||||
c' = (cinf - c)/ctau
|
||||
}
|
||||
|
||||
|
||||
PROCEDURE rates(v (mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
|
||||
ainf = (1 / (1 + exp(-1*(v + 31) / 6 (mV))))^0.25
|
||||
binf = 1 / (1 + exp((v + 66) / 7 (mV)))^0.5
|
||||
cinf = 1 / (1 + exp((v + 66) / 7 (mV)))^0.5
|
||||
|
||||
atau = (100 (ms)/ (7*exp((v+60) / 14 (mV)) + 29*exp(-(v+60) / 24 (mV)))) + 0.1
|
||||
atau = atau/q10
|
||||
btau = (1000 (ms) / (14*exp((v+60) / 27 (mV)) + 29*exp(-(v+60) / 24 (mV)))) + 1
|
||||
btau = btau/q10
|
||||
ctau = (90 (ms)/ (1 + exp((-66-v) / 17 (mV)))) + 10
|
||||
ctau = ctau/q10
|
||||
}
|
||||
|
||||
72
cnmodel/mechanisms/kcnq.mod
Normal file
72
cnmodel/mechanisms/kcnq.mod
Normal file
@@ -0,0 +1,72 @@
|
||||
TITLE KCNQ potassium channel for GPe neuron
|
||||
|
||||
COMMENT
|
||||
modeled by Gunay et al., 2008
|
||||
implemented in NEURON by Kitano, 2011
|
||||
Threadsafe and unit checking, P.B. Manis, 2014
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mV) = (millivolt)
|
||||
(mA) = (milliamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX kcnq
|
||||
USEION k READ ek WRITE ik
|
||||
RANGE gbar, gk, iKCNQ
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
dt (ms)
|
||||
gbar = 0.001 (mho/cm2)
|
||||
iKCNQ = 0.0 (mA/cm2)
|
||||
ek (mV)
|
||||
|
||||
theta_m = -61.0 (mV)
|
||||
k_m = 19.5 (mV)
|
||||
tau_m0 = 6.7 (ms)
|
||||
tau_m1 = 100.0 (ms)
|
||||
phi_m = -61.0 (mV)
|
||||
sigma_m0 = 35.0 (mV)
|
||||
sigma_m1 = -25.0 (mV)
|
||||
}
|
||||
|
||||
STATE {
|
||||
m
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
ik (mA/cm2)
|
||||
gk (mho/cm2)
|
||||
minf
|
||||
taum (ms)
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gk = gbar*m*m*m*m
|
||||
ik = gk * (v-ek)
|
||||
iKCNQ = ik
|
||||
}
|
||||
|
||||
|
||||
INITIAL {
|
||||
settables(v)
|
||||
m = minf
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
settables(v)
|
||||
m' = (minf - m)/taum
|
||||
}
|
||||
|
||||
PROCEDURE settables(v (mV)) {
|
||||
TABLE minf, taum FROM -100 TO 100 WITH 400
|
||||
|
||||
minf = 1.0 / (1.0 + exp((theta_m - v)/k_m))
|
||||
taum = tau_m0 + (tau_m1 - tau_m0)/(exp((phi_m - v)/sigma_m0) + exp((phi_m - v)/sigma_m1))
|
||||
}
|
||||
92
cnmodel/mechanisms/kdpyr.mod
Normal file
92
cnmodel/mechanisms/kdpyr.mod
Normal file
@@ -0,0 +1,92 @@
|
||||
TITLE kdpyr.mod DCN pyramidal cell model, delayed rectifier
|
||||
|
||||
COMMENT
|
||||
|
||||
This is part of a model implements a Dorsal Cochlear Nucleus Pyramidal point cell
|
||||
based on kinetic data from Kanold and Manis (1999) and Kanold's dissertation (1999)
|
||||
|
||||
-- 15 Jan 1999 P. Manis
|
||||
|
||||
Added export of start states for some variables to do perturbation tests
|
||||
These start values replace the "inf" values used in the initialization procedure
|
||||
Note that if the start variable is set to a value less than 0,
|
||||
then the default initialization will be done. Typically I use a value of -1 for this flagging
|
||||
Note also that it is possible to set the initial values > 1 but this is meaningless in terms of
|
||||
the present equations.
|
||||
-- 5 Feb 1999 P. Manis
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX kdpyr
|
||||
USEION k READ ek WRITE ik
|
||||
RANGE gbar, gk : delayed rectifier
|
||||
RANGE ntau: time constants delayed rectifier
|
||||
RANGE kd_avh
|
||||
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius (degC)
|
||||
dt (ms)
|
||||
ek (mV) : = -81.5 (mV)
|
||||
gbar = 0.006667 (mho/cm2) <0,1e9>
|
||||
ntau = 0.5 (ms) <0.1,100>
|
||||
kd_avh = -40 (mV)
|
||||
}
|
||||
|
||||
STATE {
|
||||
n
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gk (mho/cm2)
|
||||
ik (mA/cm2)
|
||||
ninf
|
||||
}
|
||||
|
||||
LOCAL nexp
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gk = gbar*n*n
|
||||
ik = gk*(v - ek)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
n = ninf
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
n' = (ninf - n) / ntau
|
||||
}
|
||||
|
||||
LOCAL q10
|
||||
|
||||
PROCEDURE rates(v(mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
LOCAL alpha, beta, sum
|
||||
TABLE ninf, ntau DEPEND celsius FROM -200 TO 100 WITH 400
|
||||
|
||||
q10 = 3^((celsius - 22)/10 (degC))
|
||||
: "n" potassium activation system
|
||||
ninf = kd_m(v)
|
||||
}
|
||||
|
||||
: Make these as functions so we can view them from hoc, although this
|
||||
: may slow things down a bit
|
||||
FUNCTION kd_m(x (mV)) { : potassium activation
|
||||
kd_m = 1/(1+exp(-(x-kd_avh)/(3 (mV)))) : flat time constants
|
||||
}
|
||||
|
||||
111
cnmodel/mechanisms/kht.mod
Normal file
111
cnmodel/mechanisms/kht.mod
Normal file
@@ -0,0 +1,111 @@
|
||||
TITLE kht.mod The high threshold conductance of cochlear nucleus neurons
|
||||
|
||||
COMMENT
|
||||
|
||||
NEURON implementation of Jason Rothman's measurements of VCN conductances.
|
||||
|
||||
This file implements the high threshold potassium current found in several brainstem
|
||||
nuclei of the auditory system, including the spherical and globular bushy cells
|
||||
(Manis and Marx, 1991; Rothman and Manis, 2003a,b) and multipolar (stellate)
|
||||
cells of the ventral cochlear nucleus, principal cells of the medial
|
||||
nucleus of the trapzoid body (Brew and Forsythe, 1995, Wang and Kaczmarek,
|
||||
1997) and neurons of the medial superior olive. The current is likely mediated by
|
||||
Kv3.1 potassium channel subunits. The specific
|
||||
implementation is described in Rothman and Manis, J. Neurophysiol. 2003, in the
|
||||
appendix. Measurements were made from isolated neurons from adult guinea pig,
|
||||
under reasonably stringent voltage clamp conditions. The measured current is
|
||||
sensitive to 4-aminopyridine and TEA, but is spared by mamba snake toxi
|
||||
dendrotoxin I.
|
||||
|
||||
|
||||
Similar conductrances are found in the homologous neurons of the avian auditory
|
||||
system (Reyes and Rubel; Zhang and Trussell; Rathouz and Trussell), and the
|
||||
conductance described here, in the absence of more detailed kinetic measurements
|
||||
, is probably suitable for use in modeling that system.
|
||||
|
||||
|
||||
Original implementation by Paul B. Manis, April (JHU) and Sept, (UNC)1999.
|
||||
|
||||
File split implementation, February 28, 2004.
|
||||
|
||||
Contact: pmanis@med.unc.edu
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX kht
|
||||
USEION k READ ek WRITE ik
|
||||
RANGE gbar, gkht, ik, q10g
|
||||
GLOBAL ninf, pinf, ntau, ptau
|
||||
}
|
||||
|
||||
:INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
ASSIGNED {
|
||||
celsius (degC) : model is defined on measurements made at room temp in Baltimore: 22 degC
|
||||
ik (mA/cm2)
|
||||
ek (mV)
|
||||
gkht (mho/cm2)
|
||||
pinf ninf
|
||||
ptau (ms)
|
||||
ntau (ms)
|
||||
qg () : computed q10 for gnabar based on q10g
|
||||
q10 ()
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
dt (ms)
|
||||
gbar = 0.01592 (mho/cm2) <0,1e9>
|
||||
nf = 0.85 <0,1> :proportion of n vs p kinetics
|
||||
q10tau = 3.0
|
||||
q10g = 2.0
|
||||
}
|
||||
|
||||
STATE {
|
||||
n p
|
||||
}
|
||||
|
||||
LOCAL nexp, pexp
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
|
||||
gkht = qg*gbar*(nf*(n^2) + (1-nf)*p)
|
||||
ik = gkht*(v - ek)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
qg = q10g^((celsius-22)/10 (degC))
|
||||
q10 = q10tau^((celsius - 22)/10 (degC))
|
||||
rates(v)
|
||||
p = pinf
|
||||
n = ninf
|
||||
}
|
||||
|
||||
DERIVATIVE states { :Computes state variables m, h, and n
|
||||
rates(v) : at the current v and dt.
|
||||
n' = (ninf - n)/ntau
|
||||
p' = (pinf - p)/ptau
|
||||
}
|
||||
|
||||
PROCEDURE rates(v (mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
|
||||
ninf = (1 + exp(-(v + 15) / 5 (mV)))^-0.5
|
||||
pinf = 1 / (1 + exp(-(v + 23) / 6 (mV)))
|
||||
|
||||
ntau = (100 (ms)/ (11*exp((v+60) / 24 (mV)) + 21*exp(-(v+60) / 23 (mV)))) + 0.7
|
||||
ntau = ntau/q10
|
||||
ptau = (100 (ms)/ (4*exp((v+60) / 32 (mV)) + 5*exp(-(v+60) / 22 (mV)))) + 5
|
||||
ptau = ptau/q10
|
||||
|
||||
}
|
||||
|
||||
|
||||
128
cnmodel/mechanisms/kif.mod
Normal file
128
cnmodel/mechanisms/kif.mod
Normal file
@@ -0,0 +1,128 @@
|
||||
TITLE kif.mod DCN pyramidal cell model fast transient current
|
||||
|
||||
COMMENT
|
||||
|
||||
This model implements a fast transient potassium current from
|
||||
Dorsal Cochlear Nucleus Pyramidal cells
|
||||
based on kinetic data from Kanold and Manis (1999) and Kanold's dissertation (1999)
|
||||
-- 15 Jan 1999 P. Manis
|
||||
2/10/02. P. Manis.
|
||||
Pulled from pyr.mod 7/24/2014
|
||||
ENDCOMMENT
|
||||
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
SUFFIX kif
|
||||
USEION k READ ek WRITE ik
|
||||
|
||||
RANGE gkif, kif_a_inf, kif_i_inf : fast inactivating potassium current
|
||||
RANGE akif, gbar
|
||||
RANGE kif_a_tau, kif_i_tau
|
||||
RANGE kif_a_start, kif_i_start
|
||||
RANGE kif_ivh, kif_avh, kif_hivh
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius (degC)
|
||||
dt (ms)
|
||||
ek (mV) : = -81.5 (mV)
|
||||
ena (mV) : = 50.0 (mV)
|
||||
gbar = 0.0125 (mho/cm2) <0,1e9>
|
||||
|
||||
kif_ivh = -89.6 (mV)
|
||||
kif_avh = -57.0 (mV)
|
||||
kif_hivh = -87.0 (mV)
|
||||
kif_a_start = -1 (1)
|
||||
kif_i_start = -1 (1)
|
||||
}
|
||||
|
||||
STATE {
|
||||
kifa kifi
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gkif (mho/cm2)
|
||||
ik (mA/cm2)
|
||||
kif_a_inf (1)
|
||||
kif_i_inf (1)
|
||||
kif_a_tau (ms)
|
||||
kif_i_tau (ms)
|
||||
akif ()
|
||||
q10 ()
|
||||
}
|
||||
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
akif = kifa*kifa*kifa*kifa*kifi
|
||||
gkif = gbar*akif
|
||||
ik = gkif*(v - ek)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
q10 = 3^((celsius - 22)/10 (degC))
|
||||
rates(v)
|
||||
if(kif_a_start < 0) { : if xx_(i/a)_start is > 0, then perturbation is done at onset of computations.
|
||||
kifa = kif_a_inf
|
||||
} else {
|
||||
kifa = kif_a_start
|
||||
}
|
||||
if(kif_i_start < 0) {
|
||||
kifi = kif_i_inf
|
||||
} else {
|
||||
kifi = kif_i_start
|
||||
}
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
kifa' = (kif_a_inf - kifa) / kif_a_tau
|
||||
kifi' = (kif_i_inf - kifi) / kif_i_tau
|
||||
}
|
||||
|
||||
|
||||
PROCEDURE rates(v(mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
: LOCAL alpha, beta, sum
|
||||
: TABLE kif_a_inf, kif_a_tau, kif_i_inf, kif_i_tau DEPEND celsius, kif_avh, kif_ivh FROM -200 TO 100 WITH 400
|
||||
: "kif" fast inactivation potassium channel - activation and inactivation
|
||||
kif_a_inf = kif_m(v)
|
||||
kif_i_inf = kif_h(v)
|
||||
kif_a_tau = kif_mt(v)
|
||||
kif_i_tau = kif_ht(v)
|
||||
}
|
||||
|
||||
: Make these as functions so we can view them from hoc, although this
|
||||
: may slow things down a bit
|
||||
|
||||
FUNCTION kif_m(v ) { : ikif activation
|
||||
kif_m = 1.0/(1+exp(-(v-kif_avh)/25.8 (mV)))
|
||||
}
|
||||
|
||||
FUNCTION kif_h(v (mV)) { : ikif inactivation
|
||||
kif_h = 1.0/(1+exp((v-kif_ivh)/6.7 (mV)))
|
||||
}
|
||||
|
||||
FUNCTION kif_mt(v (mV)) (ms) { : ikif activation tau
|
||||
LOCAL x
|
||||
x = 0.15 * exp((v-kif_avh)/10 (mV)) + 0.3 *exp(-(v-kif_avh)/10 (mV))
|
||||
x = 0.5 + (1.0 /x)
|
||||
kif_mt = (x * 1.0 (ms))/q10
|
||||
}
|
||||
|
||||
FUNCTION kif_ht(v (mV)) (ms) { : ikif inactivation tau
|
||||
LOCAL x
|
||||
x = 0.015 * exp((v-kif_hivh)/20 (mV))+0.03*exp(-(v-kif_hivh)/20 (mV))
|
||||
x = 10 + (1./x)
|
||||
kif_ht = (x * 1.0 (ms)) /q10
|
||||
}
|
||||
|
||||
|
||||
108
cnmodel/mechanisms/kir.mod
Executable file
108
cnmodel/mechanisms/kir.mod
Executable file
@@ -0,0 +1,108 @@
|
||||
TITLE KIR channel
|
||||
COMMENT
|
||||
Reference: Steephen JE, Manchanda R (2009) Differences in biophysical
|
||||
properties of nucleus accumbens medium spiny neurons emerging from
|
||||
inactivation of inward rectifying potassium currents. J Comput Neurosci [PubMed]
|
||||
|
||||
Found on ModelDB, 1/21/2013 PBManis
|
||||
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
NEURON {
|
||||
SUFFIX KIR
|
||||
USEION k READ ek WRITE ik
|
||||
RANGE g, ik, gbar
|
||||
GLOBAL minf, mtau
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(uA) = (microamp)
|
||||
(mV) = (millivolt)
|
||||
(mS) = (millimho)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
celsius (degC)
|
||||
ek (mV)
|
||||
gbar = 1.4e-4 (mho/cm2) <0,1e9>
|
||||
m_vh = -82 (mV) : half activation
|
||||
m_ve = 13 (mV) : slope
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
v (mV)
|
||||
g (mho/cm2)
|
||||
ik (mA/cm2)
|
||||
minf (1)
|
||||
mtau (ms)
|
||||
qt (1)
|
||||
}
|
||||
|
||||
STATE {
|
||||
m
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
g = gbar*m
|
||||
ik = g*(v - ek)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
qt = 3^((celsius-35)/10)
|
||||
rates(v)
|
||||
m = minf
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
m' = (minf-m)/mtau
|
||||
}
|
||||
|
||||
FUNCTION_TABLE tabmtau(v(mV)) (ms)
|
||||
|
||||
: rates() computes rate and other constants at present v
|
||||
: call once from hoc to initialize inf at resting v
|
||||
|
||||
PROCEDURE rates(v(mV)) {
|
||||
: mtau = tabmtau(v)
|
||||
mtau = tabmtau(v)/qt
|
||||
minf = 1/(1 + exp((v - m_vh)/m_ve))
|
||||
}
|
||||
|
||||
COMMENT
|
||||
/* TABLES
|
||||
The tables here are built as vecs in hoc, and then loaded into the mod file arrays before use...
|
||||
|
||||
*
|
||||
* Steephen, J. E., & Manchanda, R. (2009). Differences in biophysical properties of nucleus accumbens medium spiny neurons emerging from inactivation of inward rectifying potassium currents. J Comput Neurosci,
|
||||
* doi:10.1007/s10827-009-0161-7
|
||||
*/
|
||||
|
||||
//KIR
|
||||
objref vecmtau_KIR, vecv_KIR
|
||||
vecmtau_KIR = new Vector()
|
||||
vecv_KIR = new Vector()
|
||||
vecv_KIR.indgen(-120, 0, 10)
|
||||
vecmtau_KIR.append(7.465, 7.465, 7.465, 8, 9.435, 10.755, 12.12, 13.795, 15.385, 14.285, 11.765, 8.89, 8) // At 35 deg C
|
||||
table_tabmtau_KIR(&vecmtau_KIR.x[0], vecv_KIR.size, &vecv_KIR.x[0])
|
||||
|
||||
//inKIR
|
||||
objref vecv_inKIR, vechinf_inKIR, vechtau_inKIR, vecv_tau_inKIR
|
||||
vecv_tau_inKIR = new Vector()
|
||||
vechtau_inKIR= new Vector()
|
||||
vecv_tau_inKIR.append(-120,-90, -50)
|
||||
vechtau_inKIR.append(7.767, 15, 25.333) // At 35 deg C
|
||||
table_tabhtau_inKIR(&vechtau_inKIR.x[0],vecv_tau_inKIR.size, &vecv_tau_inKIR.x[0])
|
||||
|
||||
vecv_inKIR = new Vector()
|
||||
vechinf_inKIR = new Vector()
|
||||
vecv_inKIR.append(-120,-90, -50)
|
||||
vechinf_inKIR.append(0, 0.13, 1)
|
||||
table_tabhinf_inKIR(&vechinf_inKIR.x[0], vecv_inKIR.size, &vecv_inKIR.x[0])
|
||||
table_tabmtau_inKIR(&vecmtau_KIR.x[0], vecv_KIR.size, &vecv_KIR.x[0])
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
123
cnmodel/mechanisms/kis.mod
Normal file
123
cnmodel/mechanisms/kis.mod
Normal file
@@ -0,0 +1,123 @@
|
||||
TITLE kis.mod DCN pyramidal cell model Slow transient K current
|
||||
|
||||
COMMENT
|
||||
|
||||
|
||||
This model implements the slow transient potassium current from
|
||||
Dorsal Cochlear Nucleus Pyramidal cells
|
||||
based on kinetic data from Kanold and Manis (1999) and Kanold's dissertation (1999)
|
||||
|
||||
-- 15 Jan 1999 P. Manis
|
||||
|
||||
2/10/02, 7/24/2014. P. Manis.
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
}
|
||||
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX kis
|
||||
USEION k READ ek WRITE ik
|
||||
RANGE gkis, kis_a_inf, kis_i_inf : fast inactivating potassium current
|
||||
RANGE akis, gbar
|
||||
RANGE kis_a_tau, kis_i_tau
|
||||
RANGE kis_a_start, kis_i_start
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius (degC)
|
||||
dt (ms)
|
||||
ek (mV) : = -81.5 (mV)
|
||||
ena (mV) : = 50.0 (mV)
|
||||
gbar = 0.0033333 (mho/cm2) <0,1e9>
|
||||
|
||||
kis_ivh = -40.9 (mV)
|
||||
kis_avh = -38.4 (mV)
|
||||
kis_a_start = -1
|
||||
kis_i_start = -1
|
||||
}
|
||||
|
||||
STATE {
|
||||
kisa kisi
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gkis (mho/cm2)
|
||||
ik (mA/cm2)
|
||||
kis_a_inf kis_i_inf
|
||||
kis_a_tau (ms)
|
||||
kis_i_tau (ms)
|
||||
akis
|
||||
q10 ()
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
akis = kisa*kisa*kisa*kisa*kisi
|
||||
gkis = gbar*akis
|
||||
ik = gkis*(v - ek)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
q10 = 3^((celsius - 22)/10 (degC))
|
||||
rates(v)
|
||||
if(kis_a_start < 0) { : if xx_(i/a)_start is > 0, then perturbation is done at onset of computations.
|
||||
kisa = kis_a_inf
|
||||
} else {
|
||||
kisa = kis_a_start
|
||||
}
|
||||
if(kis_i_start < 0) {
|
||||
kisi = kis_i_inf
|
||||
} else {
|
||||
kisi = kis_i_start
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
kisa' = (kis_a_inf - kisa) / kis_a_tau
|
||||
kisi' = (kis_i_inf - kisi) / kis_i_tau
|
||||
}
|
||||
|
||||
PROCEDURE rates(v (mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
|
||||
: "kis" fast inactivation potassium channel - activation and inactivation
|
||||
kis_a_inf = kis_m(v)
|
||||
kis_i_inf = kis_h(v)
|
||||
kis_a_tau = kis_mt(v)
|
||||
kis_i_tau = kis_ht(v)
|
||||
}
|
||||
|
||||
: Make these as functions so we can view them from hoc, although this
|
||||
: may slow things down a bit
|
||||
|
||||
FUNCTION kis_m(v (mV)) { : ikis activation
|
||||
kis_m = 1/(1+exp(-(v-kis_avh)/23.7 (mV)))
|
||||
}
|
||||
|
||||
FUNCTION kis_h(v (mV)) { : ikis inactivation
|
||||
kis_h = 1/(1+exp((v-kis_ivh)/9 (mV)))
|
||||
}
|
||||
|
||||
FUNCTION kis_mt(v (mV)) (ms) { : ikis activation tau
|
||||
LOCAL x
|
||||
x = 0.15*exp((v-kis_avh)/10 (mV)) + 0.3*exp(-(v-kis_avh)/10 (mV))
|
||||
x = 0.5 + (1.0 /x)
|
||||
kis_mt = (x * 1.0 (ms))/q10
|
||||
}
|
||||
|
||||
FUNCTION kis_ht(v (mV)) (ms) { : ikis inactivation tau
|
||||
kis_ht = 200 (ms)
|
||||
}
|
||||
|
||||
109
cnmodel/mechanisms/klt.mod
Normal file
109
cnmodel/mechanisms/klt.mod
Normal file
@@ -0,0 +1,109 @@
|
||||
TITLE klt.mod The low threshold conductance of cochlear nucleus neurons
|
||||
|
||||
COMMENT
|
||||
|
||||
NEURON implementation of Jason Rothman's measurements of VCN conductances.
|
||||
|
||||
This file implements the low threshold potassium current found in several brainstem
|
||||
nuclei of the auditory system, including the spherical and globular bushy cells
|
||||
(Manis and Marx, 1991; Rothman and Manis, 2003a,b) and octopus cells (Bal and
|
||||
Oertel, 2000) of the ventral cochlear nucleus, principal cells of the medial
|
||||
nucleus of the trapzoid body (Brew and Forsythe, 1995, Wang and Kaczmarek,
|
||||
1997) and neurons of the medial superior olive. The current is likely mediated by
|
||||
heteromultimers of Kv1.1 and Kv1.2 potassium channel subunits. The specific
|
||||
implementation is described in Rothman and Manis, J. Neurophysiol. 2003, in the
|
||||
appendix. Measurements were made from isolated neurons from adult guinea pig,
|
||||
under reasonably stringent voltage clamp conditions. The measured current is
|
||||
sensitive to the mamba snake toxin dendrotoxin-I.
|
||||
|
||||
|
||||
Similar conductrances are found in the homologous neurons of the avian auditory
|
||||
system (Reyes and Rubel; Zhang and Trussell; Rathouz and Trussell), and the
|
||||
conductance described here, in the absence of more detailed kinetic measurements
|
||||
, is probably suitable for use in modeling that system.
|
||||
|
||||
|
||||
Original implementation by Paul B. Manis, April (JHU) and Sept, (UNC)1999.
|
||||
|
||||
File split implementation, February 28, 2004.
|
||||
|
||||
Contact: pmanis@med.unc.edu
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX klt
|
||||
USEION k READ ek WRITE ik
|
||||
RANGE gbar, gklt, ik, q10g
|
||||
GLOBAL winf, zinf, wtau, ztau
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
dt (ms)
|
||||
gbar = 0.01592 (mho/cm2) <0,1e9>
|
||||
zss = 0.5 <0,1> : steady state inactivation of glt
|
||||
q10tau = 3.0
|
||||
q10g = 2.0
|
||||
}
|
||||
|
||||
STATE {
|
||||
w z
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
celsius (degC) : model is defined on measurements made at room temp in Baltimore
|
||||
ik (mA/cm2)
|
||||
ek (mV)
|
||||
gklt (mho/cm2)
|
||||
winf zinf
|
||||
wtau (ms) ztau (ms)
|
||||
qg () : computed q10 for gnabar based on q10g
|
||||
q10 ()
|
||||
}
|
||||
|
||||
LOCAL wexp, zexp
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
|
||||
gklt = qg*gbar*(w^4)*z
|
||||
ik = gklt*(v - ek)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
qg = q10g^((celsius-22)/10 (degC))
|
||||
q10 = q10tau^((celsius - 22)/10 (degC)) : if you don't like room temp, it can be changed!
|
||||
rates(v)
|
||||
w = winf
|
||||
z = zinf
|
||||
}
|
||||
|
||||
DERIVATIVE states { :Computes state variables m, h, and n
|
||||
rates(v) : at the current v and dt.
|
||||
w' = (winf - w)/wtau
|
||||
z' = (zinf - z)/ztau
|
||||
}
|
||||
|
||||
|
||||
PROCEDURE rates(v (mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
|
||||
winf = (1 / (1 + exp(-(v + 48) / 6 (mV))))^0.25
|
||||
zinf = zss + ((1-zss) / (1 + exp((v + 71) / 10 (mV))))
|
||||
|
||||
wtau = (100 (ms)/ (6*exp((v+60) / 6 (mV)) + 16*exp(-(v+60) / 45 (mV)))) + 1.5
|
||||
wtau = wtau/q10
|
||||
ztau = (1000 (ms)/ (exp((v+60) / 20 (mV)) + exp(-(v+60) / 8 (mV)))) + 50
|
||||
ztau = ztau/q10
|
||||
}
|
||||
|
||||
94
cnmodel/mechanisms/kpkj.mod
Normal file
94
cnmodel/mechanisms/kpkj.mod
Normal file
@@ -0,0 +1,94 @@
|
||||
: HH TEA-sensitive Purkinje potassium current
|
||||
: Created 8/5/02 - nwg
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX kpkj
|
||||
USEION k READ ek WRITE ik
|
||||
RANGE gbar, ik, gk
|
||||
GLOBAL minf, hinf, mtau, htau
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mV) = (millivolt)
|
||||
(mA) = (milliamp)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
|
||||
gbar = .004 (mho/cm2)
|
||||
|
||||
mivh = -24 (mV)
|
||||
mik = 15.4 (mV)
|
||||
mty0 = .00012851 (s)
|
||||
mtvh1 = 100.7 (mV)
|
||||
mtk1 = 12.9 (mV)
|
||||
mtvh2 = -56.0 (mV)
|
||||
mtk2 = -23.1 (mV)
|
||||
|
||||
hiy0 = .31
|
||||
hiA = .78
|
||||
hivh = -5.802 (mV)
|
||||
hik = 11.2 (mV)
|
||||
|
||||
ek (mV)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gk (mho/cm2)
|
||||
ik (mA/cm2)
|
||||
minf
|
||||
mtau (ms)
|
||||
hinf
|
||||
htau (ms)
|
||||
}
|
||||
|
||||
STATE {
|
||||
m
|
||||
h
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
m = minf
|
||||
h = hinf
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gk = gbar * m^3 * h
|
||||
ik = gk * (v - ek)
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
m' = (minf - m) / mtau
|
||||
h' = (hinf - h) / htau
|
||||
}
|
||||
|
||||
PROCEDURE rates( Vm (mV)) {
|
||||
LOCAL v
|
||||
v = Vm + 11 (mV) : Account for Junction Potential
|
||||
minf = 1/(1+exp(-(v-mivh)/mik))
|
||||
mtau = mtau_func(v)
|
||||
hinf = hiy0 + hiA/(1+exp((v-hivh)/hik))
|
||||
htau = 1000 * htau_func(v)
|
||||
}
|
||||
|
||||
FUNCTION mtau_func (v (mV)) (ms) {
|
||||
if (v < -35 (mV)) {
|
||||
mtau_func = (1000)*(3.4225e-5+.00498*exp(-v/-28.29 (mV)))*3 (s)
|
||||
} else {
|
||||
mtau_func = (1000)*(mty0 + 1(s)/(exp((v+mtvh1)/mtk1)+exp((v+mtvh2)/mtk2)))
|
||||
}
|
||||
}
|
||||
|
||||
FUNCTION htau_func(Vm (mV)) (ms) {
|
||||
if ( Vm > 0) {
|
||||
htau_func = (1000)*(0.0012 (s) + 0.0023(s)*exp(-0.141 *Vm / 1 (mV)))
|
||||
} else {
|
||||
htau_func = (1000)*(1.2202e-05(s) + .012(s) * exp(-((Vm-(-56.3 (mV)))/49.6 (mV))^2))
|
||||
}
|
||||
}
|
||||
|
||||
67
cnmodel/mechanisms/kpkj2.mod
Normal file
67
cnmodel/mechanisms/kpkj2.mod
Normal file
@@ -0,0 +1,67 @@
|
||||
: HH Low TEA-sensitive Purkinje potassium current
|
||||
: Created 8/7/02 - nwg
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX kpkj2
|
||||
USEION k READ ek WRITE ik
|
||||
RANGE gbar, ik, gk
|
||||
GLOBAL ninf, ntau
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mV) = (millivolt)
|
||||
(mA) = (milliamp)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
gbar = .002 (mho/cm2)
|
||||
|
||||
nivh = -24 (mV)
|
||||
nik = 20.4 (mV)
|
||||
|
||||
ek (mV)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gk (mho/cm2)
|
||||
ik (mA/cm2)
|
||||
ninf (1)
|
||||
ntau (ms)
|
||||
}
|
||||
|
||||
STATE {
|
||||
n
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
n = ninf
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gk = gbar * n^4
|
||||
ik = gk * (v - ek)
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
n' = (ninf - n) / ntau
|
||||
}
|
||||
|
||||
PROCEDURE rates(Vm (mV)) {
|
||||
LOCAL v
|
||||
v = Vm + 11 : Account for Junction Potential
|
||||
ninf = 1/(1+exp(-(v-nivh)/nik))
|
||||
ntau = 1000 * ntau_func(v)
|
||||
}
|
||||
|
||||
FUNCTION ntau_func(v (mV)) (ms) {
|
||||
if (v < -20) {
|
||||
ntau_func = 0.000688 (ms) + 1 (ms)/(exp((v+64.2 (mV))/6.5 (mV))+exp((v-141.5 (mV))/-34.8 (mV)))
|
||||
} else {
|
||||
ntau_func = 0.00016 (ms) + 0.0008 (ms) *exp(-0.0267 * v /(1 (mV)))
|
||||
}
|
||||
}
|
||||
63
cnmodel/mechanisms/kpkjslow.mod
Normal file
63
cnmodel/mechanisms/kpkjslow.mod
Normal file
@@ -0,0 +1,63 @@
|
||||
: HH Slow TEA-insensitive Purkinje potassium current
|
||||
: Created 8/7/02 - nwg
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX kpkjslow
|
||||
USEION k READ ek WRITE ik
|
||||
RANGE gbar, ik, gk
|
||||
GLOBAL ninf, ntau
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mV) = (millivolt)
|
||||
(mA) = (milliamp)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
gbar = 0.004 (mho/cm2)
|
||||
|
||||
nivh = -16.5 (mV)
|
||||
nik = 18.4 (mV)
|
||||
|
||||
ek (mV)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gk (mho/cm2)
|
||||
ik (mA/cm2)
|
||||
ninf
|
||||
ntau (ms)
|
||||
}
|
||||
|
||||
STATE {
|
||||
n
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
n = ninf
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gk = gbar * n^4
|
||||
ik = gk * (v - ek)
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
n' = (ninf - n) / ntau
|
||||
}
|
||||
|
||||
PROCEDURE rates(Vm (mV)) {
|
||||
LOCAL v
|
||||
v = Vm + 11 : Account for Junction Potential
|
||||
ninf = 1/(1+exp(-(v-nivh)/nik))
|
||||
ntau = 1000 * ntau_func(v)
|
||||
}
|
||||
|
||||
FUNCTION ntau_func(v (mV)) (ms){
|
||||
ntau_func = 0.000796 (ms) + 1 (ms)/(exp((v+73.2 (mV))/11.7 (mV))+exp((v-306.7 (mV))/-74.2(mV)))
|
||||
}
|
||||
111
cnmodel/mechanisms/kpksk.mod
Normal file
111
cnmodel/mechanisms/kpksk.mod
Normal file
@@ -0,0 +1,111 @@
|
||||
TITLE Slow Ca-dependent potassium current
|
||||
:
|
||||
: Ca++ dependent K+ current IC responsible for slow AHP
|
||||
: Differential equations
|
||||
:
|
||||
: Model based on a first order kinetic scheme
|
||||
:
|
||||
: <closed> + n cai <-> <open> (alpha,beta)
|
||||
:
|
||||
: Following this model, the activation fct will be half-activated at
|
||||
: a concentration of Cai = (beta/alpha)^(1/n) = cac (parameter)
|
||||
:
|
||||
: The mod file is here written for the case n=2 (2 binding sites)
|
||||
: ---------------------------------------------
|
||||
:
|
||||
: This current models the "slow" IK[Ca] (IAHP):
|
||||
: - potassium current
|
||||
: - activated by intracellular calcium
|
||||
: - NOT voltage dependent
|
||||
:
|
||||
: A minimal value for the time constant has been added
|
||||
:
|
||||
: Ref: Destexhe et al., J. Neurophysiology 72: 803-818, 1994.
|
||||
:
|
||||
: Modifications by Arthur Houweling for use in MyFirstNEURON
|
||||
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX kpksk
|
||||
USEION k READ ek WRITE ik
|
||||
USEION ca READ cai
|
||||
RANGE m_inf, tau_m, gbar, gk
|
||||
GLOBAL beta, cac
|
||||
RANGE ik
|
||||
}
|
||||
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(molar) = (1/liter)
|
||||
(mM) = (millimolar)
|
||||
}
|
||||
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius (degC)
|
||||
dt (ms)
|
||||
ek (mV)
|
||||
cai (mM)
|
||||
gbar = .01 (mho/cm2)
|
||||
beta = 0.002 (1/ms) : backward rate constant
|
||||
cac = 0.010 (mM) : middle point of activation fct
|
||||
taumin = 0.1 (ms) : minimal value of the time cst
|
||||
}
|
||||
|
||||
|
||||
STATE {
|
||||
m
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
ik (mA/cm2)
|
||||
gk (mho/cm2)
|
||||
m_inf
|
||||
tau_m (ms)
|
||||
tadj ()
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states :METHOD euler
|
||||
gk = gbar * m*m
|
||||
ik = gk * (v - ek)
|
||||
}
|
||||
|
||||
:DERIVATIVE states {
|
||||
: evaluate_fct(v,cai)
|
||||
:
|
||||
: m'= (m_inf-m) / tau_m
|
||||
:}
|
||||
|
||||
PROCEDURE states() {
|
||||
evaluate_fct(v,cai)
|
||||
|
||||
m= m + (1-exp(-dt/tau_m))*(m_inf-m)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
:
|
||||
: activation kinetics are assumed to be at 22 deg. C
|
||||
: Q10 is assumed to be 3
|
||||
:
|
||||
tadj = 3 ^ ((celsius-22.0)/10 (degC))
|
||||
|
||||
evaluate_fct(v,cai)
|
||||
m = m_inf
|
||||
}
|
||||
|
||||
PROCEDURE evaluate_fct(v(mV),cai(mM)) { LOCAL car
|
||||
|
||||
car = (cai/cac)^2
|
||||
|
||||
m_inf = car / ( 1 + car )
|
||||
tau_m = 1 / beta / (1 + car) / tadj
|
||||
|
||||
if(tau_m < taumin) { tau_m = taumin } : min value of time cst
|
||||
}
|
||||
32
cnmodel/mechanisms/leak.mod
Normal file
32
cnmodel/mechanisms/leak.mod
Normal file
@@ -0,0 +1,32 @@
|
||||
TITLE passive (leak) membrane channel
|
||||
|
||||
UNITS {
|
||||
(mV) = (millivolt)
|
||||
(mA) = (milliamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX leak
|
||||
NONSPECIFIC_CURRENT i
|
||||
RANGE gbar, erev, i
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
gbar = 0.001 (mho/cm2)
|
||||
erev = -65 (mV)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
i (mA/cm2)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
|
||||
}
|
||||
BREAKPOINT {
|
||||
i = gbar*(v - erev)
|
||||
}
|
||||
|
||||
|
||||
379
cnmodel/mechanisms/multisite.mod
Normal file
379
cnmodel/mechanisms/multisite.mod
Normal file
@@ -0,0 +1,379 @@
|
||||
TITLE Multisite synapse
|
||||
|
||||
COMMENT
|
||||
-----------------------------------------------------------------------------
|
||||
Multi-site synapse with independent release sites. Each site operates independently
|
||||
and releases a vesicle upon presynaptic depolarization with a probability
|
||||
determined by the history of activity, using the Dittman and Regehr (1998, 2000)
|
||||
model.
|
||||
|
||||
Revised from coh2.mod, coh3.mod, and coh4.mod.
|
||||
The Dittman and Regeher (1998, 2000) release model with
|
||||
facilitation closely fits Auditory Nerve data from mouse over
|
||||
a wide range of frequencies.
|
||||
The model DOES NOT include the postsynaptic receptors or desensitization, since
|
||||
these should be treated separately (couple XMTR to an AMPA receptor model,
|
||||
such as the Trussell-Raman model)
|
||||
|
||||
Range variables:
|
||||
nZones: is the number of active zones simulated in this calyx model. Each zone
|
||||
can be connected to a separate PSD.
|
||||
F (0.4): The base release probability
|
||||
k0 (1/1.75): /s, baseline recovery rate from depletion (slow rate)
|
||||
kmax (1/0.025): /s, maximal recovery rate from depletion (fast rate)
|
||||
td (0.05) : time constant for fast calcium-dependent recovery, sec
|
||||
kd (0.7) : affinity of fast recovery process for calcium sensor
|
||||
kf (0.5) : affinity of facilitation process
|
||||
tf (0.01) : rate of facilitation process (slow) seconds
|
||||
dD (0.02): calcium that drives recovery (ca influx per AP)
|
||||
dF (0.02): calcium that drives facilitation
|
||||
|
||||
Added latency and variable delay (latstd, latency standard deviation in msec)
|
||||
around the mean spike time. 4/5/2011 pbm.
|
||||
|
||||
Version 4 uses a log-normal distribution to determine release latencies.
|
||||
The calculation is built-in instead of being passed through an array.
|
||||
The lognormal distribution describes the individual vesicle release time
|
||||
course at this synapse as measured by Isaacson and Walmsley, 1996. Note that
|
||||
they used a gamma distribution in some plots, but the lognormal distribution
|
||||
seems to fit their published data at least as well.
|
||||
The parameters of the distribution, as well as the release latency,
|
||||
are controlled by an exponential function whose parameters are initialized at
|
||||
run time.
|
||||
10/19/2011 Paul B. Manis, UNC Chapel Hill
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
DEFINE MAX_ZONES 1000 : maximum number of zones in this model
|
||||
DEFINE EVENT_N 10000 : number of entries in the Event Distribution (e.g., as sampled)
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
POINT_PROCESS MultiSiteSynapse
|
||||
RANGE F, k0, kmax, taud, kd, tauf, kf
|
||||
RANGE nZones, multisite, rseed, latency, latstd, debug
|
||||
RANGE dD, dF, XMTR, glu, CaDi, CaFi
|
||||
RANGE Fn, Dn
|
||||
RANGE TTotal
|
||||
RANGE nRequests, nReleases
|
||||
RANGE Identifier : just a number so we can report which instance is active
|
||||
RANGE tau_g, amp_g
|
||||
: Distributions for stochastic release and testing (Sept, Oct, 2011):
|
||||
RANGE EventLatencies, EventTime : returns the first EVENT_N latencies and absolute times at which they were used
|
||||
RANGE ev_index : count in the EventLatencies (in case we are "short")
|
||||
: parameters for latency shift during repetitive stimulation (Oct 19, 2011)
|
||||
RANGE Dep_Flag : Depression flag (0 to remove depression; 1 to allow DKR control of facilitation and depression)
|
||||
RANGE Lat_Flag, Lat_t0, Lat_A0, Lat_tau : Lat_Flag = 0 means fixed latency (set by "latency" above)
|
||||
: otherwise, latency = latency for t < Lat_t0
|
||||
: latency = latency + Lat_A0*(1-exp(-(t-Lat_t0)/Lat_tau))
|
||||
: parameters for lognorm distribution shift during repetitive stimulation (Oct 19, 2011)
|
||||
RANGE LN_Flag, LN_t0, LN_A0, LN_tau : LN_Flag = 0 means fixed sigma as well
|
||||
: otherwise, sigma = latstd for t < LN_t0
|
||||
: sigma = latstd + LN_A0*(1-exp(-(t-LN_t0)/LN_tau))
|
||||
|
||||
: externally assigned pointers to RNG functions
|
||||
POINTER uniform_rng : for deciding the number of active synapses when multisite==0
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(mM) = (milli/liter)
|
||||
(uM) = (micro/liter)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
dt (ms)
|
||||
amp_g = 1.0 (mM) : amplitude of transmitter pulse
|
||||
tau_g = 0.5 (ms) : duration of transmitter pulse
|
||||
dD = 0.02 (1) : calcium influx driving recovery per AP
|
||||
dF = 0.02 (1) : calcium influx driving facilitation per AP
|
||||
F = 0.5 (1) : basal facilitation
|
||||
k0 = 0.0005714(/ms) : slow recovery from depletion (1.0/1.75)
|
||||
kmax = 0.040 (/ms) : fast recovery from depletion (1/0.025)
|
||||
taud = 50.0 (ms) : time constant for fast calcium dependent recovery
|
||||
kd = 0.7 (1) : affinity of fast recovery process for calcium sensor
|
||||
tauf = 10.0 (ms) : rate of slow facilitation process
|
||||
kf = 0.5 (1) : affinity of slow facilitation process
|
||||
: taus = 1 (ms) : defined by DKR but not used here
|
||||
: ks = 0.5 (1)
|
||||
: glu = 1 (mM)
|
||||
rseed (1) : random number generator seed (for SCOP module)
|
||||
latency = 0.0 (ms)
|
||||
latstd = 0.0 (ms)
|
||||
|
||||
: Time course of latency shift in release during repetitive stimulation
|
||||
Lat_Flag = 0 (1) : 0 means fixed latency, 1 means lognormal distribution
|
||||
Lat_t0 = 0.0 (ms) : minimum time since simulation start before changes in latency are calculated
|
||||
Lat_A0 = 0.0 (ms) : size of latency shift from t0 to infinity
|
||||
Lat_tau = 100.0 (ms) : rate of change of latency shift (from fit of a+b(1-exp(-t/tau)))
|
||||
: Statistical control of log-normal release shape over time during repetitive stimulation
|
||||
LN_Flag = 0 (1) : 0 means fixed values for all time
|
||||
LN_t0 = 0.0 (ms) : : minimum time since simulation start before changes in distribution are calculated
|
||||
LN_A0 = 0.0 (ms) : size of change in sigma from t0 to infinity
|
||||
LN_tau = 100.0 (ms) : rate of change of sigma over time (from fit of a+b*(1-exp(-t/tau)))
|
||||
|
||||
: control flags - if debug is 1, show all, if 2, just "some"
|
||||
debug = 0
|
||||
Identifier = 0
|
||||
Dep_Flag = 1 (1) : 1 means use depression calculations; 0 means always set release probability to F
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
: Externally set assignments
|
||||
nZones (1) : number of zones in the model
|
||||
multisite (1) : whether zones are modeled individually (1) or as a single, variable-amplitude zone (0)
|
||||
nRequests (1)
|
||||
nReleases (1)
|
||||
EventLatencies[EVENT_N] (0)
|
||||
EventTime[EVENT_N] (0)
|
||||
tRelease[MAX_ZONES] (ms) : time of last release
|
||||
|
||||
: Internal calculated variables
|
||||
Fn (1)
|
||||
Dn (1)
|
||||
CaDn (1)
|
||||
CaFn (1)
|
||||
CaDi (1)
|
||||
CaFi (1)
|
||||
eta (1)
|
||||
tSpike (ms) : time of last spike
|
||||
tstep(ms)
|
||||
TTotal(0)
|
||||
tspike (ms)
|
||||
latzone (ms)
|
||||
vesicleLatency (ms)
|
||||
sigma (ms)
|
||||
gindex (0)
|
||||
ev_index (0)
|
||||
scrand (0)
|
||||
|
||||
uniform_rng
|
||||
}
|
||||
|
||||
: Function prototypes needed to assign RNG function pointers
|
||||
VERBATIM
|
||||
double nrn_random_pick(void* r);
|
||||
void* nrn_random_arg(int argpos);
|
||||
ENDVERBATIM
|
||||
|
||||
: Return a pick from uniform distribution.
|
||||
: (distribution parameters are set externally)
|
||||
FUNCTION rand_uniform() {
|
||||
VERBATIM
|
||||
_lrand_uniform = nrn_random_pick(_p_uniform_rng);
|
||||
ENDVERBATIM
|
||||
}
|
||||
|
||||
: Function to allow RNG to be externally set
|
||||
PROCEDURE setUniformRNG() {
|
||||
VERBATIM
|
||||
{
|
||||
void** pv = (void**)(&_p_uniform_rng);
|
||||
*pv = nrn_random_arg(1);
|
||||
}
|
||||
ENDVERBATIM
|
||||
}
|
||||
|
||||
|
||||
STATE {
|
||||
XMTR[MAX_ZONES] (mM) : per-zone neurotransmitter concentration
|
||||
N_ACTIVE[MAX_ZONES] (1) : number of zones actively releasing
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
: VERBATIM
|
||||
: fprintf(stdout, "MultiSiteSynapse: Calyx #%d Initialized with Random Seed: %d\n", (int)Identifier, (int)rseed);
|
||||
: ENDVERBATIM
|
||||
|
||||
TTotal = 0
|
||||
nRequests = 0
|
||||
nReleases = 0
|
||||
set_seed(rseed)
|
||||
tSpike = -1e9
|
||||
latzone = 0.0
|
||||
sigma = 0.0
|
||||
vesicleLatency = 0.0
|
||||
gindex = 0
|
||||
ev_index = 0
|
||||
scrand = 0.0
|
||||
CaDi = 1.0
|
||||
CaFi = 0.0
|
||||
CaDn = 1.0
|
||||
CaFn = 0.0
|
||||
Fn = F
|
||||
Dn = 1.0
|
||||
FROM i = 0 TO (nZones-1) {
|
||||
XMTR[i] = 0
|
||||
N_ACTIVE[i] = 1
|
||||
tRelease[i] = tSpike
|
||||
}
|
||||
update_dkr(t-tSpike)
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE release
|
||||
}
|
||||
|
||||
LOCAL tz, n_relzones, amp
|
||||
PROCEDURE release() {
|
||||
: Once released, the transmitter packet has a defined smooth time course in the "cleft"
|
||||
: represented by the product of rising and falling exponentials.
|
||||
: update glutamate in cleft
|
||||
if (multisite == 1) {
|
||||
: Update glutamate waveform for each active release zone
|
||||
n_relzones = nZones
|
||||
}
|
||||
else {
|
||||
: Update aggregate glutamate waveform for only the first release zone
|
||||
n_relzones = 1
|
||||
}
|
||||
|
||||
FROM i = 0 TO (nZones-1) { : for each zone in the synapse
|
||||
if (t >= tRelease[i] && t < tRelease[i] + 5.0 * tau_g) {
|
||||
tz = t - tRelease[i] : time since onset of release
|
||||
: calculate glutamate waveform (Xie & Manis 2013 Supplementary Eq. 1)
|
||||
XMTR[i] = amp_g * (1.0-exp(-tz/(tau_g/3.0))) * exp(-(tz-(tau_g/3.0))/tau_g)
|
||||
}
|
||||
else {
|
||||
XMTR[i] = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PROCEDURE update_dkr(tstep (ms)) {
|
||||
: update the facilitation and depletion variables
|
||||
: from the Dittman-Regehr model.
|
||||
: Updates are done with each new presynaptic AP event.
|
||||
if(tstep > 0.0) {
|
||||
CaDi = CaDi + dD
|
||||
CaFi = CaFi + dF
|
||||
CaDn = CaDi * exp (-tstep/taud)
|
||||
CaFn = CaFi * exp (-tstep/tauf)
|
||||
eta = (kd/CaDi + 1.0)/(kd/CaDi + exp(-tstep/taud))
|
||||
eta = eta^(-(kmax-k0)*taud)
|
||||
Dn = 1.0-(1.0-(1.0-Fn)*Dn)*exp(-k0*tstep)*eta
|
||||
Fn = F + (1.0-F)/(1.0+kf/CaFn)
|
||||
CaDi = CaDn
|
||||
CaFi = CaFn
|
||||
}
|
||||
if (Dep_Flag == 0) { : no depression
|
||||
Dn = 1.0 : set to 1
|
||||
Fn = F : set to initial value to set release probability constant
|
||||
}
|
||||
: VERBATIM
|
||||
: if (debug >= 2 ){
|
||||
: fprintf(stdout, "update start t = %f ts=%f: F=%7.2f CaDi = %g CaFi = %g\n", \
|
||||
: t, tstep, F, CaDi, CaFi);
|
||||
: fprintf(stdout, " vars: taud=%g: tauf=%g kd = %g kmax= %g\n", taud, tauf, kd, kmax);
|
||||
: fprintf(stdout, " CaDi = %g CaFi = %g\n", CaDi, CaFi);
|
||||
: fprintf(stdout, " CaDn = %g CaFn = %g\n", CaDn, CaFn);
|
||||
: fprintf(stdout, " eta: %g\n", eta);
|
||||
: fprintf(stdout, " Fn=%7.2f Dn: %7.2f CaDi = %g CaFi = %g,\n", \
|
||||
: Fn, Dn, CaDi, CaFi);
|
||||
: }
|
||||
: ENDVERBATIM
|
||||
}
|
||||
|
||||
|
||||
NET_RECEIVE(weight) {
|
||||
: A spike has been received; process synaptic release
|
||||
|
||||
: First, update DKR state to determine new release probability
|
||||
update_dkr(t - tSpike)
|
||||
tSpike = t : save the time of spike
|
||||
|
||||
TTotal = 0 : reset total transmitter from this calyx for each release
|
||||
nRequests = nRequests + 1 : count the number of inputs that we received
|
||||
|
||||
: Next, process vesicle release using new release probability
|
||||
if (multisite == 1) {
|
||||
release_multisite()
|
||||
}
|
||||
else {
|
||||
release_singlesite()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PROCEDURE release_multisite() {
|
||||
: Vesicle release procedure for multi-site terminal.
|
||||
: Loops over multiple zones using release probability Fn*Dn to decide whether
|
||||
: each site will release, and selecting an appropriate release latency.
|
||||
|
||||
: The synapse can release one vesicle per AP per zone, with a probability 0<p<1.
|
||||
: The probability, p, is defined by the time evolution of a Dittman-Regher model
|
||||
: of release, whose parameters are set during initialization.
|
||||
: The vesicle can be released over a variable time interval defined by a lognormal
|
||||
: distribution, plus a fixed latency.
|
||||
|
||||
FROM i = 0 TO (nZones-1) { : for each zone in the synapse
|
||||
if(tRelease[i] < t) {
|
||||
scrand = scop_random()
|
||||
: look to make release if we have not already (single vesicle per zone per spike)
|
||||
: check for release and release probability - assume infinite supply of vesicles
|
||||
if (scrand < Fn*Dn) {
|
||||
nReleases = nReleases + 1 : count number of releases since inception
|
||||
TTotal = TTotal + 1 : count total releases this trial.
|
||||
|
||||
: Compute the median latency for this vesicle.
|
||||
if (Lat_Flag == 0 || t < Lat_t0) {
|
||||
vesicleLatency = latency : use a fixed value
|
||||
}
|
||||
else {
|
||||
vesicleLatency = latency + Lat_A0*(1-exp(-(t-Lat_t0)/Lat_tau)) : latency rises during train
|
||||
}
|
||||
: Now compute distribution around that latency
|
||||
: if LN_Flag is 1, we adjust the sigma values over time, otherwise we just use a fixed value.
|
||||
: The following math applies:
|
||||
: lognormal dist = exp(X), where X = gaussian(mu, sigma).
|
||||
: The median of the lognormal dist. is e^mu; Note that if mu is 0, then the median is 1.0
|
||||
: The mode of the lognormal dist is e^(u-sigma^2).
|
||||
: Note that normrand is a SCoP function, see http://cns.iaf.cnrs-gif.fr/files/scopman.html
|
||||
if (LN_Flag == 0 || t < LN_t0) { : use fixed sigma in lognormal distribution for all time.
|
||||
if (latstd > 0.0) {
|
||||
latzone = normrand(0.0, latstd) : set a latency for the zone with one draw from the distribution
|
||||
latzone = exp(latzone) - 1.0 + vesicleLatency : the latency should not be too short....
|
||||
}
|
||||
else {
|
||||
latzone = vesicleLatency : fixed value
|
||||
}
|
||||
}
|
||||
else {
|
||||
sigma = latstd + LN_A0*(1-exp(-(t-LN_t0)/LN_tau)) : time-dependent std shift
|
||||
latzone = normrand(0.0, sigma)
|
||||
latzone = exp(latzone)-1.0 + vesicleLatency
|
||||
}
|
||||
if (latzone < 0.0) { : this is to be safe... must have causality.
|
||||
latzone = 0.0
|
||||
}
|
||||
if (ev_index < EVENT_N) { : save event distribution list for verification
|
||||
EventLatencies[ev_index] = latzone
|
||||
EventTime[ev_index] = t
|
||||
ev_index = ev_index + 1
|
||||
}
|
||||
|
||||
: release time for this event
|
||||
tRelease[i] = t + latzone
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PROCEDURE release_singlesite() {
|
||||
LOCAL pr
|
||||
tRelease[0] = t
|
||||
pr = Fn * Dn
|
||||
FROM i = 0 TO (nZones-1) {
|
||||
if (rand_uniform() < pr) {
|
||||
TTotal = TTotal + 1 : count total releases this trial.
|
||||
}
|
||||
}
|
||||
: Tell PSD to multiply its final current by the number of active zones
|
||||
N_ACTIVE[0] = TTotal
|
||||
printf("Release: %f\n", TTotal)
|
||||
}
|
||||
100
cnmodel/mechanisms/na.mod
Normal file
100
cnmodel/mechanisms/na.mod
Normal file
@@ -0,0 +1,100 @@
|
||||
TITLE na.mod A sodium channel for cochlear nucleus neurons
|
||||
|
||||
COMMENT
|
||||
|
||||
NEURON implementation of Jason Rothman's measurements of VCN conductances.
|
||||
|
||||
This file implements the average brain sodium current used in the Rothman model.
|
||||
In the absence of direct measurements in the VCN, this is a fair assumption.
|
||||
The model differs from the one used in Rothman et al, (1993) in that the steep
|
||||
voltage dependence of recovery from inactivation in that model is missing. This
|
||||
may affect the refractory period. To use the other model, use najsr.mod instead.
|
||||
|
||||
Original implementation by Paul B. Manis, April (JHU) and Sept, (UNC)1999.
|
||||
|
||||
File split implementaiton, April 1, 2004.
|
||||
|
||||
Contact: pmanis@med.unc.edu
|
||||
|
||||
Modifed implementation; includes all temperature scaling, passes modlunit
|
||||
7/10/2014 pbm
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX na
|
||||
USEION na READ ena WRITE ina
|
||||
RANGE gbar, gna, ina
|
||||
GLOBAL hinf, minf, htau, mtau
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
dt (ms)
|
||||
ena (mV)
|
||||
gbar = 0.07958 (mho/cm2) <0,1e9>
|
||||
q10tau = 3.0
|
||||
q10g = 2.0
|
||||
|
||||
}
|
||||
|
||||
STATE {
|
||||
m h
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
celsius (degC) : model is defined on measurements made at room temp in Baltimore
|
||||
ina (mA/cm2)
|
||||
gna (mho/cm2)
|
||||
minf hinf
|
||||
mtau (ms) htau (ms)
|
||||
qg () : computed q10 for gnabar based on q10g
|
||||
q10 ()
|
||||
|
||||
}
|
||||
|
||||
LOCAL mexp, hexp
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
|
||||
gna = qg*gbar*(m^3)*h
|
||||
ina = gna*(v - ena)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
qg = q10g^((celsius-22)/10 (degC))
|
||||
q10 = q10tau^((celsius - 22)/10 (degC)) : if you don't like room temp, it can be changed!
|
||||
rates(v)
|
||||
m = minf
|
||||
h = hinf
|
||||
}
|
||||
|
||||
DERIVATIVE states { :Computes state variables m, h, and n
|
||||
rates(v) : at the current v and dt.
|
||||
m' = (minf - m)/mtau
|
||||
h' = (hinf - h)/htau
|
||||
}
|
||||
|
||||
PROCEDURE rates(v (mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
|
||||
: average sodium channel
|
||||
minf = 1 / (1+exp(-(v + 38) / 7 (mV)))
|
||||
hinf = 1 / (1+exp((v + 65) / 6 (mV)))
|
||||
|
||||
mtau = (10 (ms)/ (5*exp((v+60) / 18 (mV)) + 36*exp(-(v+60) / 25 (mV)))) + 0.04
|
||||
mtau = mtau/q10
|
||||
htau = (100 (ms)/ (7*exp((v+60) / 11 (mV)) + 10*exp(-(v+60) / 25 (mV)))) + 0.6
|
||||
htau = htau/q10
|
||||
}
|
||||
|
||||
103
cnmodel/mechanisms/nacn.mod
Executable file
103
cnmodel/mechanisms/nacn.mod
Executable file
@@ -0,0 +1,103 @@
|
||||
TITLE nacn.mod A sodium conductance for a ventral cochlear nucleus neuron model
|
||||
|
||||
COMMENT
|
||||
|
||||
NEURON implementation of Jason Rothman's measurements of VCN conductances.
|
||||
|
||||
This file implements the average brain sodium current used in the Rothman model.
|
||||
In the absence of direct measurements in the VCN, this is a fair assumption.
|
||||
The model differs from the one used in Rothman et al, (1993) in that the steep
|
||||
voltage dependence of recovery from inactivation in that model is missing. This
|
||||
may affect the refractory period. To use the other model, use najsr.mod instead.
|
||||
|
||||
Original implementation by Paul B. Manis, April (JHU) and Sept, (UNC)1999.
|
||||
|
||||
File split implementaiton, April 1, 2004.
|
||||
|
||||
Does not pass modlunit.
|
||||
Should work at 22C and scales by Rothman and Manis, 2003c for temperature
|
||||
|
||||
Contact: pmanis@med.unc.edu
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX nacn
|
||||
USEION na READ ena WRITE ina
|
||||
RANGE gbar, gna, ina
|
||||
GLOBAL hinf, minf, htau, mtau
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius (degC) : 22 (degC) model is defined on measurements made at room temp in Baltimore
|
||||
dt (ms)
|
||||
ena (mV)
|
||||
gbar = 0.07958 (mho/cm2) <0,1e9>
|
||||
q10tau = 3.0 : q10 for rates
|
||||
}
|
||||
|
||||
STATE {
|
||||
m h
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
ina (mA/cm2)
|
||||
gna (mho/cm2)
|
||||
minf hinf
|
||||
mtau (ms) htau (ms)
|
||||
q10 ()
|
||||
|
||||
}
|
||||
|
||||
LOCAL mexp, hexp
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gna = gbar*(m^3)*h
|
||||
ina = gna*(v - ena)
|
||||
}
|
||||
|
||||
UNITSOFF
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
m = minf
|
||||
h = hinf
|
||||
}
|
||||
|
||||
DERIVATIVE states { :Computes state variables m, h, and n
|
||||
rates(v) : at the current v and dt.
|
||||
m' = (minf - m)/mtau : m = m + mexp*(minf-m)
|
||||
h' = (hinf - h)/htau : h = h + hexp*(hinf-h)
|
||||
|
||||
}
|
||||
|
||||
LOCAL qt
|
||||
|
||||
PROCEDURE rates(v) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
|
||||
q10 = q10tau^((celsius - 22)/10) : if you don't like room temp, it can be changed!
|
||||
|
||||
: average sodium channel
|
||||
minf = 1 / (1+exp(-(v + 38) / 7))
|
||||
hinf = 1 / (1+exp((v + 65) / 6))
|
||||
|
||||
mtau = (10 / (5*exp((v+60) / 18) + 36*exp(-(v+60) / 25))) + 0.04
|
||||
mtau = mtau/q10
|
||||
htau = (100 / (7*exp((v+60) / 11) + 10*exp(-(v+60) / 25))) + 0.6
|
||||
htau = htau/q10
|
||||
}
|
||||
|
||||
|
||||
UNITSON
|
||||
138
cnmodel/mechanisms/nacncoop.mod
Normal file
138
cnmodel/mechanisms/nacncoop.mod
Normal file
@@ -0,0 +1,138 @@
|
||||
TITLE nacn.mod A sodium conductance for a ventral cochlear nucleus neuron model
|
||||
|
||||
COMMENT
|
||||
|
||||
NEURON implementation of Jason Rothman's measurements of VCN conductances.
|
||||
|
||||
This file implements a modified version of the average brain sodium current
|
||||
used in the Rothman and Manis 2003 models.
|
||||
|
||||
The model differs from the one used in Rothman et al, (1993) in that the steep
|
||||
voltage dependence of recovery from inactivation in that model is missing. This
|
||||
may affect the refractory period. To use the other model, use jsrnaf.mod instead.
|
||||
|
||||
Original implementation by Paul B. Manis, April 1999 (JHU) and Sept 1999 (UNC-CH).
|
||||
|
||||
File split implementation, April 1, 2004.
|
||||
|
||||
|
||||
Version nacncoop implements a cooperative sodium channel model built on the kinetics
|
||||
of the original nacn model (R&M2003c). The motivation is to make a sodium channel with
|
||||
faster activation kinetics, by introducing cooperativity between a subset of channels.
|
||||
The model is based on concepts and implementation similar to Oz et al.
|
||||
J.Comp. Neurosci. 39: 63, 2015, and Huang et al., PloSOne 7:e37729, 2012.
|
||||
The cooperative channels are modeled with the same kinetics as the non-cooperative
|
||||
channels, but are treated as a separate subset (fraction: p). The cooperativity is
|
||||
introduced by shifting the voltage "seen" by the channels by KJ*m^3*h, which moves
|
||||
the channels to a faster regime (essentially, they experience a depolarized membrane
|
||||
potential that depends on their current gating state, relative to the main population
|
||||
of channels).
|
||||
|
||||
A subpopulation of Na channels (p [0..1]) experiences a small voltage-dependent shift
|
||||
in the gating kinetics. The shift is determined by KJ
|
||||
|
||||
This version does not have all the temperature scaling. Does not pass modlunit.
|
||||
Should work at 22C, appears to work at other temperatures ok.
|
||||
|
||||
Contact: pmanis@med.unc.edu
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
(nA) = (nanoamp)
|
||||
}
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX nacncoop
|
||||
USEION na READ ena WRITE ina
|
||||
RANGE gbar, gna, ina, p, KJ
|
||||
RANGE vsna : voltage shift parameter
|
||||
GLOBAL hinf, minf, htau, mtau, hinf2, minf2, htau2, mtau2
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius (degC) : 22 (degC) model is defined at room temp in Baltimore
|
||||
dt (ms)
|
||||
ena (mV)
|
||||
gbar = 0.07958 (mho/cm2) <0,1e9>
|
||||
q10 = 3.0 : q10 for rates
|
||||
p = 0.0 (): fraction of cooperative channels (0-1)
|
||||
KJ = 0 (mV) : coupling strength between cooperative channels (0-1000mV is usable range)
|
||||
: setting either KJ = 0 or p = 0 will remove cooperativity.
|
||||
vsna = 0 (mV)
|
||||
}
|
||||
|
||||
STATE {
|
||||
m h m2 h2
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
ina (mA/cm2)
|
||||
gna (mho/cm2)
|
||||
vNa (mV) : shifted V for cooperative behavior
|
||||
minf hinf minf2 hinf2
|
||||
mtau (ms) htau (ms) mtau2 (ms) htau2 (ms)
|
||||
|
||||
}
|
||||
|
||||
LOCAL mexp, hexp, mexp2, hexp2
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
|
||||
gna = gbar*(p*(m2^3*h2) + (1.-p)*(m^3)*h)
|
||||
ina = gna*(v - ena)
|
||||
}
|
||||
|
||||
UNITSOFF
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
m = minf
|
||||
h = hinf
|
||||
m2 = minf2
|
||||
h2 = hinf2
|
||||
vNa = v + vsna + KJ*m^3*h
|
||||
}
|
||||
|
||||
DERIVATIVE states { :Computes state variables m, h, and n
|
||||
rates(v) : at the current v and dt.
|
||||
m' = (minf - m)/mtau
|
||||
h' = (hinf - h)/htau
|
||||
m2' = (minf2 - m2)/mtau2
|
||||
h2' = (hinf2 - h2)/htau2
|
||||
vNa = v + vsna + KJ*m^3*h : note addition of vsna shift here so that we do not add it in rates
|
||||
}
|
||||
|
||||
LOCAL qt
|
||||
|
||||
PROCEDURE rates(v) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
|
||||
qt = q10^((celsius - 22)/10) : if you don't like room temp, it can be changed!
|
||||
|
||||
: average sodium channel
|
||||
minf = 1 / (1+exp(-(v + 38 + vsna) / 7))
|
||||
hinf = 1 / (1+exp((v + 65 + vsna) / 6))
|
||||
mtau = (10 / (5*exp((v + 60 + vsna) / 18) + 36*exp(-(v + 60+vsna) / 25))) + 0.04
|
||||
mtau = mtau/qt
|
||||
htau = (100 / (7*exp((v + 60 + vsna) / 11) + 10*exp(-(v + 60 + vsna) / 25))) + 0.6
|
||||
htau = htau/qt
|
||||
|
||||
: cooperative group of channels
|
||||
minf2 = 1 / (1+exp(-(vNa + 38) / 7))
|
||||
hinf2 = 1 / (1+exp((vNa + 65) / 6))
|
||||
mtau2 = (10 / (5*exp((vNa+60) / 18) + 36*exp(-(vNa+60) / 25))) + 0.04
|
||||
mtau2 = mtau2/qt
|
||||
htau2 = (100 / (7*exp((vNa+60) / 11) + 10*exp(-(vNa+60) / 25))) + 0.6
|
||||
htau2 = htau2/qt
|
||||
|
||||
}
|
||||
|
||||
UNITSON
|
||||
130
cnmodel/mechanisms/nap.mod
Executable file
130
cnmodel/mechanisms/nap.mod
Executable file
@@ -0,0 +1,130 @@
|
||||
TITLE nap.mod Persistent sodium conductance
|
||||
|
||||
COMMENT
|
||||
|
||||
|
||||
Persistent sodium current from deSchutter and Bower, J. Neurophys.
|
||||
71:375, 1994.
|
||||
|
||||
|
||||
2/10/02, 10/10/2014. P. Manis.
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
}
|
||||
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX nap
|
||||
USEION na READ ena WRITE ina
|
||||
|
||||
RANGE nap_inf, nap_tau, napi_inf, napi_tau
|
||||
RANGE gbar, gnap
|
||||
RANGE nap_A, nap_B, nap_C, nap_D, nap_E, nap_F, nap_G, nap_H
|
||||
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius (degC)
|
||||
dt (ms)
|
||||
ena (mV) : = 50.0 (mV)
|
||||
gbar = 0.00001 (mho/cm2) <0,1e9>
|
||||
q10tau = 3.0
|
||||
q10g = 2.0
|
||||
|
||||
nap_shift = 0 (mV)
|
||||
|
||||
nap_A = 200 (/ms): parameters from Bowers et al.
|
||||
nap_B = 1
|
||||
nap_C = -18 (mV)
|
||||
nap_D = -16 (mV)
|
||||
nap_E = 25 (/ms)
|
||||
nap_F = 1
|
||||
nap_G = 58 (mV)
|
||||
nap_H = 8 (mV)
|
||||
}
|
||||
|
||||
STATE {
|
||||
nap napi
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gnap (mho/cm2)
|
||||
ina (mA/cm2)
|
||||
nap_inf
|
||||
nap_tau (ms)
|
||||
nap_tau1 (/ms)
|
||||
nap_tau2 (/ms)
|
||||
napi_inf
|
||||
napi_tau (ms)
|
||||
napi_tau1 (/ms)
|
||||
napi_tau2 (/ms)
|
||||
qg () : computed q10 for gnabar based on q10g
|
||||
q10 ()
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gnap = gbar*nap*nap*nap*napi
|
||||
ina = gnap*(v-ena)
|
||||
}
|
||||
|
||||
|
||||
INITIAL {
|
||||
qg = q10g^((celsius-22)/10 (degC))
|
||||
q10 = q10tau^((celsius - 22)/10 (degC)) : if you don't like room temp, it can be changed!
|
||||
rates(v)
|
||||
nap = nap_inf
|
||||
napi = napi_inf
|
||||
}
|
||||
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
nap' = (nap_inf - nap) / nap_tau
|
||||
napi' = (napi_inf - napi) / napi_tau
|
||||
}
|
||||
|
||||
|
||||
PROCEDURE rates(v (mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
LOCAL x
|
||||
: "nap" persistent sodium system
|
||||
nap_inf = na_p(v + nap_shift)
|
||||
nap_tau1 = nap_A/(nap_B + exp((v + nap_shift + nap_C)/nap_D))
|
||||
nap_tau2 = nap_E/(nap_F + exp((v + nap_shift + nap_G)/nap_H))
|
||||
nap_tau = 1./(nap_tau1 + nap_tau2)
|
||||
|
||||
:nap_tau = na_ptau(v + nap_shift)
|
||||
|
||||
: "nap" persistent sodium system - inactivation...
|
||||
napi_inf = na_pi(v + nap_shift)
|
||||
napi_tau1 = (1 (/ms)) /(0.06435/(1+exp((v + nap_shift + 73.26415)/3.71928 (mV))))
|
||||
napi_tau2 = (0.13496 (/ms))/(1 +exp((v + nap_shift + 10.27853)/(-9.09334 (mV))))
|
||||
napi_tau = 1 /(napi_tau1 + napi_tau2)
|
||||
}
|
||||
|
||||
LOCAL p
|
||||
|
||||
FUNCTION na_p(v (mV)) { : persistent sodium activation
|
||||
: Bowers
|
||||
p = nap_A/(nap_B + exp((v + nap_shift + nap_C)/nap_D))
|
||||
na_p = p/(p+nap_E/(nap_F + exp((v + nap_shift + nap_G)/nap_H)))
|
||||
}
|
||||
|
||||
|
||||
FUNCTION na_pi(x (mV)) { : persistent sodium inactivation
|
||||
: Bowers
|
||||
na_pi = 0.06435/(1+exp((x+73.26415)/3.71928 (mV)))
|
||||
na_pi = na_pi/(na_pi + (0.13496/(1+exp((v+10.27853)/(-9.09334 (mV))))))
|
||||
}
|
||||
|
||||
|
||||
137
cnmodel/mechanisms/napyr.mod
Normal file
137
cnmodel/mechanisms/napyr.mod
Normal file
@@ -0,0 +1,137 @@
|
||||
TITLE pyrna.mod DCN pyramidal cell model sodium channel
|
||||
|
||||
COMMENT
|
||||
|
||||
Revised version of DCN Pyramidal cell model sodium channel
|
||||
|
||||
This model implements part of a Dorsal Cochlear Nucleus Pyramidal point cell
|
||||
based on kinetic data from Kanold and Manis (1999) and Kanold's dissertation (1999)
|
||||
|
||||
-- 15 Jan 1999 P. Manis
|
||||
|
||||
This mechanism is the fast sodium channel portion of the model.
|
||||
|
||||
|
||||
Orignal: 2/10/02. P. Manis.
|
||||
|
||||
Extraced from Pyr.mod, 7/24/2014.
|
||||
|
||||
ENDCOMMENT
|
||||
|
||||
|
||||
UNITS {
|
||||
(mA) = (milliamp)
|
||||
(mV) = (millivolt)
|
||||
}
|
||||
|
||||
|
||||
NEURON {
|
||||
THREADSAFE
|
||||
SUFFIX napyr
|
||||
USEION na READ ena WRITE ina
|
||||
RANGE gna, minf, hinf, ninf, gbar : sodium channels and delayed rectifier
|
||||
RANGE mtau, htau, ntau : time constants for sodium channels and delayed rectifier
|
||||
}
|
||||
|
||||
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
|
||||
|
||||
PARAMETER {
|
||||
v (mV)
|
||||
celsius (degC)
|
||||
dt (ms)
|
||||
ek (mV) : = -81.5 (mV)
|
||||
ena (mV) : = 50.0 (mV)
|
||||
gbar = 0.02857 (mho/cm2) <0,1e9>
|
||||
mtau0 = 0.05 (ms) <0.01,100>
|
||||
htau0 = 0.5 (ms) <0.1,100>
|
||||
ntau = 0.5 (ms) <0.1,100>
|
||||
}
|
||||
|
||||
STATE {
|
||||
m h
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
gna (mho/cm2)
|
||||
ina (mA/cm2)
|
||||
minf hinf mtau htau
|
||||
}
|
||||
|
||||
LOCAL mexp, hexp
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE states METHOD cnexp
|
||||
gna = gbar*m*m*h
|
||||
ina = gna*(v - ena)
|
||||
}
|
||||
|
||||
UNITSOFF
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
m = minf
|
||||
h = hinf
|
||||
}
|
||||
|
||||
DERIVATIVE states {
|
||||
rates(v)
|
||||
m' = (minf - m) / mtau
|
||||
h' = (hinf - h) / htau
|
||||
}
|
||||
|
||||
LOCAL q10
|
||||
|
||||
|
||||
PROCEDURE rates(v(mV)) { :Computes rate and other constants at current v.
|
||||
:Call once from HOC to initialize inf at resting v.
|
||||
LOCAL alpha, beta, sum
|
||||
TABLE minf, mtau, hinf, htau DEPEND celsius FROM -200 TO 100 WITH 400
|
||||
|
||||
UNITSOFF
|
||||
q10 = 3^((celsius - 22)/10)
|
||||
|
||||
: "m" sodium activation system
|
||||
minf = na_m(v)
|
||||
mtau = na_mt(v)
|
||||
|
||||
: "h" sodium inactivation system
|
||||
hinf = na_h(v)
|
||||
htau = na_ht(v)
|
||||
|
||||
}
|
||||
|
||||
: Make these as functions so we can view them from hoc, although this
|
||||
: may slow things down a bit
|
||||
|
||||
FUNCTION na_m(x) { : sodium activation
|
||||
na_m = 1/(1+exp(-(x+38)/3.0)) : POK version
|
||||
: na_m = alphbet(x,35,0,5,-10) :de Schutter (doesn't work well in our version)
|
||||
: na_m = na_m/(na_m + alphbet(x,7,0,65,20))
|
||||
}
|
||||
|
||||
FUNCTION na_mt(x) { : sodium activation with taus
|
||||
na_mt = mtau0 : flat time constants
|
||||
: na_mt = alphbet(x,35,0,5,-10)
|
||||
: na_mt = 1/(na_mt + alphbet(x,7,0,65,20))
|
||||
}
|
||||
|
||||
FUNCTION na_h(x) { : sodium inactivation
|
||||
na_h = 1/(1+exp((x+43)/3.0)) : flat time constants (POK version)
|
||||
: na_h = alphbet(x,0.225,1,80,10)
|
||||
: na_h = na_h/(na_h + alphbet(x,7.5,0,-3,-18))
|
||||
}
|
||||
|
||||
FUNCTION na_ht(x) { : sodium inactivation tau
|
||||
na_ht = htau0 : POK: flat time constants
|
||||
: na_ht = alphbet(x,0.225,1,80,10) : de Schutter version (doesn't work well with other stuff)
|
||||
: na_ht = 1/(na_ht + alphbet(x,7.5,0,-3,-18))
|
||||
}
|
||||
|
||||
|
||||
FUNCTION alphbet(x,A,B,C,D) { : alpha/beta general functions for
|
||||
: transcrbing GENESIS models
|
||||
alphbet = A/(B+exp((x+C)/D))
|
||||
}
|
||||
|
||||
UNITSON
|
||||
|
||||
17
cnmodel/mechanisms/pkjlk.mod
Normal file
17
cnmodel/mechanisms/pkjlk.mod
Normal file
@@ -0,0 +1,17 @@
|
||||
TITLE Purkinje Leak Current
|
||||
|
||||
: A passive purkinje cell leak current
|
||||
NEURON {
|
||||
SUFFIX lkpkj
|
||||
NONSPECIFIC_CURRENT i
|
||||
RANGE i, e, gbar
|
||||
}
|
||||
PARAMETER {
|
||||
gbar = 5e-5 (siemens/cm2) < 0, 1e9 >
|
||||
e = -60.5 (millivolt)
|
||||
}
|
||||
ASSIGNED {
|
||||
i (milliamp/cm2)
|
||||
v (millivolt)
|
||||
}
|
||||
BREAKPOINT { i = gbar*(v - e) }
|
||||
196
cnmodel/mechanisms/rsg.mod
Normal file
196
cnmodel/mechanisms/rsg.mod
Normal file
@@ -0,0 +1,196 @@
|
||||
TITLE Rsg sodium channel
|
||||
: Resurgent sodium channel (with blocking particle)
|
||||
: with updated kinetic parameters from Raman and Bean
|
||||
|
||||
NEURON {
|
||||
SUFFIX naRsg
|
||||
USEION na READ ena WRITE ina
|
||||
RANGE gna, gbar
|
||||
}
|
||||
|
||||
UNITS {
|
||||
(mV) = (millivolt)
|
||||
(S) = (siemens)
|
||||
}
|
||||
|
||||
PARAMETER {
|
||||
gbar = .015 (S/cm2)
|
||||
|
||||
: kinetic parameters
|
||||
Con = 0.005 (/ms) : closed -> inactivated transitions
|
||||
Coff = 0.5 (/ms) : inactivated -> closed transitions
|
||||
Oon = .75 (/ms) : open -> Ineg transition
|
||||
Ooff = 0.005 (/ms) : Ineg -> open transition
|
||||
alpha = 150 (/ms) : activation
|
||||
beta = 3 (/ms) : deactivation
|
||||
gamma = 150 (/ms) : opening
|
||||
delta = 40 (/ms) : closing, greater than BEAN/KUO = 0.2
|
||||
epsilon = 1.75 (/ms) : open -> Iplus for tau = 0.3 ms at +30 with x5
|
||||
zeta = 0.03 (/ms) : Iplus -> open for tau = 25 ms at -30 with x6
|
||||
|
||||
: Vdep
|
||||
x1 = 20 (mV) : Vdep of activation (alpha)
|
||||
x2 = -20 (mV) : Vdep of deactivation (beta)
|
||||
x3 = 1e12 (mV) : Vdep of opening (gamma)
|
||||
x4 = -1e12 (mV) : Vdep of closing (delta)
|
||||
x5 = 1e12 (mV) : Vdep into Ipos (epsilon)
|
||||
x6 = -25 (mV) : Vdep out of Ipos (zeta)
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
alfac : microscopic reversibility factors
|
||||
btfac
|
||||
|
||||
: rates
|
||||
f01 (/ms)
|
||||
f02 (/ms)
|
||||
f03 (/ms)
|
||||
f04 (/ms)
|
||||
f0O (/ms)
|
||||
fip (/ms)
|
||||
f11 (/ms)
|
||||
f12 (/ms)
|
||||
f13 (/ms)
|
||||
f14 (/ms)
|
||||
f1n (/ms)
|
||||
fi1 (/ms)
|
||||
fi2 (/ms)
|
||||
fi3 (/ms)
|
||||
fi4 (/ms)
|
||||
fi5 (/ms)
|
||||
fin (/ms)
|
||||
|
||||
b01 (/ms)
|
||||
b02 (/ms)
|
||||
b03 (/ms)
|
||||
b04 (/ms)
|
||||
b0O (/ms)
|
||||
bip (/ms)
|
||||
b11 (/ms)
|
||||
b12 (/ms)
|
||||
b13 (/ms)
|
||||
b14 (/ms)
|
||||
b1n (/ms)
|
||||
bi1 (/ms)
|
||||
bi2 (/ms)
|
||||
bi3 (/ms)
|
||||
bi4 (/ms)
|
||||
bi5 (/ms)
|
||||
bin (/ms)
|
||||
|
||||
v (mV)
|
||||
ena (mV)
|
||||
ina (milliamp/cm2)
|
||||
gna (S/cm2)
|
||||
}
|
||||
|
||||
STATE {
|
||||
C1 FROM 0 TO 1
|
||||
C2 FROM 0 TO 1
|
||||
C3 FROM 0 TO 1
|
||||
C4 FROM 0 TO 1
|
||||
C5 FROM 0 TO 1
|
||||
I1 FROM 0 TO 1
|
||||
I2 FROM 0 TO 1
|
||||
I3 FROM 0 TO 1
|
||||
I4 FROM 0 TO 1
|
||||
I5 FROM 0 TO 1
|
||||
O FROM 0 TO 1
|
||||
B FROM 0 TO 1
|
||||
I6 FROM 0 TO 1
|
||||
}
|
||||
|
||||
BREAKPOINT {
|
||||
SOLVE activation METHOD sparse
|
||||
gna = gbar * O : O is "open state"
|
||||
ina = gna * (v - ena)
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
rates(v)
|
||||
SOLVE seqinitial
|
||||
}
|
||||
|
||||
KINETIC activation
|
||||
{
|
||||
rates(v)
|
||||
~ C1 <-> C2 (f01,b01)
|
||||
~ C2 <-> C3 (f02,b02)
|
||||
~ C3 <-> C4 (f03,b03)
|
||||
~ C4 <-> C5 (f04,b04)
|
||||
~ C5 <-> O (f0O,b0O)
|
||||
~ O <-> B (fip,bip)
|
||||
~ O <-> I6 (fin,bin)
|
||||
~ I1 <-> I2 (f11,b11)
|
||||
~ I2 <-> I3 (f12,b12)
|
||||
~ I3 <-> I4 (f13,b13)
|
||||
~ I4 <-> I5 (f14,b14)
|
||||
~ I5 <-> I6 (f1n,b1n)
|
||||
~ C1 <-> I1 (fi1,bi1)
|
||||
~ C2 <-> I2 (fi2,bi2)
|
||||
~ C3 <-> I3 (fi3,bi3)
|
||||
~ C4 <-> I4 (fi4,bi4)
|
||||
~ C5 <-> I5 (fi5,bi5)
|
||||
|
||||
CONSERVE C1 + C2 + C3 + C4 + C5 + O + B + I1 + I2 + I3 + I4 + I5 + I6 = 1
|
||||
}
|
||||
|
||||
LINEAR seqinitial { : sets initial equilibrium
|
||||
~ I1*bi1 + C2*b01 - C1*( fi1+f01) = 0
|
||||
~ C1*f01 + I2*bi2 + C3*b02 - C2*(b01+fi2+f02) = 0
|
||||
~ C2*f02 + I3*bi3 + C4*b03 - C3*(b02+fi3+f03) = 0
|
||||
~ C3*f03 + I4*bi4 + C5*b04 - C4*(b03+fi4+f04) = 0
|
||||
~ C4*f04 + I5*bi5 + O*b0O - C5*(b04+fi5+f0O) = 0
|
||||
~ C5*f0O + B*bip + I6*bin - O*(b0O+fip+fin) = 0
|
||||
~ O*fip + B*bip = 0
|
||||
|
||||
~ C1*fi1 + I2*b11 - I1*( bi1+f11) = 0
|
||||
~ I1*f11 + C2*fi2 + I3*b12 - I2*(b11+bi2+f12) = 0
|
||||
~ I2*f12 + C3*fi3 + I4*bi3 - I3*(b12+bi3+f13) = 0
|
||||
~ I3*f13 + C4*fi4 + I5*b14 - I4*(b13+bi4+f14) = 0
|
||||
~ I4*f14 + C5*fi5 + I6*b1n - I5*(b14+bi5+f1n) = 0
|
||||
|
||||
~ C1 + C2 + C3 + C4 + C5 + O + B + I1 + I2 + I3 + I4 + I5 + I6 = 1
|
||||
}
|
||||
|
||||
PROCEDURE rates(v(mV) )
|
||||
{
|
||||
alfac = (Oon/Con)^(1/4)
|
||||
btfac = (Ooff/Coff)^(1/4)
|
||||
f01 = 4 * alpha * exp(v/x1)
|
||||
f02 = 3 * alpha * exp(v/x1)
|
||||
f03 = 2 * alpha * exp(v/x1)
|
||||
f04 = 1 * alpha * exp(v/x1)
|
||||
f0O = gamma * exp(v/x3)
|
||||
fip = epsilon * exp(v/x5)
|
||||
f11 = 4 * alpha * alfac * exp(v/x1)
|
||||
f12 = 3 * alpha * alfac * exp(v/x1)
|
||||
f13 = 2 * alpha * alfac * exp(v/x1)
|
||||
f14 = 1 * alpha * alfac * exp(v/x1)
|
||||
f1n = gamma * exp(v/x3)
|
||||
fi1 = Con
|
||||
fi2 = Con * alfac
|
||||
fi3 = Con * alfac^2
|
||||
fi4 = Con * alfac^3
|
||||
fi5 = Con * alfac^4
|
||||
fin = Oon
|
||||
|
||||
b01 = 1 * beta * exp(v/x2)
|
||||
b02 = 2 * beta * exp(v/x2)
|
||||
b03 = 3 * beta * exp(v/x2)
|
||||
b04 = 4 * beta * exp(v/x2)
|
||||
b0O = delta * exp(v/x4)
|
||||
bip = zeta * exp(v/x6)
|
||||
b11 = 1 * beta * btfac * exp(v/x2)
|
||||
b12 = 2 * beta * btfac * exp(v/x2)
|
||||
b13 = 3 * beta * btfac * exp(v/x2)
|
||||
b14 = 4 * beta * btfac * exp(v/x2)
|
||||
b1n = delta * exp(v/x4)
|
||||
bi1 = Coff
|
||||
bi2 = Coff * btfac
|
||||
bi3 = Coff * btfac^2
|
||||
bi4 = Coff * btfac^3
|
||||
bi5 = Coff * btfac^4
|
||||
bin = Ooff
|
||||
}
|
||||
|
||||
40
cnmodel/mechanisms/tests/test_mechanisms.py
Normal file
40
cnmodel/mechanisms/tests/test_mechanisms.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import numpy as np
|
||||
from neuron import h
|
||||
from cnmodel.util import reset
|
||||
|
||||
|
||||
def test_max_open_probability():
|
||||
reset(
|
||||
raiseError=False
|
||||
) # reset() fails as unable to remove all neuron objects, unless we ignore the error
|
||||
sec = h.Section()
|
||||
|
||||
# Create AMPA and NMDA mechanisms
|
||||
# AMPA uses mode=0; no rectification
|
||||
apsd = h.AMPATRUSSELL(0.5, sec=sec)
|
||||
# For NMDA we will hold the cell at +40 mV
|
||||
npsd = h.NMDA_Kampa(0.5, sec=sec)
|
||||
|
||||
# And a presynaptic terminal to provide XMTR input
|
||||
term = h.MultiSiteSynapse(0.5, sec=sec)
|
||||
term.nZones = 1
|
||||
h.setpointer(term._ref_XMTR[0], "XMTR", apsd)
|
||||
h.setpointer(term._ref_XMTR[0], "XMTR", npsd)
|
||||
|
||||
h.celsius = 34.0
|
||||
h.finitialize()
|
||||
op = [[], []]
|
||||
for i in range(100):
|
||||
# force very high transmitter concentration for every timestep
|
||||
term.XMTR[0] = 10000
|
||||
sec.v = 40.0
|
||||
h.fadvance()
|
||||
op[0].append(apsd.Open)
|
||||
op[1].append(npsd.Open)
|
||||
|
||||
assert np.allclose(max(op[0]), apsd.MaxOpen)
|
||||
assert np.allclose(max(op[1]), npsd.MaxOpen)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_max_open_probability()
|
||||
72
cnmodel/mechanisms/vecevent.mod
Normal file
72
cnmodel/mechanisms/vecevent.mod
Normal file
@@ -0,0 +1,72 @@
|
||||
: Vector stream of events
|
||||
: From NEURON source: nrn/examples/nrniv/netcon/vecevent.mod
|
||||
|
||||
NEURON {
|
||||
ARTIFICIAL_CELL VecStim
|
||||
}
|
||||
|
||||
ASSIGNED {
|
||||
index
|
||||
etime (ms)
|
||||
space
|
||||
}
|
||||
|
||||
INITIAL {
|
||||
index = 0
|
||||
element()
|
||||
if (index > 0) {
|
||||
net_send(etime - t, 1)
|
||||
}
|
||||
}
|
||||
|
||||
NET_RECEIVE (w) {
|
||||
if (flag == 1) {
|
||||
net_event(t)
|
||||
element()
|
||||
if (index > 0) {
|
||||
net_send(etime - t, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VERBATIM
|
||||
extern double* vector_vec();
|
||||
extern int vector_capacity();
|
||||
extern void* vector_arg();
|
||||
ENDVERBATIM
|
||||
|
||||
PROCEDURE element() {
|
||||
VERBATIM
|
||||
{ void* vv; int i, size; double* px;
|
||||
i = (int)index;
|
||||
if (i >= 0) {
|
||||
vv = *((void**)(&space));
|
||||
if (vv) {
|
||||
size = vector_capacity(vv);
|
||||
px = vector_vec(vv);
|
||||
if (i < size) {
|
||||
etime = px[i];
|
||||
index += 1.;
|
||||
}else{
|
||||
index = -1.;
|
||||
}
|
||||
}else{
|
||||
index = -1.;
|
||||
}
|
||||
}
|
||||
}
|
||||
ENDVERBATIM
|
||||
}
|
||||
|
||||
PROCEDURE play() {
|
||||
VERBATIM
|
||||
void** vv;
|
||||
vv = (void**)(&space);
|
||||
*vv = (void*)0;
|
||||
if (ifarg(1)) {
|
||||
*vv = vector_arg(1);
|
||||
}
|
||||
ENDVERBATIM
|
||||
}
|
||||
|
||||
|
||||
12
cnmodel/morphology/__init__.py
Executable file
12
cnmodel/morphology/__init__.py
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/python
|
||||
#
|
||||
# Morphology definitions for models.
|
||||
#
|
||||
# This file includes readers for
|
||||
#
|
||||
# Paul B. Manis, Ph.D. 2009 (August - November 2009)
|
||||
#
|
||||
from neuron import h
|
||||
|
||||
from .morphology import Morphology
|
||||
from .hoc_reader import HocReader
|
||||
90
cnmodel/morphology/bushy_stick.hoc
Normal file
90
cnmodel/morphology/bushy_stick.hoc
Normal file
@@ -0,0 +1,90 @@
|
||||
objref soma
|
||||
soma = new SectionList()
|
||||
objref primarydendrite
|
||||
primarydendrite = new SectionList()
|
||||
objref secondarydendrite
|
||||
secondarydendrite = new SectionList()
|
||||
objref hillock
|
||||
hillock = new SectionList()
|
||||
objref unmyelinatedaxon
|
||||
unmyelinatedaxon = new SectionList()
|
||||
objref myelinatedaxon
|
||||
myelinatedaxon = new SectionList()
|
||||
|
||||
create sections[9]
|
||||
access sections[0]
|
||||
soma.append()
|
||||
sections[0] {
|
||||
pt3dadd(0., 0., 0., 25.)
|
||||
pt3dadd(0., 25., 0., 25.)
|
||||
}
|
||||
|
||||
// axon hillock, 15 microns long, tapered
|
||||
access sections[1]
|
||||
hillock.append()
|
||||
connect sections[1](0), sections[0](0)
|
||||
sections[1] {
|
||||
pt3dadd(0., 0., 0., 2.5)
|
||||
pt3dadd(0., -15., 0., 1.0)
|
||||
}
|
||||
|
||||
// initial segment, unmyelinated, 10 microns long, not tapering
|
||||
access sections[2]
|
||||
unmyelinatedaxon.append()
|
||||
connect sections[2](0), sections[1](1)
|
||||
sections[2] {
|
||||
pt3dadd(0., -15., 0., 1.0)
|
||||
pt3dadd(0., -25., 0., 1.0)
|
||||
|
||||
}
|
||||
|
||||
// beginning of myelinated axon, 20 micron, enlarging with distance
|
||||
access sections[3]
|
||||
myelinatedaxon.append()
|
||||
connect sections[3](0), sections[2](1)
|
||||
sections[3] {
|
||||
pt3dadd(0., -25., 0., 1.0)
|
||||
pt3dadd(0., -45., 0., 2.0)
|
||||
|
||||
}
|
||||
|
||||
access sections[4]
|
||||
primarydendrite.append()
|
||||
connect sections[4](0), sections[0](1)
|
||||
sections[4] {
|
||||
pt3dadd(0., 25., 0., 3.0)
|
||||
pt3dadd(0., 45., 0., 2.0)
|
||||
}
|
||||
|
||||
access sections[5]
|
||||
secondarydendrite.append()
|
||||
connect sections[5](0), sections[4](1)
|
||||
sections [5] {
|
||||
pt3dadd(0., 45., 0., 2.0)
|
||||
pt3dadd(0., 55., -50., 1.5)
|
||||
}
|
||||
|
||||
access sections[6]
|
||||
secondarydendrite.append()
|
||||
connect sections[6](0), sections[4](1)
|
||||
sections [6] {
|
||||
pt3dadd(0., 45., 0., 2.0)
|
||||
pt3dadd(0., 55., 50., 1.5)
|
||||
}
|
||||
|
||||
access sections[7]
|
||||
secondarydendrite.append()
|
||||
connect sections[7](0), sections[4](1)
|
||||
sections [7] {
|
||||
pt3dadd(0., 45., 0., 2.0)
|
||||
pt3dadd(-50., 55., 0., 1.5)
|
||||
}
|
||||
|
||||
access sections[8]
|
||||
secondarydendrite.append()
|
||||
connect sections[8](0), sections[4](1)
|
||||
sections [8] {
|
||||
pt3dadd(0., 45., 0., 2.0)
|
||||
pt3dadd(50., 55., 0, 1.5)
|
||||
}
|
||||
|
||||
622
cnmodel/morphology/hoc_reader.py
Normal file
622
cnmodel/morphology/hoc_reader.py
Normal file
@@ -0,0 +1,622 @@
|
||||
from __future__ import print_function
|
||||
from neuron import h
|
||||
import neuron
|
||||
import collections
|
||||
import numpy as np
|
||||
import pyqtgraph as pg
|
||||
import os
|
||||
import re
|
||||
import os.path
|
||||
|
||||
try:
|
||||
basestring
|
||||
except NameError:
|
||||
basestring = str
|
||||
|
||||
|
||||
class HocReader(object):
|
||||
def __init__(self, hoc):
|
||||
"""
|
||||
Provides useful methods for reading hoc structures.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
hoc : :obj: `hoc` or str
|
||||
Either a hoc object that hs been already created, or a string that defines a hoc file name.
|
||||
"""
|
||||
|
||||
self.file_loaded = False
|
||||
if isinstance(hoc, basestring):
|
||||
fullfile = os.path.join(os.getcwd(), hoc)
|
||||
if not os.path.isfile(fullfile):
|
||||
raise Exception("File not found: %s" % (fullfile))
|
||||
neuron.h.hoc_stdout(
|
||||
"/dev/null"
|
||||
) # prevent junk from printing while reading the file
|
||||
success = neuron.h.load_file(str(fullfile))
|
||||
neuron.h.hoc_stdout()
|
||||
if success == 0: # indicates failure to read the file
|
||||
raise NameError("Found file, but NEURON load failed: %s" % (fullfile))
|
||||
self.file_loaded = True
|
||||
self.h = h # save a copy of the hoc object itself.
|
||||
else:
|
||||
self.h = hoc # just use the passed argument
|
||||
self.file_loaded = True
|
||||
|
||||
# geometry containers
|
||||
self.edges = None
|
||||
self.vertexes = None
|
||||
|
||||
# all sections in the hoc {sec_name: hoc Section}
|
||||
self.sections = collections.OrderedDict()
|
||||
# {sec_name: index} indicates index into self.sections.values() where
|
||||
# Section can be found.
|
||||
self.sec_index = {}
|
||||
# {sec_name: [mechanism, ...]}
|
||||
self.mechanisms = collections.OrderedDict()
|
||||
# {sec_group_name: set(sec_name, ...)}
|
||||
self.sec_groups = {}
|
||||
|
||||
# topology {section: (parent, [children,...])}
|
||||
self.topology = {}
|
||||
|
||||
# populate self.sections, self.sec_index, and self.mechanisms
|
||||
self.read_section_info()
|
||||
|
||||
# auto-generate section groups based on either hoc section lists, or
|
||||
# on section name prefixes.
|
||||
sec_lists = self.get_section_lists()
|
||||
sec_prefixes = self.get_section_prefixes()
|
||||
|
||||
# Add groupings by section list if possible:
|
||||
if len(sec_lists) > 1:
|
||||
self.add_groups_by_section_list(sec_lists)
|
||||
|
||||
# Otherwise, try section prefixes
|
||||
elif len(sec_prefixes) > 1:
|
||||
for group, sections in sec_prefixes.items():
|
||||
self.add_section_group(group, sections)
|
||||
|
||||
# generate topology
|
||||
self._generate_topology()
|
||||
|
||||
def get_section(self, sec_name):
|
||||
"""
|
||||
Get the section associated with the section name
|
||||
|
||||
Parameters
|
||||
----------
|
||||
sec_name : str
|
||||
The name of the section object.
|
||||
|
||||
Returns
|
||||
-------
|
||||
The hoc Section object with the given name.
|
||||
|
||||
"""
|
||||
try:
|
||||
return self.sections[sec_name]
|
||||
except KeyError:
|
||||
raise KeyError("No section named '%s'" % sec_name)
|
||||
|
||||
def get_section_prefixes(self):
|
||||
"""
|
||||
Go through all the sections and generate a dictionary mapping their
|
||||
name prefixes to the list of sections with that prefix.
|
||||
|
||||
For example, with sections names axon[0], axon[1], ais[0], and soma[0],
|
||||
we would generate the following structure:
|
||||
|
||||
{'axon': ['axon[0]', 'axon[1]'],
|
||||
'ais': ['ais[0]'],
|
||||
'soma': ['soma[0]']}
|
||||
"""
|
||||
prefixes = {}
|
||||
regex = re.compile("(?P<prefix>\w+)\[(\d*)\]")
|
||||
for sec_name in self.sections:
|
||||
g = regex.match(sec_name)
|
||||
if g is None:
|
||||
continue
|
||||
prefix = g.group("prefix")
|
||||
prefixes.setdefault(prefix, []).append(sec_name)
|
||||
return prefixes
|
||||
|
||||
def get_mechanisms(self, section):
|
||||
"""
|
||||
Get a set of all of the mechanisms inserted into a given section
|
||||
|
||||
Parameters
|
||||
----------
|
||||
section : :obj: `NEURON section`
|
||||
The NEURON section object.
|
||||
|
||||
Returns
|
||||
-------
|
||||
A list of mechanism names
|
||||
|
||||
"""
|
||||
return self.mechanisms[section]
|
||||
|
||||
def get_density(self, section, mechanism):
|
||||
"""
|
||||
Get density mechanism that may be found the section.
|
||||
mechanism is a list ['name', 'gbarname']. This is needed because
|
||||
some mechanisms do not adhere to any convention and may have a different
|
||||
kind of 'gbarname' than 'gbar<name>_mechname'
|
||||
returns the average of the conductance density, as that may range across different
|
||||
values in a section (e.g., can vary by segments)
|
||||
|
||||
Parameters
|
||||
----------
|
||||
section : :obj: `NEURON section`
|
||||
The NEURON section object.
|
||||
mechanism : list
|
||||
mechanism is a list ['name', 'gbarname']. It is used to
|
||||
retrieve the mechanism density from HOC as
|
||||
`segment.name.gbarname`.
|
||||
|
||||
Returns
|
||||
-------
|
||||
Mean conductance of the selected mechanism in the section, averaged across all segments of the section.
|
||||
"""
|
||||
|
||||
gmech = []
|
||||
for seg in section:
|
||||
try:
|
||||
x = getattr(seg, mechanism[0])
|
||||
mecbar = "%s_%s" % (mechanism[1], mechanism[0])
|
||||
if mecbar in dir(x):
|
||||
gmech.append(getattr(x, mechanism[1]))
|
||||
else:
|
||||
print(
|
||||
"hoc_reader:get_density did not find the mechanism in dir x",
|
||||
dir(x),
|
||||
)
|
||||
except NameError:
|
||||
return 0.0
|
||||
except:
|
||||
print("hoc_reader:get_density failed to evaluate the mechanisms... ")
|
||||
raise
|
||||
|
||||
# print gmech
|
||||
if len(gmech) == 0:
|
||||
gmech = 0.0
|
||||
return np.mean(gmech)
|
||||
|
||||
def get_sec_info(self, section, html=False):
|
||||
"""
|
||||
Get the info of the given section
|
||||
modified from: neuronvisio
|
||||
|
||||
Parameters
|
||||
----------
|
||||
section : :obj: `NEURON section`
|
||||
The NEURON section object.
|
||||
|
||||
Returns
|
||||
-------
|
||||
str
|
||||
containing the information, with html formatting.
|
||||
"""
|
||||
if html:
|
||||
br = " <b>"
|
||||
bre = "</b>"
|
||||
lbrk = "<br/>"
|
||||
li = "<li>"
|
||||
lie = "</li>"
|
||||
else:
|
||||
br = " "
|
||||
bre = ""
|
||||
li = ""
|
||||
lie = ""
|
||||
lbrk = "\n"
|
||||
info = f"{br:s}Section Name:{bre:s} {section.name():s}{lbrk:s}"
|
||||
info += f"{br:s}Length [um]:{bre:s} {section.L:f}{lbrk:s}"
|
||||
info += f"{br:s}Diameter [um]:{bre:s} {section.diam:f}{lbrk:s}"
|
||||
info += f"{br:s}Membrane Capacitance:{bre:s} {section.cm:f}{lbrk:s}"
|
||||
info += f"{br:s}Axial Resistance :{bre:s} {section.Ra:f}{lbrk:s}"
|
||||
info += f"{br:s}Number of Segments:{bre:s} {section.nseg:f}{lbrk:s}"
|
||||
mechs = []
|
||||
for seg in section:
|
||||
for mech in seg:
|
||||
mechs.append(mech.name())
|
||||
mechs = set(mechs) # Excluding the repeating ones
|
||||
|
||||
mech_info = f"{br:s}Mechanisms in the section{bre:s}{lbrk:s}"
|
||||
for mech_name in mechs:
|
||||
s = f"{li:s} {mech_name:s} {lie:s}"
|
||||
mech_info += s
|
||||
info += mech_info
|
||||
return info
|
||||
|
||||
def read_section_info(self):
|
||||
"""
|
||||
Read all the information about the sections in the current hoc file
|
||||
Stores the result in the mechanisms class variable.
|
||||
"""
|
||||
# Collect list of all sections and their mechanism names.
|
||||
self.sections = collections.OrderedDict()
|
||||
self.mechanisms = collections.OrderedDict()
|
||||
for i, sec in enumerate(self.h.allsec()):
|
||||
self.sections[sec.name()] = sec
|
||||
self.sec_index[sec.name()] = i
|
||||
mechs = set()
|
||||
for seg in sec:
|
||||
for mech in seg:
|
||||
mechs.add(mech.name())
|
||||
self.mechanisms[sec.name()] = mechs
|
||||
|
||||
def hoc_namespace(self):
|
||||
"""
|
||||
Get a dict of the HOC namespace {'variable_name': hoc_object}.
|
||||
NOTE: this method requires NEURON >= 7.3
|
||||
"""
|
||||
names = {}
|
||||
for hvar in dir(self.h): # look through the whole list, no other way
|
||||
try:
|
||||
# some variables can't be pointed to...
|
||||
if hvar in [
|
||||
"nseg",
|
||||
"diam_changed",
|
||||
"nrn_shape_changed_",
|
||||
"secondorder",
|
||||
"stoprun",
|
||||
]:
|
||||
continue
|
||||
u = getattr(self.h, hvar)
|
||||
names[hvar] = u
|
||||
except:
|
||||
continue
|
||||
return names
|
||||
|
||||
def find_hoc_hname(self, regex):
|
||||
"""
|
||||
Find hoc names matching a pattern
|
||||
|
||||
Parameters
|
||||
----------
|
||||
regex : str
|
||||
Regular expression (Python Re module) to search for.
|
||||
|
||||
Returns
|
||||
-------
|
||||
list
|
||||
The names of HOC objects whose *hname* matches regex.
|
||||
"""
|
||||
objs = []
|
||||
ns = self.hoc_namespace()
|
||||
for n, v in ns.items():
|
||||
try:
|
||||
hname = v.hname()
|
||||
if re.match(regex, hname):
|
||||
objs.append(n)
|
||||
except:
|
||||
continue
|
||||
return objs
|
||||
|
||||
def add_section_group(self, name, sections, overwrite=False):
|
||||
"""
|
||||
Declare a grouping of sections (or section names). Sections may be
|
||||
grouped by any arbitrary criteria (cell, anatomical type, etc).
|
||||
|
||||
Parameters
|
||||
----------
|
||||
name : str
|
||||
name of the section group
|
||||
sections: list
|
||||
section names or hoc Section objects.
|
||||
|
||||
"""
|
||||
if name in self.sec_groups and not overwrite:
|
||||
raise Exception(
|
||||
"Group name %s is already used (use overwrite=True)." % name
|
||||
)
|
||||
|
||||
group = set()
|
||||
for sec in sections:
|
||||
if not isinstance(sec, basestring):
|
||||
sec = sec.name()
|
||||
group.add(sec)
|
||||
self.sec_groups[name] = group
|
||||
|
||||
def get_section_group(self, name):
|
||||
"""
|
||||
Get a section group by name
|
||||
Parameters
|
||||
----------
|
||||
name : str
|
||||
name of the group (dendrite, for example)
|
||||
|
||||
Returns
|
||||
-------
|
||||
The set of section names in the group *name*.
|
||||
|
||||
"""
|
||||
return self.sec_groups[name]
|
||||
|
||||
def get_section_lists(self):
|
||||
"""
|
||||
Search through all of the hoc variables to find those that are "SectionLists"
|
||||
"""
|
||||
return self.find_hoc_hname(regex=r"SectionList\[")
|
||||
# ns = self.hoc_namespace()
|
||||
# return [name for name in ns if ns[name].hname().startswith('SectionList[')]
|
||||
|
||||
def add_groups_by_section_list(self, names):
|
||||
"""
|
||||
Add a new section groups from the hoc variables indicated in *names*.
|
||||
|
||||
Parameters
|
||||
-----------
|
||||
names : list
|
||||
List containing variable names as strings. Each name must refer to a list of
|
||||
Sections in hoc. If a dict is supplied instead, then it
|
||||
maps {hoc_list_name: section_group_name}.
|
||||
|
||||
Side effects (modifies)
|
||||
-----------------------
|
||||
calls add_section_group
|
||||
|
||||
"""
|
||||
# if a list is supplied, then the names of groups to create are
|
||||
# exactly the same as the names of hoc lists.
|
||||
if not isinstance(names, dict):
|
||||
names = {name: name for name in names}
|
||||
for hoc_name, group_name in names.items():
|
||||
var = getattr(self.h, hoc_name)
|
||||
self.add_section_group(group_name, list(var))
|
||||
|
||||
def get_geometry(self):
|
||||
"""
|
||||
modified from:neuronvisio
|
||||
Generate structures that describe the geometry of the sections and their segments (all segments are returned)
|
||||
|
||||
Returns
|
||||
-------
|
||||
vertexes : record array containing {pos: (x,y,z), dia, sec_id}
|
||||
for each segment.
|
||||
edges : array of pairs indicating the indexes of connected
|
||||
vertexes.
|
||||
Side effects
|
||||
------------
|
||||
Modifies vertexes and edges.
|
||||
|
||||
"""
|
||||
|
||||
# return cached geometry if this method has already run.
|
||||
if self.vertexes is not None:
|
||||
return self.vertexes, self.edges
|
||||
|
||||
self.h.define_shape()
|
||||
|
||||
# map segments (lines) to the section that contains them
|
||||
self.segment_to_section = {}
|
||||
|
||||
vertexes = []
|
||||
connections = []
|
||||
|
||||
for secid, sec in enumerate(self.sections.values()):
|
||||
x_sec, y_sec, z_sec, d_sec = self.retrieve_coordinate(sec)
|
||||
|
||||
for i, xi in enumerate(x_sec):
|
||||
vertexes.append(((x_sec[i], y_sec[i], z_sec[i]), d_sec[i], secid))
|
||||
indx_geom_seg = len(vertexes) - 1
|
||||
if len(vertexes) > 1 and i > 0:
|
||||
connections.append([indx_geom_seg, indx_geom_seg - 1])
|
||||
|
||||
self.edges = np.array(connections)
|
||||
self.vertexes = np.empty(
|
||||
len(vertexes), dtype=[("pos", float, 3), ("dia", float), ("sec_index", int)]
|
||||
)
|
||||
self.vertexes[:] = vertexes
|
||||
return self.vertexes, self.edges
|
||||
|
||||
def retrieve_coordinate(self, section):
|
||||
"""Retrieve the coordinates of a section avoiding duplicates
|
||||
|
||||
Parameters
|
||||
----------
|
||||
section : :obj: `NEURON section`
|
||||
The NEURON section object.
|
||||
|
||||
Returns
|
||||
-------
|
||||
array
|
||||
arrays of x, y, z, d for all the segments of the specified section.
|
||||
|
||||
"""
|
||||
|
||||
section.push()
|
||||
x, y, z, d = [], [], [], []
|
||||
|
||||
tot_points = 0
|
||||
connect_next = False
|
||||
for i in range(int(self.h.n3d())):
|
||||
present = False
|
||||
x_i = self.h.x3d(i)
|
||||
y_i = self.h.y3d(i)
|
||||
z_i = self.h.z3d(i)
|
||||
d_i = self.h.diam3d(i)
|
||||
# Avoiding duplicates in the sec
|
||||
if x_i in x:
|
||||
ind = len(x) - 1 - x[::-1].index(x_i) # Getting the index of last value
|
||||
if y_i == y[ind]:
|
||||
if z_i == z[ind]:
|
||||
present = True
|
||||
|
||||
if not present:
|
||||
k = (x_i, y_i, z_i)
|
||||
x.append(x_i)
|
||||
y.append(y_i)
|
||||
z.append(z_i)
|
||||
d.append(d_i)
|
||||
self.h.pop_section()
|
||||
return (np.array(x), np.array(y), np.array(z), np.array(d))
|
||||
|
||||
def _generate_topology(self):
|
||||
for name, sec in self.sections.items():
|
||||
sref = self.h.SectionRef(sec=sec)
|
||||
parent = sref.parent().sec.name() if sref.has_parent() else None
|
||||
if name not in self.topology:
|
||||
self.topology[name] = [None, []]
|
||||
self.topology[name][0] = parent
|
||||
if parent is not None:
|
||||
if parent not in self.topology:
|
||||
self.topology[parent] = [None, []]
|
||||
self.topology[parent][1].append(name)
|
||||
|
||||
def get_branch(self, root):
|
||||
"""
|
||||
Return all sections in a branch, starting with root.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
root : :obj: `NEURON section`
|
||||
The NEURON section object.
|
||||
|
||||
"""
|
||||
branch = [root]
|
||||
childs = [root]
|
||||
while len(childs) > 0:
|
||||
new_childs = []
|
||||
for ch in childs:
|
||||
new_childs.extend(self.topology[ch][1])
|
||||
childs = new_childs
|
||||
branch.extend(childs)
|
||||
return branch
|
||||
|
||||
def translate_branch(self, root, dx):
|
||||
"""
|
||||
Move the branch beginning at *root* by *dx*.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
root : :obj: `NEURON section`
|
||||
The NEURON section object.
|
||||
dx : array
|
||||
Which must be an array of length 3 defining the translation.
|
||||
|
||||
"""
|
||||
self.get_geometry()
|
||||
dx[np.newaxis, :]
|
||||
for name in self.get_branch(root):
|
||||
sid = self.sec_index[name]
|
||||
mask = self.vertexes["sec_index"] == sid
|
||||
self.vertexes["pos"][mask] += dx
|
||||
|
||||
def make_volume_data(self, resolution=1.0, max_size=500e6):
|
||||
"""
|
||||
Using the current state of vertexes, edges, generates a scalar field
|
||||
useful for building isosurface or volumetric renderings.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
resolution: float, default=1.0 microns
|
||||
width (um) of a single voxel in the scalar field.
|
||||
max_size: int
|
||||
maximum allowed scalar field size (bytes).
|
||||
Returns
|
||||
-------
|
||||
* 3D scalar field indicating distance from nearest membrane,
|
||||
* 3D field indicating section IDs of nearest membrane,
|
||||
* QTransform that maps from 3D array indexes to original vertex
|
||||
coordinates.
|
||||
"""
|
||||
vertexes, lines = self.get_geometry()
|
||||
|
||||
maxdia = vertexes["dia"].max() # maximum diameter (defines shape of kernel)
|
||||
kernel_size = int(maxdia / resolution) + 3 # width of kernel
|
||||
|
||||
# read vertex data
|
||||
pos = vertexes["pos"]
|
||||
d = vertexes["dia"]
|
||||
sec_id = vertexes["sec_index"]
|
||||
|
||||
# decide on dimensions of scalar field
|
||||
mx = pos.max(axis=0)
|
||||
mn = pos.min(axis=0)
|
||||
diff = mx - mn
|
||||
shape = tuple((diff / resolution + kernel_size).astype(int))
|
||||
|
||||
# prepare blank scalar field for drawing
|
||||
size = np.dtype(np.float32).itemsize * shape[0] * shape[1] * shape[2]
|
||||
if size > max_size:
|
||||
raise Exception(
|
||||
"Scalar field would be larger than max_size (%dMB > %dMB), resolution is%f"
|
||||
% (size / 1e6, max_size / 1e6, resolution)
|
||||
)
|
||||
scfield = np.zeros(shape, dtype=np.float32)
|
||||
scfield[:] = -1000
|
||||
|
||||
# array for holding IDs of sections that contribute to each area
|
||||
idfield = np.empty(shape, dtype=int)
|
||||
idfield[:] = -1
|
||||
|
||||
# map vertex locations to voxels
|
||||
vox_pos = pos.copy()
|
||||
vox_pos -= mn.reshape((1, 3))
|
||||
vox_pos *= 1.0 / resolution
|
||||
|
||||
# Define kernel used to draw scalar field along dendrites
|
||||
def cone(i, j, k):
|
||||
# value decreases linearly with distance from center of kernel.
|
||||
w = kernel_size / 2
|
||||
return w - ((i - w) ** 2 + (j - w) ** 2 + (k - w) ** 2) ** 0.5
|
||||
|
||||
kernel = resolution * np.fromfunction(cone, (kernel_size,) * 3)
|
||||
kernel -= kernel.max()
|
||||
|
||||
def array_intersection(arr1, arr2, pos):
|
||||
"""
|
||||
Return slices used to access the overlapping area between two
|
||||
arrays that are offset such that the origin of *arr2* is a *pos*
|
||||
relative to *arr1*.
|
||||
"""
|
||||
s1 = [0] * 3
|
||||
s2 = [0] * 3
|
||||
t1 = [0] * 3
|
||||
t2 = [0] * 3
|
||||
pos = map(int, pos)
|
||||
for axis in range(3):
|
||||
s1[axis] = max(0, -pos[axis])
|
||||
s2[axis] = min(arr2.shape[axis], arr1.shape[axis] - pos[axis])
|
||||
t1[axis] = max(0, pos[axis])
|
||||
t2[axis] = min(arr1.shape[axis], pos[axis] + arr2.shape[axis])
|
||||
slice1 = (slice(t1[0], t2[0]), slice(t1[1], t2[1]), slice(t1[2], t2[2]))
|
||||
slice2 = (slice(s1[0], s2[0]), slice(s1[1], s2[1]), slice(s1[2], s2[2]))
|
||||
return slice1, slice2
|
||||
|
||||
# Draw lines into volume using *kernel* as the brush
|
||||
vox_pos[:, 0] = np.clip(vox_pos[:, 0], 0, scfield.shape[0] - 1)
|
||||
vox_pos[:, 1] = np.clip(vox_pos[:, 1], 0, scfield.shape[1] - 1)
|
||||
vox_pos[:, 2] = np.clip(vox_pos[:, 2], 0, scfield.shape[2] - 1)
|
||||
for c in range(lines.shape[0]):
|
||||
i = lines[c, 0]
|
||||
j = lines[c, 1]
|
||||
p1 = vox_pos[i].copy()
|
||||
p2 = vox_pos[j].copy()
|
||||
diff = p2 - p1
|
||||
axis = np.argmax(np.abs(diff))
|
||||
dia = d[i]
|
||||
nvoxels = abs(int(diff[axis])) + 1
|
||||
for k in range(nvoxels):
|
||||
kern = kernel + (dia / 2.0)
|
||||
sl1, sl2 = array_intersection(
|
||||
scfield, kern, p1
|
||||
) # find the overlapping area between the field and the kernel
|
||||
idfield[sl1] = np.where(
|
||||
scfield[sl1] > kern[sl2], idfield[sl1], sec_id[i]
|
||||
)
|
||||
scfield[sl1] = np.where(
|
||||
scfield[sl1] > kern[sl2], scfield[sl1], kern[sl2]
|
||||
)
|
||||
dia += (d[j] - d[i]) / nvoxels
|
||||
p1 += diff / nvoxels
|
||||
|
||||
# return transform relating volume data to original vertex data
|
||||
transform = pg.Transform3D()
|
||||
w = resolution * kernel_size / 2 # offset introduced due to kernel
|
||||
transform.translate(*(mn - w))
|
||||
transform.scale(resolution, resolution, resolution)
|
||||
transform.translate(1, 1, 1)
|
||||
return scfield, idfield, transform
|
||||
31
cnmodel/morphology/morphology.py
Normal file
31
cnmodel/morphology/morphology.py
Normal file
@@ -0,0 +1,31 @@
|
||||
class Morphology(object):
|
||||
"""
|
||||
Base class for morphological structure
|
||||
Provides the ability to read .hoc files for NEURON simulations.
|
||||
|
||||
"""
|
||||
|
||||
def init():
|
||||
pass
|
||||
|
||||
def hocReader(self, filename=None):
|
||||
"""
|
||||
Access the hoc reader
|
||||
|
||||
Parameters
|
||||
----------
|
||||
filename : str (default: None)
|
||||
The hoc file to read and save as the morphology object
|
||||
"""
|
||||
self.morphology = hoc_reader(hoc=filename)
|
||||
|
||||
def swcReader(self, filename=None):
|
||||
"""
|
||||
Access the swc reader (***NOT IMPLEMENTED***)
|
||||
|
||||
Parameters
|
||||
----------
|
||||
filename : str (default: None)
|
||||
The swc file to read and save as the morphology object
|
||||
"""
|
||||
raise ValueError("swcReader not implmented.")
|
||||
76
cnmodel/morphology/octopus_spencer_stick.hoc
Normal file
76
cnmodel/morphology/octopus_spencer_stick.hoc
Normal file
@@ -0,0 +1,76 @@
|
||||
// Octopus cell, stick representation
|
||||
// From Spencer et al., Front. Comput. Neurosci., 22 October 2012 | https://doi.org/10.3389/fncom.2012.00083
|
||||
// Figure 1.
|
||||
|
||||
objref soma
|
||||
soma = new SectionList()
|
||||
objref primarydendrite
|
||||
primarydendrite = new SectionList()
|
||||
objref hillock
|
||||
hillock = new SectionList()
|
||||
objref unmyelinatedaxon
|
||||
unmyelinatedaxon = new SectionList()
|
||||
|
||||
create sections[7]
|
||||
|
||||
access sections[0]
|
||||
soma.append()
|
||||
sections[0] {
|
||||
pt3dadd(0., 0., 0., 25.)
|
||||
pt3dadd(0., 25., 0., 25.)
|
||||
}
|
||||
|
||||
// axon hillock, 30 microns long, untapered
|
||||
access sections[1]
|
||||
hillock.append()
|
||||
connect sections[1](0), sections[0](0)
|
||||
sections[1] {
|
||||
pt3dadd(0., 0., 0., 3)
|
||||
pt3dadd(0., -30., 0., 3)
|
||||
}
|
||||
|
||||
// initial segment, unmyelinated, 10 microns long, not tapering
|
||||
access sections[2]
|
||||
unmyelinatedaxon.append()
|
||||
connect sections[2](0), sections[1](1)
|
||||
sections[2] {
|
||||
pt3dadd(0., -30., 0., 3.0)
|
||||
pt3dadd(0., -32., 0., 3.0)
|
||||
}
|
||||
|
||||
// angle dendrites out a bit from original model for visibility, so
|
||||
// length for 20 u end deviation is 279.285 um, end pos 304.285
|
||||
|
||||
access sections[3]
|
||||
primarydendrite.append()
|
||||
connect sections[3](0), sections[0](1)
|
||||
sections[3] {
|
||||
pt3dadd(0., 25., 0., 3)
|
||||
pt3dadd(20., 304.285, 0., 3)
|
||||
}
|
||||
|
||||
access sections[4]
|
||||
primarydendrite.append()
|
||||
connect sections[4](0), sections[0](1)
|
||||
sections [4] {
|
||||
pt3dadd(0., 25., 0., 3)
|
||||
pt3dadd(0., 304.285, 20., 3)
|
||||
}
|
||||
|
||||
access sections[5]
|
||||
primarydendrite.append()
|
||||
connect sections[5](0), sections[0](1)
|
||||
sections [5] {
|
||||
pt3dadd(0., 25., 0., 3)
|
||||
pt3dadd(-20., 304.285, 0., 3)
|
||||
}
|
||||
|
||||
access sections[6]
|
||||
primarydendrite.append()
|
||||
connect sections[6](0), sections[0](1)
|
||||
sections [6] {
|
||||
pt3dadd(0., 25., 0., 3)
|
||||
pt3dadd(0., 304.285, -20., 3)
|
||||
}
|
||||
|
||||
|
||||
82
cnmodel/morphology/tstellate_stick.hoc
Normal file
82
cnmodel/morphology/tstellate_stick.hoc
Normal file
@@ -0,0 +1,82 @@
|
||||
objref soma
|
||||
soma = new SectionList()
|
||||
objref primarydendrite
|
||||
primarydendrite = new SectionList()
|
||||
objref secondarydendrite
|
||||
secondarydendrite = new SectionList()
|
||||
objref hillock
|
||||
hillock = new SectionList()
|
||||
objref unmyelinatedaxon
|
||||
unmyelinatedaxon = new SectionList()
|
||||
objref myelinatedaxon
|
||||
myelinatedaxon = new SectionList()
|
||||
|
||||
create sections[8]
|
||||
access sections[0]
|
||||
soma.append()
|
||||
sections[0] {
|
||||
pt3dadd(0., 0., 0., 25.)
|
||||
pt3dadd(0., 25., 0., 25.)
|
||||
}
|
||||
|
||||
// axon hillock, 15 microns long, tapered
|
||||
access sections[1]
|
||||
hillock.append()
|
||||
connect sections[1](0), sections[0](0)
|
||||
sections[1] {
|
||||
pt3dadd(0., 0., 0., 2.5)
|
||||
pt3dadd(0., -15., 0., 1.0)
|
||||
}
|
||||
|
||||
// initial segment, unmyelinated, 10 microns long, not tapering
|
||||
access sections[2]
|
||||
unmyelinatedaxon.append()
|
||||
connect sections[2](0), sections[1](1)
|
||||
sections[2] {
|
||||
pt3dadd(0., -15., 0., 1.0)
|
||||
pt3dadd(0., -25., 0., 1.0)
|
||||
|
||||
}
|
||||
|
||||
// beginning of myelinated axon, 20 micron, enlarging with distance
|
||||
access sections[3]
|
||||
myelinatedaxon.append()
|
||||
connect sections[3](0), sections[2](1)
|
||||
sections[3] {
|
||||
pt3dadd(0., -25., 0., 1.0)
|
||||
pt3dadd(0., -45., 0., 2.0)
|
||||
|
||||
}
|
||||
|
||||
access sections[4]
|
||||
primarydendrite.append()
|
||||
connect sections[4](0), sections[0](1)
|
||||
sections[4] {
|
||||
pt3dadd(0., 25., 0., 2)
|
||||
pt3dadd(125., 25., 25., 1.5)
|
||||
}
|
||||
|
||||
access sections[5]
|
||||
primarydendrite.append()
|
||||
connect sections[5](0), sections[0](1)
|
||||
sections [5] {
|
||||
pt3dadd(0., 25., 0., 2.0)
|
||||
pt3dadd(-125., 25., 25., 1.5)
|
||||
}
|
||||
|
||||
access sections[6]
|
||||
primarydendrite.append()
|
||||
connect sections[6](0), sections[0](1)
|
||||
sections [6] {
|
||||
pt3dadd(0., 25., 0., 2.0)
|
||||
pt3dadd(125, 25., -25., 1.5)
|
||||
}
|
||||
|
||||
access sections[7]
|
||||
primarydendrite.append()
|
||||
connect sections[7](0), sections[0](1)
|
||||
sections [7] {
|
||||
pt3dadd(0., 25., 0., 2.0)
|
||||
pt3dadd(-125., 25., -25., 1.5)
|
||||
}
|
||||
|
||||
32
cnmodel/morphology/tv_stick.hoc
Normal file
32
cnmodel/morphology/tv_stick.hoc
Normal file
@@ -0,0 +1,32 @@
|
||||
objref soma
|
||||
soma = new SectionList()
|
||||
objref axon
|
||||
axon = new SectionList()
|
||||
objref dendrite
|
||||
dendrite = new SectionList()
|
||||
|
||||
create sections[3]
|
||||
access sections[0]
|
||||
soma.append()
|
||||
sections[0] {
|
||||
pt3dadd(0., 0., 0., 25.)
|
||||
pt3dadd(0., 25., 0., 25.)
|
||||
}
|
||||
|
||||
access sections[1]
|
||||
dendrite.append()
|
||||
connect sections[1](0), sections[0](1)
|
||||
sections[1] {
|
||||
pt3dadd(0., 25., 0., 1.5)
|
||||
pt3dadd(0., 220., 50., 1.5)
|
||||
}
|
||||
|
||||
access sections[2]
|
||||
dendrite.append()
|
||||
connect sections[2](0), sections[0](1)
|
||||
sections[2] {
|
||||
pt3dadd(0., 25., 0., 1.5)
|
||||
pt3dadd(0., 220., -50., 1.5)
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user