Synapses

class dendrotweaks.stimuli.populations.Synapse(syn_type: str, sec, loc=0.5)[source]

Bases: object

A synapse object that can be placed on a section of a neuron.

Contains references to the NEURON synapse object, the stimulus object (NetStim), and the connection object (NetCon).

Parameters:
  • syn_type (str) – The type of synapse to create e.g. ‘AMPA’, ‘NMDA’, ‘AMPA_NMDA’, ‘GABA’.

  • sec (Section) – The section on which the synapse is placed.

  • loc (float) – The location on the section where the synapse is placed, between 0 and 1.

sec

The section on which the synapse is placed.

Type:

Section

loc

The location on the section where the synapse is placed, between 0 and 1.

Type:

float

property seg

The segment on which the synapse is placed.

property spike_times

The spike times of the stimulus from the NetStim object.

create_stim(**kwargs)[source]

Creates a stimulus (NetStim) for the synapse.

Parameters:

**kwargs (dict) – Keyword arguments for the create_spike_times function.

create_con(delay, weight)[source]

Create a connection (NetCon) between the stimulus and the synapse.

Parameters:
  • delay (int) – The delay of the connection, in ms.

  • weight (float) – The weight of the connection.

class dendrotweaks.stimuli.populations.Population(idx: str, segments: List[Segment], N: int, syn_type: str)[source]

Bases: object

A population of “virtual” presynaptic neurons forming synapses on the explicitely modelled postsynaptic neuron.

The population is defined by the number of synapses N, the segments on which the synapses are placed, and the type of synapse. All synapses in the population share the same kinetic parameters. Global input parameters such as rate, noise, etc. are shared by all synapses in the population, however, each synapse receives a unique input spike train.

Parameters:
  • idx (str) – The index of the population.

  • segments (List[Segment]) – The segments on which the synapses are placed.

  • N (int) – The number of synapses in the population.

  • syn_type (str) – The type of synapse to create e.g. ‘AMPA’, ‘NMDA’, ‘AMPA_NMDA’, ‘GABA’.

idx

The index of the population.

Type:

str

segments

The segments on which the synapses are placed.

Type:

List[Segment]

N

The number of synapses in the population.

Type:

int

syn_type

The type of synapse to create e.g. ‘AMPA’, ‘NMDA’, ‘AMPA_NMDA’, ‘GABA’.

Type:

str

synapses

A dictionary of synapses in the population, where the key is the segment index.

Type:

dict

input_params

The input parameters of the synapses in the population.

Type:

dict

kinetic_params

The kinetic parameters of the synapses in the population.

Type:

dict

property name

A unique name for the population.

property spike_times

Return the spike times of the synapses in the population.

property n_per_seg

Return the number of synapses per segment.

update_kinetic_params(**params)[source]

Update the kinetic parameters of the synapses.

Parameters:

**params (dict) – The parameters to update self.kinetic_params. Options are: - gmax: the maximum conductance of the synapse - tau_rise: the rise time of the synapse - tau_decay: the decay time of the synapse - e: the reversal potential of the synapse - gamma: the voltage dependence of the magnesium block (NMDA only) - mu: the sensitivity of the magnesium block to Mg2+ concentration (NMDA only)

update_input_params(**params)[source]

Update the input parameters of the synapses.

Parameters:

**params (dict) – The parameters to update self.input_params. Options are: - rate: the rate of the input in Hz - noise: the noise level of the input - start: the start time of the input - end: the end time of the input - weight: the weight of the synapse - delay: the delay of the synapse

allocate_synapses(syn_locs=None)[source]
create_inputs()[source]

Create and reference the synapses in a simulator.

This method should be called after the synapses have been allocated.

to_dict()[source]

Convert the population to a dictionary.

property flat_synapses

Return a flat list of synapses.

to_csv()[source]

Prepare the data about the location of synapses for saving to a CSV file.

clean()[source]

Clear the synapses and connections from the simulator.

Removes all synapses, NetCon and NetStim objects.