PointNeuronModel#

class dendrify.neuronmodel.PointNeuronModel(model='leakyIF', length=None, diameter=None, cm=None, gl=None, cm_abs=None, gl_abs=None, v_rest=None)[source]#

Bases: object

Like a NeuronModel but for point-neuron (single-compartment) models.

Parameters:
  • model (str, optional) – A keyword for accessing Dendrify’s library models. Custom models can also be provided but they should be in the same formattable structure as the library models. Available options: 'leakyIF' (default), 'adaptiveIF', 'adex'.

  • length (Quantity, optional) – The point neuron’s length.

  • diameter (Quantity, optional) – The point neuron’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).

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

Methods:

add_equations

Allows adding custom equations.

add_params

Allows specifying extra/custom parameters.

make_neurongroup

Create a NeuronGroup object with the specified number of neurons.

noise

Adds a stochastic noise current.

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.

g_leakage

A compartment's absolute leakage conductance.

parameters

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

add_equations(eqs)[source]#

Allows adding custom equations.

Parameters:

eqs (str) – A string of Brian-compatible equations.

add_params(params_dict)[source]#

Allows specifying extra/custom parameters.

Parameters:

params_dict (dict) – A dictionary of parameters.

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

property dimensionless#

Checks if a compartment has been flagged as dimensionless.

Return type:

bool

property equations#

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

Return type:

str

property g_leakage#

A compartment’s absolute leakage conductance.

Return type:

Quantity

make_neurongroup(N, **kwargs)[source]#

Create a NeuronGroup object with the specified number of neurons.

Parameters:
  • N (int) – The number of neurons in the group.

  • **kwargs – Additional keyword arguments to be passed to the NeuronGroup constructor.

Returns:

The created NeuronGroup object.

Return type:

NeuronGroup

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

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 all the parameters that have been generated for a single compartment.

Return type:

dict

synapse(channel, tag, g=None, t_rise=None, t_decay=None, scale_g=False)[source]#

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

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