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
mechanismtype is a simple wrapper around a mechanismmechanism.nameand 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 as A # A passive leaky channel with default parameter values (set in NMODL file). pas_0 = A.mechanism('pas') # A passive leaky channel with custom conductance (range). pas_1 = A.mechanism('pas', {'g': 0.02}) # A passive leaky channel with custom reversal potential (global). pas_2 = A.mechanism('pas/e=-45') # A passive leaky channel with custom reversal potential (global), and custom conductance (range). pas_3a = A.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 = A.mechanism('pas/e=-45', g=0.1) # This is equivalent to pas_3, using the set method to specify range parameters. pas_4 = A.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 a comma-separated list of parameters after the base mechanism name. rev = arbor.mechanism('nernst/F=96485,x=ca') # An exponential synapse with default parameter values (set in NMODL file). expsyn = A.mechanism("expsyn") # A gap-junction mechanism with default parameter values (set in NMODL file). gj = A.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
densitytype to wrap a densitymechanismthat is to be painted on the cable cell.Different
densitymechanisms can be painted on top of each other.import arbor as A pas = A.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
mechwith name and default parameters.- Parameters:
name (str) – name of mechanism.
- class synapse¶
When decorating a cable cell, we use a
synapsetype to wrap a pointmechanismthat is to be placed on the cable cell.- synapse(name)¶
constructs
mechwith name and default parameters.- Parameters:
name (str) – name of mechanism.
- class junction¶
When decorating a cable cell, we use a
junctiontype to wrap a gap-junctionmechanismthat is to be placed on the cable cell.- junction(name)¶
constructs
mechwith name and default parameters.- Parameters:
name (str) – name of mechanism.
- class mechanism_info¶
Meta data about the fields and ion dependencies of a mechanism. The data is presented as read-only attributes.
import arbor as A cat = A.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¶
Metadata about a mechanism’s dependence on an ion species, presented as read-only attributes.
import arbor as A cat = A.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¶
Metadata about a specific field of a mechanism is 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 metadata 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 of 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 the parent by parsing global and ions from the parent string.
import arbor as A cat = A.default_catalogue() # Use the value of the Faraday constant as published by CODATA in 1986, # and bind to potassium 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 potassium, 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')