Simulation Parameters File

The Simulation Parameters file is a JSON file that is used to specify various high-level experimental and numerical properties of the simulation. The file should contain a number of top-level objects, which may be specified in any order. Some of these objects are optional. The required top-level objects are:

  • types: an array that specifies which Cell Type file should be used for each type of neuron in the network.
  • synapse_types: an array that specifies the dynamics of each type of synapse in the network.
  • synaptic_conductances: an array that specifies the type and conductance of synapses between each possible pair of neuron types.
  • gap_junctions: an array that specifies the conditions under which two neurons are electrically coupled.
  • numerics: this object contains various numerical parameters, such as simulation time and accuracy tolerances.

The optional top-level objects are:

  • current_injections: an array of current injections that should be applied to neurons.
  • forced_spikes: an array of files containing lists of spikes that can be used to simulate the spiking of particular neurons at particular times.

The remaining sections on this page describe each of these top-level objects in detail.

types array

Each neuron in a SNAPPy simulation has a particular type. The type of a neuron determines its passive and active membrane parameters, such as capacitance and the gated channels that are present. In most scenarios there will be multiple neuron types with many neurons of each type, but it is also possible for all neurons to have the same type or for each neuron to have its own unique type.

The types array specifies the Cell Type file for each of the neuron types in the simulation. The following JSON snippet shows what the types array might look like in a simulation that contains subthalamic nucleus (STN) and globus pallidus (GP) neurons:

1
2
3
4
"types" : [
   { "file": "CellTypes/STN/STN.json", "comment": "Type 1: Subthalamic neuron" },
   { "file": "CellTypes/GP/GP.json", "comment": "Type 2: Pallidal neuron" }
]

Note

SNAPPy only reads the file field in each type entry - everything else is ignored. In the above example, a comment field has been added purely to make the configuration file easier to read.

Tip

Multiple entries in the types array can reference the same cell type file. This is useful when you have several subpopulations of neurons that share identical membrane properties.

In the configuration and output files (as well as internally), the type of each neuron is represented as a type ID. This ID is a number that references the elements of the types array; it has a value from 1 to N, where N is the length of the types array. So, in the above example, a current injection into all STN neurons would be specified as a current injection into all neurons of type 1.

synapse_types array

Synapses between neurons may be of different types. For details about the synapse model in SNAPPy, see the Synapses section.

The synapse_types array specifies a list of objects, each of which gives the parameters of one possible type of synapse that may exist in the simulation. The following fields can be specified for each object (fields are required unless stated otherwise):

Field Type Description
name string A unique name for the synapse type (e.g. “AMPA” or “NMDA”).
eqn string Equation to use for the post-synaptic current (must be “standard” or “mg”).
erev decimal Reversal potential of the synapse in mV.
tau_o decimal Synaptic opening time constant (ms).
tau_c decimal Synaptic closing time constant (ms).
step decimal The amount by which o and c should be increased following a pre-synaptic spike.
c1, c2 decimal Values for the constants in the Mg2+ (?) blocked synapse equation (only used if eqn equals “mg”).
sat decimal Optional. If given, this activates a simple model for pre-synaptic saturation. This model limits the amount by which c and o are step increased following a pre-synaptic spike such that (c-o) will never exceed sat.
cutoff_time decimal Optional. If given, specifies the duration (in milliseconds) from the beginning of the simulation for which the synapse is active. For t>cutoff_time, the conductance of the synapse is set to 0nS.

The following example shows a synapse_types array that defines three types of synapse: excitatory AMPA (fast dynamics), Mg2+ (?) gated NMDA (slow dynamics) and generic inhibitory (intermediate dynamics):

1
2
3
4
5
"synapse_types": [
                     { "name": "ampa", "eqn": "standard", "erev": 0.0, "tau_o": 0.2, "tau_c": 3.0, "step": 1.25 },
                     { "name": "nmda", "eqn": "mg", "erev": 0.0, "tau_o": 5.0, "tau_c": 80.0, "step": 1.25, "c1": 0.05, "c2": -0.08 },
                     { "name": "inh", "eqn": "standard", "erev": -75.0, "tau_o": 1.5, "tau_c": 4.0, "step": 3.0 }
                 ]

