Spike sorting
Action potential (“spike”) waveforms from individual motor units can be identified (“sorted”) using analysis methods that are commonly used to sort spikes from neural data. (a-d) Single channel spike sorting. In some cases, a single motor unit’s spike will dominate the recording on an individual Myomatrix channel, as shown in an example recording from mouse triceps during locomotion (a, top). In such cases, a simple voltage threshold (dashed line) can be used to isolate spike times of the largest recorded unit (blue dots) from a single channel. In contrast (a, bottom), fine-wire EMG typically does not yield isolated single units during active behaviors. (b) Single-channel spike sorting using principal components analysis (PCA) of the data shown in (a). Each data point in (b) represents a single voltage waveform represented in the dimensions defined by the first two principal components (PC1 and PC2) of the set of all spike waveforms. As described previously (Sober, Wohlgemuth, and Brainard 2008), k-means clustering can discriminate the waveforms from individual motor units (cyan dots in a and b) and waveforms from other motor units and/or background noise (black dots in b). If one of the clusters has less than 1% overlap with any other cluster (based on fitting each cluster with a 2D Gaussian as described previously) and displays an absolute refractory period (less than 1% of inter-spike intervals less than 1 msec), it is classified as a single unit (Sober, Wohlgemuth, and Brainard 2008). When applied to the Myomatrix data in (a), PCA-based sorting method produced identical spike times as the thresholding method (cyan dots in a). In contrast, the same analysis applied to the fine-wire data shown in a did not produce any well-isolated clusters in PCA space (b, right), indicating that this method could not extract any single motor units. Myomatrix and fine-wire data shown in (a,b) are from the same datasets as the examples shown in main text Figure 1a,b. (c,d) Single-channel spike sorting applied to recordings from the ventral syringeal (VS) muscle, a songbird vocal muscle (Srivastava, Elemans, and Sober 2015). Here again, PCA-based sorting of Myomatrix data method produced identical spike times as the thresholding method (orange dots in c and d). In contrast, the same analysis applied to fine-wire data recorded from VS shown in c did not produce any well-isolated clusters in PCA space (d, right), Other plotting conventions for (c,d) are the same as for the mouse data in (a,b).
(e-h) Multichannel spike sorting using Kilosort. We used Kilosort version 2.5 (Pachitariu, Sridhar, and Stringer 2023; Steinmetz et al. 2021) and custom MATLAB and Python code to sort waveforms into clusters arising from individual motor units. (e) Spike times (top) and mean waveforms (bottom) of six motor units recorded simultaneously from mouse triceps during locomotion (same dataset as Fig. 1 in the main text). Mean waveforms for the six motor units (columns at bottom) are shown from six different EMG channels (rows) and illustrate the distinct pattern of spike waveforms across channel associated with the discharge of each identified motor unit. (f) Left, feature space projection of individual waveforms (colored dots), projected onto the space of singular values (“factors”) that describe the space of all recorded waveforms. The clustering of waveforms from kilosort-identified units (colors) further illustrates the distinctness of voltage waveforms assigned to each of the identified motor units. Right, autocorrelograms (colors) and cross correlograms (gray) of the six motor units shown in (e). In addition to examining the consistency of each candidate motor unit’s spike waveforms we also inspected autocorrelations to ensure that each identified unit showed an absolute refractory period (zero or near-zero autocorrelations at lag zero) and that cross-correlograms did not have strong peaks at zero lag (which might indicate the same motor unit being detected by multiple Kilosort clusters). (g,h) Myomatrix recordings from nonhuman primate and rat (same datasets as in main text Fig. 3 and Fig. 2c), respectively. These examples (along with the mouse data in main text Fig. 1c) highlight the finding that Myomatrix arrays typically record the same motor unit on multiple channels simultaneously. This redundancy is critical for Kilosort and related methods to isolate single motor unit waveforms, particularly when waveforms from multiple units overlap in time.