Cable cell mechanisms¶
- class mechanism¶
Mechanisms describe physical processes, distributed over the membrane of the cell. Density mechanisms are associated with regions of the cell, whose dynamics are a function of the cell state and their own state where they are present. Point mechanisms are defined at discrete locations on the cell, which receive events from the network. Junction mechanisms are defined at discrete locations on the cell, which define the behavior of a gap-junction mechanism. A fourth, specific type of density mechanism, which describes ionic reversal potential behaviour, can be specified for cells or the whole model.
The
mechanism
type is a simple wrapper around a mechanismmechanism.name
and a dictionary of named parameters.Mechanisms have two types of parameters:
global parameters: a scalar value that is the same for all instances of a mechanism.
range parameters: the value of range parameters is defined for each instance of the mechanism on a cell. For density mechanisms, this means one value for each control volume on which it is present.
The method for setting a parameter depends on its type. If global parameters change, we are effectively defining a new type of mechanism, so global parameter information is encoded in the name. Range parameters are set using a dictionary of name-value pairs or as kwargs.
import arbor # A passive leaky channel with default parameter values (set in NOMDL file). pas_0 = arbor.mechanism('pas') # A passive leaky channel with custom conductance (range). pas_1 = arbor.mechanism('pas', {'g': 0.02}) # A passive leaky channel with custom reversal potential (global). pas_2 = arbor.mechanism('pas/e=-45') # A passive leaky channel with custom reversal potential (global), and custom conductance (range). pas_3a = arbor.mechanism('pas/e=-45', {'g', 0.1}) # A passive leaky channel with custom reversal potential (global), and custom conductance (range) # written as keyword args. pas_3b = arbor.mechanism('pas/e=-45', g=0.1) # This is an equivalent to pas_3, using set method to specify range parameters. pas_4 = arbor.mechanism('pas/e=-45') pas_4.set('g', 0.1) # Reversal potential using Nernst equation with GLOBAL parameter values # for Faraday's constant and the target ion species, set with a '/' followed # by comma-separated list of parameter after the base mechanism name. rev = arbor.mechanism('nernst/F=96485,x=ca') # An exponential synapse with default parameter values (set in NOMDL file). expsyn = arbor.mechanism("expsyn") # A gap-junction mechanism with default parameter values (set in NOMDL file). gj = arbor.mechanism("gj")
- mechanism(name, params)¶
constructor for mechanism with name and range parameter overrides params, for example:
arbor.mechanism(name='pas', params={'g': 0.01})
.- Parameters:
name (str) – name of mechanism.
params (dict[str, double]) – A dictionary of parameter values, with parameter name as key.
- mechanism(name)
constructor for mechanism. The name can be either the name of a mechanism in the catalogue, e.g.
arbor.mechanism('pas')
, or an implicitly derived mechanism, e.g.arbor.mechanism('nernst/k')
.
- set(name, value)¶
Set new value for a parameter.
- Parameters:
name (str) – name of the parameter.
value (float) – value of the parameter.
- name: str¶
The name of the mechanism.
- values¶
- :type: dict
A dictionary of key-value pairs for the parameters.
- class density¶
When decorating a cable cell, we use a
density
type to wrap a densitymechanism
that is to be painted on the cable cell.Different
density
mechanisms can be painted on top of each other.import arbor pas = arbor.mechanism('pas') pas.set('g', 0.2) # Decorate the 'soma' with (multiple) density mechanisms decor.paint('"soma"', density(pas)) decor.paint('"soma"', density('pas', {'g': 0.1})) # Error: can't place the same mechanism on overlapping regions decor.paint('"soma"', density('pas/e=-45')) # This is ok: pas/e=-45 is a new, derived mechanism by virtue of # having a different name, i.e. 'pas/e=-45' vs. 'pas'.
- density(name)¶
constructs
mech
with name and default parameters.- Parameters:
name (str) – name of mechanism.
- density(name, params)
constructs
mech
with name and range parameter overrides params. for example:arbor.density('pas', {'g': 0.01})
.- Parameters:
name (str) – name of mechanism.
params (dict[str, double]) – A dictionary of parameter values, with parameter name as key.
- class synapse¶
When decorating a cable cell, we use a
synapse
type to wrap a pointmechanism
that is to be placed on the cable cell.- synapse(name)¶
constructs
mech
with name and default parameters.- Parameters:
name (str) – name of mechanism.
- synapse(name, params)
constructs
mech
with name and range parameter overrides params. for example:arbor.synapse('expsyn', {'tau': 0.01})
.- Parameters:
name (str) – name of mechanism.
params (dict[str, double]) – A dictionary of parameter values, with parameter name as key.
- class junction¶
When decorating a cable cell, we use a
junction
type to wrap a gap-junctionmechanism
that is to be placed on the cable cell.- junction(name)¶
constructs
mech
with name and default parameters.- Parameters:
name (str) – name of mechanism.
- junction(name, params)
constructs
mech
with name and range parameter overrides params. for example:arbor.junction('gj', {'g': 2})
.- Parameters:
name (str) – name of mechanism.
params (dict[str, double]) – A dictionary of parameter values, with parameter name as key.
- class mechanism_info¶
Meta data about the fields and ion dependencies of a mechanism. The data is presented as read-only attributes.
import arbor cat = arbor.default_catalogue() # Get mechanism_info for the 'expsyn' mechanism. mech = cat['expsyn'] # Query the mechanism_info for information about parameters. print(mech.parameters.keys()) # dict_keys(['e', 'tau']) print(mech.parameters['tau'].units) # 'ms' print(mech.parameters['tau'].default) # 2.0
- kind: string¶
String representation of the kind of the mechanism: density, point or reversal potential.
- globals: dict[str, mechanism_field]¶
Global fields have one value common to an instance of a mechanism, are constant in time and set at instantiation.
- parameters: dict[str, mechanism_field]¶
Parameter fields may vary across the extent of a mechanism, but are constant in time and set at instantiation.
- state: dict[str, mechanism_field]¶
State fields vary in time and across the extent of a mechanism, and potentially can be sampled at run-time.
- ions: dict[str, ion_dependency]¶
Ion dependencies.
- linear: bool¶
True if a synapse mechanism has linear current contributions so that multiple instances on the same control volume can be coalesced.
- post_events: bool¶
True if a synapse mechanism has a POST_EVENT procedure defined.
- class ion_dependency¶
Meta data about a mechanism’s dependence on an ion species, presented as read-only attributes.
import arbor cat = arbor.default_catalogue() # Get ion_dependency for the 'hh' mechanism. ions = cat['hh'].ions # Query the ion_dependency. print(ions.keys()) # dict_keys(['k', 'na']) print(ions['k'].write_rev_pot) # False print(ions['k'].read_rev_pot) # True
- write_int_con: bool¶
If the mechanism contributes to the internal concentration of the ion species.
- write_ext_con: bool¶
If the mechanism contributes to the external concentration of the ion species.
- write_rev_pot: bool¶
If the mechanism calculates the reversal potential of the ion species.
- read_rev_pot: bool¶
If the mechanism depends on the reversal potential of the ion species.
- class mechanism_field¶
Meta data about a specific field of a mechanism, presented as read-only attributes.
- units: string¶
The units of the field.
- default: float¶
The default value of the field.
- min: float¶
The minimum permissible value of the field.
- max: float¶
The maximum permissible value of the field.
The mechanism_info
type above presents read-only information about a mechanism that is available in a catalogue.
Mechanism catalogues¶
- class catalogue¶
A mechanism catalogue is a collection of mechanisms that maintains:
Collection of mechanism metadata indexed by name.
A further hierarchy of derived mechanisms, that allow specialization of global parameters, ion bindings, and implementations.
- __init__(catalogue=None)¶
Create an empty or copied catalogue.
- __contains__(name)¶
Test if mechanism with name is in the catalogue.
Note: This enables the following idiom
import arbor if 'hh' in arbor.default_catalogue(): print("Found HH mechanism.")
- Parameters:
name (str) – name of mechanism.
- Returns:
bool
- is_derived(name)¶
Is name a derived mechanism or can it be implicitly derived?
- Parameters:
name (str) – name of mechanism.
- Returns:
bool
- __getitem__(name)¶
Look up mechanism meta data with name.
import arbor cat = arbor.default_catalogue() # Print default value and units for gnabar parameter of hh. print(cat['hh'].parameters['gnabar'])
- Parameters:
name (str) – name of mechanism.
- Returns:
mechanism metadata
- Return type:
- __iter___()¶
Return a list names of all the mechanisms in the catalogue.
Note: This enables the following idiom
import arbor for name in arbor.default_catalogue(): print(name)
- Returns:
py_mech_cat_iterator
- extend(other, prefix)¶
Import another catalogue, possibly with a prefix. Will raise an exception in case of name collisions.
import arbor cat = arbor.default_catalogue() cat.extend(arbor.allen_catalogue(), "")
- Parameters:
other (
mechanism_catalogue
) – reference to other catalogue.prefix (str) – prefix for mechanism names in
other
- derive(name, parent, globals={}, ions={})¶
Derive a new mechanism with name from the mechanism parent.
If no parameters or ion renaming are specified with globals or ions, the method will attempt to implicitly derive a new mechanism from parent by parsing global and ions from the parent string.
import arbor cat = arbor.default_catalogue() # Use the value of the Faraday constant as published by CODATA in 1986, # and bind to pottasium ion species. cat.derive('krev', 'nernst', globals={'F': 96485.309}, ions={'x': 'k'}) # Derive a reversal potential mechanism for sodium from the one we defined # for potasium, which will inherit the redefined Faraday constant. cat.derive('narev', 'krev', ions={'k': 'na'}) # Alternatively, we can derive a mechanism with global parameters and ion renaming # specified in the parent name string. cat.derive('krev_imp', 'nernst/F=96485.309,k') cat.derive('carev', 'krev_imp/ca')
- Parameters:
name (str) – name of new derived mechanism.
parent (str) – name of parent mechanism.
globals (dict[str, float]) – a dictionary mapping global parameter names to their values, if any.
ions (dict[str, str]) – a dictionary renaming ion species, if any.