Note

Each synapse type must have a different name.

synaptic_conductances array

The synaptic_conductances array specifies a list of objects, each of which defines the type and maximum conductance of synapses between a pair of neuron types. Each object can contain the following fields (fields are required unless otherwise specified):

Field Type Description
pre_type integer The ID of the pre-synaptic neuron type that the object describes synapses for.
post_type integer The ID of the post-synaptic neuron type that the object describes synapses for.
syn_type string The name of the synapse type that should exist whenever a neuron of pre_type connects onto a neuron of post_type (this name must match one of the entries in the synapse_types array).
g decimal The mean maximum conductance (in nS) of a pre_type to post_type synapse of type syn_type.
g_stdev decimal Optional. If present, the maximum conductance of synapses of the given type vary randomly from synapse to synapse. The variation applied to each synaptic conductance is Gaussian with standard deviation given by this field.
fixed_delay decimal Optional. Specifies a constant delay (in ms) between the activation of a synapse and the post-synaptic current arising.
dist_delay decimal Optional. Specifies a distance dependent delay (in ms per \(\mu m\) ) which varies linearly according to the difference in position between the pre- and post-synaptic neurons.

The following snippet shows an example synaptic_conductances array:

1
2
3
4
"synaptic_conductances": [
                           { "pre_type": 1, "post_type": 2, "syn_type": "ampa", "g": 2.0, "g_stdev": 0.2, "fixed_delay": 1.0 },
                           { "pre_type": 2, "post_type": 1, "syn_type": "nmda", "g": 1.5, "g_stdev": 0.15, "fixed_delay": 1.0 }
                         ]

Line 2 specifies that type 1 neurons make AMPA synapses onto type 2 neurons and these synapses have a mean maximum conductance of 0.2nS. Likewise, line 3 specifies that type 2 neurons make NMDA synapses on to type 1 neurons, with mean maximum conductance 1.5nS. For both sets of synapses there is a 1ms synaptic delay and the actual maximum conductance of each synapse differs from the mean by a random amount according to a Gaussian (normal) distribution with standard deviation that is 10% of the mean.

Tip

You can specify more than one type of synapse for each pair of neuron types. In this case, each multiple synapses will exist between the neurons and their conductances will sum.

For more details about the synapse model in SNAPPy, see the Synapses section.

gap_junctions array

SNAPPy supports gap junctions (electrical synapses) between pairs of neurons. The gap_junctions array is a list of objects, each of which describes one set of conditions under which gap junctions exist. Each of these objects should contain the following fields:

Field Type Description
type1, type2 int The type IDs of the two types of neurons that can have gap junctions between them.
dist_thold decimal Distance threshold (in \(\mu m\)) - neurons of the specified types that are separated by less than this distance will be electrically coupled.
g decimal The conductance of each gap junction, in nanosiemens.

The following example shows what the gap_junctions array would look like if gap junctions with conductance 0.5nS should exist between pairs of neurons of type 1 that are within 100 \(\mu m\) of each other, and gap junctions of conductance 0.1nS should exist between neurons of type 1 and 2 that are within 150 \(\mu m\) of each other:

1
2
3
4
"gap_junctions" : [
   { "type1": 1, "type2": 1, "dist_thold": 100.0, "g": 0.5 },
   { "type1": 1, "type2": 2, "dist_thold": 150.0, "g": 0.1 }
]

Note

In the case where more than one condition applies to a pair of neurons, the gap junction conductances are summed.

Note

At present gap junctions are only created between pairs of neurons that are on the same “body side”. Neurons in the first half of the Cell List file are assumed to be on the left side of the body and those in the second half are assumed to be on the right side. This limitation will be fixed in a future release.

numerics object

The numerics object contains settings that control how the simulation runs. The following fields are supported (fields are required unless otherwise stated):

