Dendrite

class dendrify.compartment.Dendrite(name, model='passive', length=None, diameter=None, cm=None, gl=None, cm_abs=None, gl_abs=None, r_axial=None, v_rest=None, scale_factor=1.0, spine_factor=1.0)[source]

Bases: Compartment

A class that automatically generates and handles all differential equations and parameters needed to describe a dendritic compartment, its active mechanisms, and any currents (synaptic, dendritic, ionic, noise) passing through it.

Parameters:
  • name (str) – A unique name used to tag compartment-specific equations and parameters. It is also used to distinguish the various compartments belonging to the same NeuronModel.

  • model (str, optional) – A keyword for accessing Dendrify’s library models. Dendritic compartments are by default set to 'passive'.

  • length (Quantity, optional) – A compartment’s length.

  • diameter (Quantity, optional) – A compartment’s diameter.

  • cm (Quantity, optional) – Specific capacitance (usually μF / cm^2).

  • gl (Quantity, optional) – Specific leakage conductance (usually μS / cm^2).

  • cm_abs (Quantity, optional) – Absolute capacitance (usually pF).

  • gl_abs (Quantity, optional) – Absolute leakage conductance (usually nS).

  • r_axial (Quantity, optional) – Axial resistance (usually Ohm * cm).

  • v_rest (Quantity, optional) – Resting membrane voltage.

  • scale_factor (float, optional) – A global area scale factor, by default 1.0.

  • spine_factor (float, optional) – A dendritic area scale factor to account for spines, by default 1.0.

Examples

>>> # specifying equations only:
>>> compX = Dendrite('nameX')
>>> # specifying equations and ephys properties:
>>> compY = Dendrite('nameY', length=100*um, diameter=1*um,
>>>                     cm=1*uF/(cm**2), gl=50*uS/(cm**2))
>>> # specifying equations and absolute ephys properties:
>>> compY = Dendrite('nameZ', cm_abs=100*pF, gl_abs=20*nS)

Methods:

add_equations

Adds custom equations to a compartment.

add_params

Adds custom parameters to a compartment.

connect

Connects two compartments (electrical coupling).

dspikes

Adds the ionic mechanisms and parameters needed for dendritic spiking.

g_norm_factor

Calculates the normalization factor for synaptic conductance with t_rise and t_decay kinetics.

noise

Adds a stochastic noise current.

replace_equations

Replaces a set of equations with new ones.

synapse

Adds synaptic currents equations and parameters.

Attributes:

area

Returns a compartment's surface area (open cylinder) based on its length and diameter.

capacitance

Returns a compartment's absolute capacitance.

dimensionless

Checks if a compartment has been flagged as dimensionless.

equations

Returns all differential equations that describe a single compartment and the mechanisms that have been added to it.

event_names

Returns a list of all dSpike event names created for a single dendrite.

events

Returns a dictionary of all dSpike events created for a single dendrite.

g_leakage

A compartment's absolute leakage conductance.

parameters

Returns a dictionary of all parameters that have been generated for a single compartment.

add_equations(eqs)

Adds custom equations to a compartment.

Parameters:

eqs (str) – A string of Brian-compatible equations to be added to the compartment.

add_params(params_dict)

Adds custom parameters to a compartment.

Parameters:

params_dict (dict) – A dictionary of parameters to be added to the compartment.

property area

Returns a compartment’s surface area (open cylinder) based on its length and diameter.

Return type:

Quantity

property capacitance

Returns a compartment’s absolute capacitance.

Return type:

Quantity

connect(other, g='half_cylinders')

Connects two compartments (electrical coupling).

Parameters:
  • other (Compartment) – Another compartment.

  • g (str or Quantity, optional) – The coupling conductance. It can be set explicitly or calculated automatically (provided all necessary parameters exist). Available options: 'half_cylinders' (default), 'cylinder_<compartment name>'.

Warning

The automatic approaches require that both compartments to be connected have specified length, diameter and axial resistance.

Examples

>>> compX, compY = Compartment('x', **kwargs), Compartment('y', **kwargs)
>>> # explicit approach:
>>> compX.connect(compY, g=10*nS)
>>> # half cylinders (default):
>>> compX.connect(compY)
>>> # cylinder of one compartment:
>>> compX.connect(compY, g='cylinder_x')
property dimensionless

Checks if a compartment has been flagged as dimensionless.

Return type:

bool

dspikes(name, threshold=None, g_rise=None, g_fall=None, duration_rise=None, duration_fall=None, reversal_rise=None, reversal_fall=None, offset_fall=None, refractory=None)[source]

