Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2021 Oct 1;126(4):1055-1075.
doi: 10.1152/jn.00172.2021. Epub 2021 Aug 25.

P-sort: an open-source software for cerebellar neurophysiology

Affiliations

P-sort: an open-source software for cerebellar neurophysiology

Ehsan Sedaghat-Nejad et al. J Neurophysiol. .

Abstract

Analysis of electrophysiological data from Purkinje cells (P-cells) of the cerebellum presents unique challenges to spike sorting. Complex spikes have waveforms that vary significantly from one event to the next, raising the problem of misidentification. Even when complex spikes are detected correctly, the simple spikes may belong to a different P-cell, raising the danger of misattribution. To address these identification and attribution problems, we wrote an open-source, semiautomated software called P-sort, and then tested it by analyzing data from P-cells recorded in three species: marmosets, macaques, and mice. Like other sorting software, P-sort relies on nonlinear dimensionality reduction to cluster spikes. However, it also uses the statistical relationship between simple and complex spikes to merge disparate clusters and split a single cluster. In comparison with expert manual curation, occasionally P-sort identified significantly more complex spikes, as well as prevented misattribution of clusters. Three existing automatic sorters performed less well, particularly for identification of complex spikes. To improve the development of analysis tools for the cerebellum, we provide labeled data for 313 recording sessions, as well as statistical characteristics of waveforms and firing patterns of P-cells in three species.NEW & NOTEWORTHY Algorithms that perform spike sorting depend on waveforms to cluster spikes. However, a cerebellar Purkinje-cell produces two types of spikes; simple and complex spikes. A complex spike coincides with the suppression of generating simple spikes. Here, we recorded neurophysiological data from three species and developed a spike analysis software named P-sort that relies on this statistical property to improve both the detection and the attribution of simple and complex spikes in the cerebellum.

Keywords: Purkinje cell; cerebellum; open database; open-source software; spike sorter.

PubMed Disclaimer

Conflict of interest statement

No conflicts of interest, financial or otherwise, are declared by the authors.

Figures

