elephant
elephant copied to clipboard
[Feature] Spike triggered population response (stPR)
Feature Implementing the spike triggered population response (stPR) in elephant. This is a measure of spiketrains, given a list of simultaneously recorded spiketrains it is the measure of the spike triggered response from one spiketrain against all other spiketrains in the list. It is a sort of proxy for how locked to the population activity every individual spiketrain is. It was (as far as I know) presented by Okun et al 2015.
Motivation I want to use this metric in one of my projects, since it is a single unit property it works ideally with the rest of my analysis.
Pitch I want to implement stPR in elephant as long as this does not already exist.
Alternatives Someone else might have implemented similar things that are not yet in elephant.
Additional context Okun, M., Steinmetz, N., Cossell, L. et al. Diverse coupling of neurons to populations in sensory cortex. Nature 521, 511–515 (2015). https://doi.org/10.1038/nature14273
In the paper they describe how to calculate the stPR (also something they call stLFP, which is similar by using one spiketrain and one LFP signal):
Population rate (for example, in Fig. 1c) was computed by accumulating all the detected spikes (both well-isolated units and multi-unit activity) with 1 ms resolution, and smoothing the resulting vector with a Gaussian of half-width 12 ms. The population rate used to compute the stPR for any individual unit did not include the spikes of that unit. The baseline level of each stPR (which reflects the mean population rate) was subtracted.
For stLFP computations, raw extracellular signals were first digitally band-pass filtered offline between 0.1 and 200 Hz to isolate the LFP. For units recorded on a particular shank, the LFP was taken from an adjacent shank (200 μm away), to avoid contaminating the stLFP by the spike waveform itself. The size of stLFP was taken as the ordinate value of the negative peak of the cross-correlation in a 1 s interval around 0 lag. stLFPs were normalized similarly to stPRs (see below).
The size of the stPR was quantified as the value of the spike-triggered population rate at 0 time lag. Thus, the population coupling of unit is given by:
Here, represents the smoothed firing rate of a neuron (Gaussian kernel of half width ms), is its mean firing rate, and represents its norm (that is, the number of spikes fired). To compare the sizes of stPRs across recordings, they were normalized by the median size of the stPR of the shuffled data in each recording (see next paragraph).
Spike shuffling was performed according to the previously described raster marginals model14. In more detail, the recording was first divided into non-overlapping 1 ms bins. A binary matrix was then constructed with one column for each time bin and one row for each isolated unit as well as additional rows for the multiunit spiking on each shank. Each matrix element contained a 1 if the corresponding unit spiked in the corresponding time bin. To shuffle, random 2-by-2 submatrices were repeatedly chosen with each row and column of the submatrix containing a 0 and 1; the positions of 0s and 1s were then exchanged in the submatrix, which leaves the summed values of each row and column identical. As we have discussed previously14, such a shuffling procedure produces in the limit a uniform sample from a distribution subject to the constraints on the mean firing rate and population rate distribution of the original data.
Hi Aitor, I see you become an engaged user of Elephant! We're currently in the middle of discussing my last PR, we'll come to your feature requests in two weeks. Would you be interested in implementing the stPR?
Hi Danilo!
Yes, I would implement it if nobody else has done it. Since I will most likely use this metric anyway, I will have to implement it at some point, and elephant seems the right place for it to be :)
We have agreed on adding this feature in Elephant. It should be in the same module with spike_triggered_xx
functions.
Do you have the source code already? If yes, open a PR and provide either unit tests or an example you use to run the functional.
That is cool! I will work on the implementation, since it is still non-existent. Will open a PR when it is ready.