Field Type Description
time decimal The length of time to simulate for (in ms)
solver string Which ODE solver algorithm to use. At present only a value of “rk45” is supported, which corresponds to the Runge-Kutta-Fehlberg (4,5) method.
initial_step decimal The initial solver step size to use (in ms).
adaptive_step boolean If true then the step size will be modified between simulation steps. Enabling this will usually increase simulation speed considerably.
tolerance_abs decimal The absolute error tolerance to use for step size adaptation. Only used in adaptive step mode.
tolerance_abs decimal The relative error tolerance to use for step size adaptation. Only used in adaptive step mode.
max_step decimal The maximum possible integration step size. To ensure accurate spike detection, values above 0.5 are not recommended. Only used in adaptive step mode.
spike_thold decimal The threshold (in mV) for spike detection. A spike occurs when the membrane potential of a neuron crosses this threshold in the positive direction.
random_seed integer Optional. The value to use for seeding the random number generator. Two simulations with identical configuration files will produce identical results if this value is the same. If no value is specified then the current date and time is used.

curent_injections array

Optional. If your experiment requires current clamp injections into one or more neurons, the current_injections array allows you to setup these injections. Each object in the current_injections array describes an injection of current into one or more neurons of a particular type. Three different current functions are supported at present: constant, sine wave and square wave. The following fields should always be specified for each injection object:

Field Type Description
start_time decimal The time at which the current injection should begin (ms).
end_time decimal The time at which the current injection should end (ms).
cell_type integer The type ID of the neurons to inject current into.
body_side string Either “left” or “right”, to indicate which side of the body the neurons to be injected are located on. Neurons in the first half of the Cell List file are assumed to be on the left side of the body and those in the second half are assumed to be on the right side. This limitation will be fixed in a future release.
first_cell integer The number of the first neuron to receive injected current. This is relative to the body side and neuron type, so a value of 5 corresponds to the fifth neuron of the given type on the specified side.
last_cell integer The number of the last neuron to receive injected current. As with first_cell, this is relative to neuron type and body side.
function object The function object specifies the type and parameters of the current function (see below for details).

The following sections describe the different current injection functions and the fields that should be specified in the function object for each.

Note

In SNAPPy, positive current values are depolarizing (increase membrane voltage) and negative current values are hyperpolarizing (decrease membrane voltage).

Note

If more than one current injection applies to a neuron at once the currents are summed.

Constant current: The same current value is used throughout the duration of the injection. The following fields should be given in the function object:

Field Type Description
type string Should be “constant”.
current decimal Amount of current to inject (in pA).

Sine wave current: The injected current varies between minimum and maximum values according to a sine wave with a constant frequency. The following fields should be given in the function object:

Field Type Description
type string Should be “sine”.
i_min decimal Amount of current to inject at the troughs of the sine wave (in pA).
i_max decimal Amount of current to inject at the peaks of the sine wave (in pA).
period decimal Period of the sine wave (in ms); or:
freq decimal Frequency of the sine wave (in Hz).
shift decimal Optional A constant phase shift (in ms) that is applied to the sine wave.

Note

Either period or freq must be specified, but not both.

Square wave current: The injected current alternates between a low and a high value according to a square wave with a constant frequency. The first part of each period is the active phase. The following fields should be given in the function object:

Field Type Description
type string Should be “square”.
i_low decimal Amount of current to inject during the low phase (pA).
i_high decimal Amount of current to inject during the high phase (pA).
period decimal Period of the square wave (in ms).
duty_cycle decimal The proportion (0.0 to 1.0) of each cycle where the injected current should be equal to i_high.

forced_spikes array

Optional. The forced spikes feature can be used to make SNAPPy act as if certain neurons have spiked at particular times, regardless of whether their membrane potential actually crosses the spike threshold. This can be useful if, for example, you want a set of neurons to spike according to experimentally recorded spike times. In this case, the neurons should be passive (no active channels), and the forced_spikes array should specify where the recorded spikes are located.

Forced spike times are loaded from from text files that may contain one or more spike trains. Each line in the file specifies one spike train, with the spike times on each line written as a set of decimal numbers separated by commas. Each object in the forced_spikes array specifies where the forced spikes for one neuron should be loaded from, and must contain the following fields:

Field Type Description
cell_id integer The ID of the neuron (as specified in the Cell List file) that this object gives forced spikes for.
file string The path to the text file containing the spike train for neuron with ID cell_id.
line integer The line number in the specified file (1...num_lines) containing the spike train.