None
Graphical abstract
Figure 1.
Figure 1.
Examples of challenges in cerebellar spike sorting. In the left column, local field potential (LFP) channel (10–200 Hz) is plotted in red, and the AP channel (50–5,000 Hz) is plotted in black. The middle column displays the conditional probability of a simple spike (SS) at time t, given that a complex spike (CS) occurred at time zero, labeled as Pr(S(t)|C(0)). Note the asymmetric suppression following a complex spike. The conditional probability Pr(S(t)|S(0)) indicates the probability of a simple spike at time t, given that another simple spike occurred at time zero. The right column includes individual complex spike traces, as well as the average trace. A: in this recording, complex spikes have a positive LFP peak. B: here, complex spikes cannot be identified from their LFP waveform as they lack an LFP signature. C: in this recording, complex spikes have a negative LFP peak. D: here, complex spikes coincided with the suppression of one group of simple spikes (SS1), but not a second group (SS2). The probability pattern (right column) suggests that SS2 is likely not a P-cell. E: in this recording, complex spikes do not coincide with suppression of the simple spikes. Thus, the two groups of spikes are not generated by the same P-cell. Bin size is 1 ms for the probability plots.
Figure 2.
Figure 2.
Additional challenges in identification of complex spikes (CS). A: complex spike waveforms vary because of the timing and number of spikelets. B: complex spike waveforms vary because of the temporal proximity of a simple spike (SS). Here, a simple spike before onset of a complex spike distorts the complex spike waveform. Top and middle rows: simple spike occurs at 3 or 0.2 ms before a complex spike. Bottom row: red traces are complex spikes with deformed waveforms.
Figure 3.
Figure 3.
Main window of P-sort. 1: specification of filter properties for the action potential (AP) and local field potential (LFP) channels. 2: threshold selection and the distribution of voltage peaks for events detected in the LFP and AP channels. 3: identification of simple spikes (SS). The windows include spike waveforms aligned to peak voltage, distribution of instantaneous firing frequency, conditional probability Pr(S(t)|S(0)) demonstrating a suppression period, and clustering using UMAP. 4: identification of complex spikes (CS). The windows include spike waveforms aligned to a learned template (yellow), distribution of instantaneous firing frequency, conditional probability Pr(S(t)|C(0)) demonstrating suppression of simple spikes, and clustering using UMAP. The red traces indicate complex spikes that have been distorted because of nearby simple spikes. UMAP, Uniform Manifold Approximation and Projection algorithm (9).
Figure 4.
Figure 4.
UMAP dissociates simple and complex spikes (SS and CS, respectively). A: in this recording, complex spikes do not exhibit an local field potential (LFP) signature (red trace). B: clustering of the spikes in principal component analysis (PCA) space does not produce a clear separation. However, the two groups of spikes separate in the UMAP space. The complex spikes identified by UMAP are shown in red in the PCA space. C: the waveforms and average traces for the complex spike and simple spike clusters as identified by UMAP. The conditional probabilities demonstrate that the complex spike events coincide with suppression of the simple spikes, suggesting that the two groups of spikes are likely generated by the same P-cell. Error bars are standard deviation. UMAP, Uniform Manifold Approximation and Projection algorithm (9).
Figure 5.
Figure 5.
Correcting for misalignment of complex spikes (CS). A: P-sort initially aligns complex spikes based on the sodium/potassium peak which resembles simple spikes (SS) (see methods). This results in misalignment of some complex spikes because these complex spikes do not express sodium/potassium peak. The user can delete the misaligned spikes (red) and compute a complex spike template (yellow). B: alignment of the spikes to the complex spike template does not solve the problem for all complex spikes: some of the deformed complex spikes remain misaligned. C: P-sort provides a Dissect module with which the user can change the spike alignment to compensate for the deformation. D: final complex spike alignment. Note the deformation in the complex spikes caused by the proximity of the simple spikes (red traces).
Figure 6.
Figure 6.
Identification of spikelets in the complex spike (CS) waveform. A: example of complex spike waveforms and potential spikelets. B: to help identify whether the spikelets are part of the complex spike waveform or are regular simple spikes, P-sort allows the user to visualize the temporal regularity of the spikes. In this graph, the x-axis is the timing of each simple spike with respect to the immediately preceding complex spike and the y-axis is the peak voltage of that simple spike. There appears to be two clusters of spikes. The cluster indicated by the red arrow has higher temporal precision and smaller peak voltage. C: before spikelet identification, the probability Pr(S(t)|C(0)) shows a sharp peak at around 5 ms following onset of the complex spike (red arrow, top subfigure). Removal of these spikelets produces the probability in the bottom row.
Figure 7.
Figure 7.
Finding clusters of simple (SS) and complex spikes (CS) that are likely generated by the same P-cell. A: this recording includes at least four groups of spikes: two that appear to be complex spikes and two that are simple spikes. B: UMAP clustering of the simple spike space. The two major clusters are SS1 and SS2. Their waveforms are shown by SS1-1 and SS2-1 in D. The smaller clusters are distorted spikes that are due to the temporal proximity of these major spikes, as well as other spikes, as shown in D. A smaller cluster of spikes are labeled as spikelets of complex spikes. C: UMAP clustering of the complex spike space. The two major clusters are CS1 and CS2. Their waveforms are labeled as CS1-1 and CS2-1 in E. Their waveforms can be distorted by simple spikes, as shown by CS1-2 and CS2-2. D: waveforms of various clusters labeled in the simple spike space. E: waveforms of the four clusters labeled in the complex spike space. F: suppression period of SS1 and SS2 is quantified by the probability Pr(SS1(t)|SS1(0)) and Pr(SS2(t)|SS2(0)). The probability Pr(SS1(t)|CS1(0)) quantifies the suppression following CS1. Thus, CS1 coincides with suppression of SS1 but not SS2. CS2 coincides with suppression of SS2 but not SS1. Bin size is 1 ms. UMAP, Uniform Manifold Approximation and Projection algorithm (9).
Figure 8.
Figure 8.
Splitting a complex spike (CS) cluster based on its statistical properties with simple spikes. A: in this data set, the UMAP space indicates a single complex spike cluster. However, statistical considerations raise the possibility of two subgroups, CS1 and CS2. B: the waveforms for the CS1 and CS2 subgroups are similar. C: the yellow regions are the conditional probabilities of simple spike suppression following a CS1 at time zero, or CS2 at time zero. Note that CS1 coincides with suppression of the simple spikes, but CS2 does not. Thus, although it is difficult to split the complex spike cluster into two groups based on their waveforms, they exhibit very different statistical properties. UMAP, Uniform Manifold Approximation and Projection algorithm (9).
Figure 9.
Figure 9.
Comparison of P-sort with expert curation on mice and macaque data sets. A: data from a macaque recording session. P-sort picked out 74 simple spikes (SS) that were not identified by the expert (0.29% of total), labeled as P-sort exclusive. Expert picked 382 simple spikes that were not identified by P-sort (1.48% of total), labeled as expert exclusive. Complex spikes (CS) that were exclusive to P-sort and the expert are also plotted. B: summary statistics on the mice (n = 16 sessions) and macaque (n = 34 sessions) data sets. Percentage of exclusive simple and complex spikes are plotted for the expert and P-sort. The central mark indicates median of the distribution, and the bottom and top edges of the box indicate the 25th and 75th percentiles. The thin line indicates the range of the data excluding the outliers. C: difference between P-sort and expert in terms of firing rate. Right columns show the likelihoods, normalized to the baseline simple spike probability in each session, averaged over all recording sessions for each species (bin size is 1 ms). Error bars are means ± SE.
Figure 10.
Figure 10.
Comparison of P-sort with automated spike sorting algorithms on two data sets. A: easy data set. The simple and complex spike (SS and CS, respectively) waveforms are illustrated in the first row. The conditional probability for simple spikes Pr(S(t)|S(0)) is plotted in blue. The conditional probability for simple spike suppression following a complex spike Pr(S(t)|C(0)) is plotted in yellow. All algorithms identified the simple and complex spikes. B: more difficult data set. First row shows the spikes identified by each algorithm. Kilosort did not identify the complex spikes. Second row shows the complex spikes missed by each algorithm, with respect to P-sort. Third row shows the spikes that were identified by each algorithm but not P-sort. Fourth row is the conditional probabilities for the labeled spikes. Error bars are standard deviation.
Figure 11.
Figure 11.
Performances of the automated algorithms in comparison with each other, and with P-sort. A: performance on the difficult data set (data in Fig. 6). The plots show conditional probabilities for the simple and complex spikes (SS and CS, respectively) identified by the automated algorithms and P-sort. Left column is the SS1 and CS1 relationships. Right column is the SS2 and CS2 relationship. For simple spikes, the suppression period is particularly poor for Kilosort2 for both SS1 and SS2. For complex spikes, SpyKING CIRCUS and Kilosort2 produce little or no suppression of simple spikes SS2. Bin size is 1 ms. B: spike agreement scores for 5 P-sort users and 3 automated algorithms, measured on the easy, medium, and difficult data sets. The spike agreement score was computed separately for simple and complex spikes (SS and CS, respectively), for each pair of P-sort users (Psort-Psort column, blue dots), for each pair of automated algorithms (red dots), and finally each pair of algorithm-Psort users (green dots).
Figure 12.
Figure 12.
Statistical properties of simple and complex spikes (SS and CS, respectively) in three species. A: distribution of average firing rates. B: waveform of simple and complex spikes. Simple and complex spikes of each P-cell were both normalized by setting to −1 the negative peak of the simple spike waveform. Error bars are standard deviation. C: suppression period of simple spikes (blue, SS|SS) and the suppression coincided with complex spikes (red, SS|CS). SS|SS indicates the rate of simple spikes at time t when another simple spike occurs at time zero. SS|CS indicates the rate of simple spikes at time t when a complex spike occurs at time zero. Simple and complex spike rates for each P-cell were normalized with respect to average simple spike firing rate. Error bars are standard deviation. D: suppression period of simple spikes following arrival of a complex spike. Suppression period for each P-cell was defined as the duration of time after a complex spike that was required before the simple spike rate recovered 63% of its precomplex spike value. The red line indicates mean. E: interspike interval (ISI) distribution for simple (blue) and complex spikes (red). ISI data for each spike type in each cell was normalized so that the average ISI, defined as the inverse of the average firing rate, was equal to one. Error bars are standard deviation.

