Spike results extraction and analysis

This section describes the methods to extract spiking results from BSB NEST simulations and to analyze these results using the Elephant library.

SpikingResults

This class allows you to extract and manipulate spiking results coming from BSB-NEST simulations.

Class parameters

  • scaffold: BSB scaffold object.

  • simulation_name: Name of the simulation as defined in the scaffold configuration.

  • time_from: The starting time from which the analysis will be performed

  • time_to: The end time at which the analysis will end.

  • folder_nio: Path to folder containing the .nio files produced by the BSB-NEST simulation

  • ignored_ct: List of cell type names to ignore from the nio files (results from these cells will not be returned).

Note

The time_from and time_to values can differ from the simulation start and end time, but they should remain within the simulation time interval.

The class will automatically load the spikes from the files for you. You can then use it to analyze your results.

Note

Note that you can change at any time all the parameters used to filter the results.

Class properties

The following properties are all lists providing different information for each neuron population (lists have the same size). They will be updated if the class parameters are modified.

Methods to analyze the spiking results

get_firing_rates

Computes the instantaneous firing rate for each cell population. Parameters:

  • spiking_results: SpikingResults instance.

  • kernel: Size of time bin

The instantaneous firing rate function of a single neuron \(m\), \(\lambda _m (t)\) corresponds to the one described in Nawrot et al. (1999) [1] : \(\lambda _m (t) = \displaystyle\sum_{i=1} ^{n} K(t-t_i)\)

where \(\{t_0,t_1, ..., t_n\}\) are the time of the spike events of the neuron \(m\) and \(K(t)\) is a kernel function with the following properties:

\[\begin{split}\begin{cases} K(t) \ge 0 \\ \displaystyle\int_{-\infty}^{+\infty} K(t) \,dt = 1 \\ \displaystyle\int_{-\infty}^{+\infty} t \cdot K(t) \,dt = 0 \\ \end{cases}\end{split}\]

Additionally, we define \(\sigma\) the width of the kernel (in ms) \(K\) as: \(\sigma = \sqrt{ \displaystyle\int_{-\infty}^{+\infty} t^2 \cdot K(t) \,dt }\)

To avoid the edge effects of the kernel convolution with the spike train (i.e. the time where the kernel can not fully overlap the spike train because of its width), a compensation effect is calculated.

Different kernel functions would have different smoothening properties. Here you can use any of the Kernels provided by Elephant. By default, if no kernel is provided, we use the optimized gaussian kernel of Elephant. See also the function instantaneous_rate for more information.

get_spike_matrix

Extract the 2D boolean matrix of the spiking activity for each neuron of a SpikeTrain object. Each line corresponds to a neuron, while the columns correspond to a time step in the simulation. Matrix box is True if the neuron of this line spiked at the corresponding time step. Neurons are sorted according to their NEST id. Parameters:

  • spikes: SpikeTrain instance of a cell population.

  • dt: Simulation time step.

extract_isis

Extract the Inter Spike Intervals (ISI) from a SpikeTrain instance. Parameters:

  • spikes: SpikeTrain instance of a cell population.

  • dt: Simulation time step.

An ISI corresponds to the time (in ms) between two consecutive spikes. The values extracted corresponds to the mean ISI value of each of its neuron. Only the neurons spiking at least two times during the SpikeTrain interval are used.

get_frequencies

This function performs a Fast Fourier Transform on a instantaneous firing rate signal. Parameters:

  • spiking_results: SpikingResults instance.

  • firing_rates: instantaneous firing rates for each neuron population, for each time step, corresponds to the output of the get_firing_rates function.

get_correlation_coefficients

This method returns the 2D matrix of the pairwise Pearson’s correlation coefficients between each cell type. Parameters:

  • spiking_results: SpikingResults instance.

  • bin_size: Size of time bin

References