Adds the ionic mechanisms and parameters needed for dendritic spiking. Under the hood, this method creates the equations, conditions and actions to take advantage of Brian’s custom events. dSpikes are generated through the sequential activation of a positive (sodium or calcium-like) and a negative current (potassium-like current) when a specified dSpike threshold is crossed.

Hint

The dendritic spiking mechanism as implemented here has three distinct phases.

INACTIVE PHASE:

When the dendritic voltage is subthreshold OR the simulation step is within the refractory period. dSpikes cannot be generated during this phase.

RISE PHASE:

When the dendritic voltage crosses the dSpike threshold AND the refractory period has elapsed. This triggers the instant activation of a positive current that is deactivated after a specified amount of time (duration_rise). Also a new refractory period begins.

FALL PHASE:

This phase starts automatically with a delay (offset_fall) after the dSpike threshold is crossed. A negative current is activated instantly and then is deactivated after a specified amount of time (duration_fall).

Parameters:
  • name (str) – A unique name to describe a single dSpike type.

  • threshold (Quantity, optional) – The membrane voltage threshold for dendritic spiking.

  • g_rise (Quantity, optional) – The max conductance of the channel that is activated during the rise (depolarization phase).

  • g_fall (Quantity, optional) – The max conductance of the channel that is activated during the fall (repolarization phase).

  • duration_rise (Quantity, optional) – The duration of g_rise staying open.

  • duration_fall (Quantity, optional) – The duration of g_fall staying open.

  • reversal_rise ((Quantity, str), optional) – The reversal potential of the channel that is activated during the rise (depolarization) phase.

  • reversal_fall ((Quantity, str), optional) – The reversal potential of the channel that is activated during the fall (repolarization) phase.

  • offset_fall (Quantity, optional) – The delay for the activation of g_rise.

  • refractory (Quantity, optional) – The time interval required before dSpike can be activated again.

property equations

Returns all differential equations that describe a single compartment and the mechanisms that have been added to it.

Return type:

str

property event_names

Returns a list of all dSpike event names created for a single dendrite.

Return type:

list

property events

Returns a dictionary of all dSpike events created for a single dendrite.

Returns:

Keys: event names, values: events conditions.

Return type:

dict

property g_leakage

A compartment’s absolute leakage conductance.

Return type:

Quantity

static g_norm_factor(t_rise, t_decay)

Calculates the normalization factor for synaptic conductance with t_rise and t_decay kinetics.

Parameters: t_rise (Quantity): The rise time of the function. t_decay (Quantity): The decay time of the function.

Returns: float: The normalization factor for the g function.

noise(tau=20. * msecond, sigma=1. * pamp, mean=0. * amp)

Adds a stochastic noise current. For more information see the Noise section: of Models and neuron groups

Parameters:
  • tau (Quantity, optional) – Time constant of the Gaussian noise, by default 20*ms

  • sigma (Quantity, optional) – Standard deviation of the Gaussian noise, by default 3*pA

  • mean (Quantity, optional) – Mean of the Gaussian noise, by default 0*pA

property parameters

Returns a dictionary of all parameters that have been generated for a single compartment.

Return type:

dict

replace_equations(eqs_old, eqs_new)

Replaces a set of equations with new ones.

Parameters:
  • eqs_old (str) – The equations to be replaced.

  • eqs_new (str) – The new equations.

synapse(channel, tag, g=None, t_rise=None, t_decay=None, scale_g=False)

Adds synaptic currents equations and parameters. When only the decay time constant t_decay is provided, the synaptic model assumes an instantaneous rise of the synaptic conductance followed by an exponential decay. When both the rise t_rise and decay t_decay constants are provided, synapses are modelled as a sum of two exponentials. For more information see: Modeling Synapses by Arnd Roth & Mark C. W. van Rossum

Parameters:
  • channel (str) – Synaptic channel type. Available options: 'AMPA', 'NMDA', 'GABA'.

  • tag (str) – A unique name to distinguish synapses of the same type.

  • g (Quantity) – Maximum synaptic conductance

  • t_rise (Quantity) – Rise time constant

  • t_decay (Quantity) – Decay time constant

  • scale_g (bool, optional) – Option to add a normalization factor to scale the maximum conductance at 1 when synapses are modelled as a difference of exponentials (have both rise and decay kinetics), by default False.

Examples

>>> comp = Compartment('comp')
>>> # adding an AMPA synapse with instant rise & exponential decay:
>>> comp.synapse('AMPA', tag='X', g=1*nS, t_decay=5*ms)
>>> # same channel, different conductance & source:
>>> comp.synapse('AMPA', tag='Y', g=2*nS, t_decay=5*ms)
>>> # different channel with both rise & decay kinetics:
>>> comp.synapse('NMDA', tag='X' g=1*nS, t_rise=5*ms, t_decay=50*ms)