Similar articles

Cited by

References

    1. Thach WT Jr. Somatosensory receptive fields of single units in cat cerebellar cortex. J Neurophysiol 30: 675–696, 1967. doi:10.1152/jn.1967.30.4.675. - DOI - PubMed
    1. Eccles JC, Llinás R, Sasaki K. The excitatory synaptic action of climbing fibres on the Purkinje cells of the cerebellum. J Physiol 182: 268–296, 1966. doi:10.1113/jphysiol.1966.sp007824. - DOI - PMC - PubMed
    1. Sato Y, Miura A, Fushiki H, Kawasaki T. Short-term modulation of cerebellar Purkinje cell activity after spontaneous climbing fiber input. J Neurophysiol 68: 2051–2062, 1992. doi:10.1152/jn.1992.68.6.2051. - DOI - PubMed
    1. Gao H, Solages C, Lena C. Tetrode recordings in the cerebellar cortex. J Physiol Paris 106: 128–136, 2012. doi:10.1016/j.jphysparis.2011.10.005. - DOI - PubMed
    1. Han K-S, Chen CH, Khan MM, Guo C, Regehr WG. Climbing fiber synapses rapidly and transiently inhibit neighboring Purkinje cells via ephaptic coupling. Nat Neurosci 23: 1399–1409, 2020. doi:10.1038/s41593-020-0701-z. - DOI - PMC - PubMed

LinkOut - more resources