Available via license: CC BY 4.0
Content may be subject to copyright.
1
Striatal ensemble activity in an innate naturalistic behavior
Samuel Minkowicz1, Mychaela Alexandria Mathews1, Felicia Hoilam Mou1, Hyoseo Yoon1, Sara
Nicole Freda1, Ethan S Cui1, Ann Kennedy2#, Yevgenia Kozorovitskiy1#
1Department of Neurobiology, Northwestern University, Evanston, IL, United States; 2Department of
Neuroscience, Northwestern University, Chicago, IL, United States
#Corresponding authors (Ann.Kennedy@northwestern.edu, Yevgenia.Kozorovitskiy@northwestern.edu)
Author ORCIDs
SM: 0000-0003-1555-1158, MAM: 0000-0002-8937-4492, FHM: 0000-0002-5263-7471, HY:
0000-0001-9263-4948, SNF: 0000-0003-3099-4571, ESC: 0000-0002-6589-1532, AK: 0000-
0002-3782-0518, YK: 0000-0002-3710-1484
Abstract
Self-grooming is an innate, naturalistic behavior found in a wide variety of organisms. The control of
rodent grooming has been shown to be mediated by the dorsolateral striatum through lesion studies and
in-vivo extracellular recordings. Yet, it is unclear how populations of neurons in the striatum encode
grooming. We recorded single-unit extracellular activity from populations of neurons in freely moving
mice and developed a semi-automated approach to detect self-grooming events from 117 hours of
simultaneous multi-camera video recordings of mouse behavior. We first characterized the grooming
transition-aligned response profiles of striatal projection neuron and fast spiking interneuron single units.
We identified striatal ensembles whose units were more strongly correlated during grooming than during
the entire session. These ensembles display varied grooming responses, including transient changes
around grooming transitions or sustained changes in activity throughout the duration of grooming. Neural
trajectories computed from the identified ensembles retain the grooming related dynamics present in
trajectories computed from all units in the session. These results elaborate striatal function in rodent self-
grooming and demonstrate that striatal grooming-related activity is organized within functional
ensembles, improving our understanding of how the striatum guides action selection in a naturalistic
behavior.
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
2
Introduction
Self-grooming is an evolutionarily conserved, ethologically relevant, and innate behavior. Self-grooming
is found in arthropods1,2, birds3–5, and mammals6–10. In mammals, grooming serves to care for the outer
body surface, for de-arousal11,12, thermoregulation13–15, and water economy16. Rodent grooming is an
innate behavior9,17–20, with mice showing primitive forms of facial grooming as early as postnatal day 1
(p1)17. From p4-8, the kinematics of grooming movements become more tightly coordinated. After p9,
mice start to perform movements similar to those performed by adults. Rat pups begin to exhibit functional
face grooming at p6-89, but do not perform long sequences of grooming until p14-2118–20, the time of
development when many complex motor programs begin to emerge21,22.
The selection and initiation of actions is controlled by the striatum23–29. The striatum has been shown to
encode action space30 and to flexibly combine behavioral motifs into actions25. Cells within the striatum,
predominantly consisting of striatal spiny projection neurons31–33, are organized into functional clusters
of co-active units; this clustering is considered to be important for striatal network dynamics34,35 and
behavioral control30,36–40. The striatum has been implicated in the production of self-grooming behavior,
and lesions of the striatum disrupt grooming bouts41. Within the striatum, neurons of the dorsolateral
striatum42,43 and nearby central striatal regions44 display grooming-related activity. Yet, how populations
or ensembles of neurons in the striatum—defined here as sets of neurons that are more likely than chance
to be co-active—encode self-grooming remains unclear. Given the likely importance of ensemble activity
in the striatum, elaborating whether grooming-associated neural activity maps onto striatal ensembles is
significant, and it remains to be elucidated.
Here we recorded simultaneous activity of populations of neurons in the dorsolateral striatum of freely
moving mice during spontaneous grooming using extracellular probes. Because grooming can be a
relatively rare behavior, many hours of data must be acquired to capture an adequate sample of its neural
correlates. To overcome this obstacle, we developed a semi-automated approach to detect grooming bouts
from behavioral videos using 3D pose estimation and postural heuristics. We found striatal projection
neurons (SPN) and fast spiking interneurons (FSI) with temporally diverse grooming-related activity.
Furthermore, we identified striatal ensembles that encode core parameters of grooming bouts, including
the transitions in and out of individual bouts, as well as bout duration.
Results
Mice were placed in a transparent, triangular arena with video recorded from each side to capture
spontaneous behavior (Figure 1A, B). We identified mouse grooming bouts in a semi-automated 4-step
process (Figure 1C). First, mouse limb positions were tracked in 2D in each view using DeepLabCut and
triangulated to 3D using Anipose (see Methods). The 3D limb positions were then used to isolate likely
grooming times, using a set of postural heuristics including movement speed, whether the animal was
rearing, and the hand-to-nose distance. These heuristics identified general windows during which
grooming was likely to be occurring, but they did not capture the precise timing of the behavior. We
therefore refined heuristic output using manual frame-by-frame annotation, to capture the precise start and
stop times of grooming (Figure 1—figure supplement 1A). In 117 total hours of analyzed video, we
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
3
observed 304.8 minutes of grooming behavior within 1,475 individual bouts of grooming; mice groomed
for 4.1% of each session on average (Figure 1D, 4.1 ± 0.3%, 63 sessions from 6 mice). Grooming bouts
were on average 12.4 seconds long (Figure 1E, 12.4 ± 0.4 seconds) and separated by 4.3 minutes (Figure
1F, 4.3 ± 0.1 minutes).
Figure 1. 3D tracking and characterization of the structure of mouse spontaneous grooming. A. Schematic of
experimental setup. Mice were placed into an equilateral triangular arena made of transparent acrylic (12-inch sides
and height) and their behavior was captured with three side view cameras. Schematic is not to scale. B. Example
video frames of mice during spontaneous grooming. C. Overview of our 4-step grooming identification approach.
D. Distribution of the percent of each session that mice spent spontaneously grooming (6 mice, 63 sessions, 117
experiment hours, 1,475 grooming bouts, 304.8 total minutes of spontaneous grooming). E. Distribution of
spontaneous grooming bout durations in seconds (for the same dataset as in D). F. Distribution of inter-bout
intervals in minutes (for the same dataset as in D).
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
4
Figure 1—figure supplement 1. Manual refinement of grooming identification. A. Example annotations
of grooming behavior by four annotators. Green regions in each row denote times that the annotator labeled as
grooming and gray regions denote times not annotated as grooming. Vertically aligned white spaces indicate breaks
of variable time between individual grooming bouts. Average pairwise Jaccard Index (or Intersection over Union)
computed on all annotations from a single 2-hour session was 0.76 ± 0.04.
To record striatal activity during mouse spontaneous grooming, we implanted 64-channel electrodes into
the dorsolateral striatum of adult male and female mice (Figure 2—figure supplement 1A-D, N=6 mice).
We classified well-isolated units as putative striatal spiny projection neurons (SPN) and putative fast
spiking interneurons (FSI) on the basis of their firing rates and spike waveform, following established
criteria45–47. Units that did not fit the criteria for SPNs or FSIs were labelled as ‘other’ and excluded from
further analyses. (Figure 2A, SPN: 88.2% 2,755 units, FSI: 3.2% 100 units, other: 8.6% 269 units).
To identify example individual units with grooming-related activity, we isolated units whose activity
within a two-second window around the start or end of grooming was two standard deviations above mean
activity during a grooming-free baseline period. All subsequent analyses were performed on the full
dataset. Example SPNs and FSIs with grooming related activity are shown in Figure 2B-E. We observed
units displaying diverse grooming-related responses, including increased activity at the start of grooming,
end of grooming, and both start and end of grooming, as well as units that showed elevated activity for
the duration of grooming, and units that showed reduced activity for the duration of grooming.
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
5
Figure 2. Striatal cell type specific activity mapped to spontaneous self-grooming. A. Classification of recorded
units. Left: units were categorized as either SPNs, FSIs, or ‘other’ by their firing rates, spike waveform peak width,
and duration between spike waveform peak to valley (SPN: 88.2% 2,755 units, FSI: 3.2% 100 units, other: 8.6%
269 units). Right: average +/- SEM spike waveforms for units in each category. B. Activity of 4 example SPNs
during grooming. Neural activity are aligned to the start of grooming bouts, denoted by t = 0. Top: spike raster plots
for the example neuron during each grooming bout in the given session. Grooming bouts are sorted by grooming
bout duration, denoted by the green rectangles. Bottom: unit average firing rate aligned to grooming start and
normalized to [0, 1]. C. Activity of 4 example SPNs as in B, but for aligned to groom end. D. Activity of 4 example
units as in B, but for FSIs aligned to groom start. E. Activity of 4 example units as in B, but for FSIs aligned to
groom end.
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
6
Figure 2—figure supplement 1. Probe placement and firing rate characteristics. A. Schematic depicting how
the four shanks within our recording electrodes were implanted along the anterior-posterior axis (shanks span 600
μm). B. Representative coronal slices of electrode placements. Coronal histological slices were obtained and
registered to the Allen Common Coordinate Framework (CCFv3) using the WholeBrain software package. Blue
arrows depict the most ventral electrode position for each mouse. Blue lines depict the region covered by sites in
one shank of each electrode. Anterior-Posterior (A/P) coordinates from Bregma used for registration are depicted
above each slice. (6 mice, scale bar DV and ML = 1 mm). C. Distribution of firing rates for all recorded units (3,124
units. 6 mice). D. Distribution of inter-spike intervals for all recorded units (3,124 units. 6 mice).
To characterize different grooming-associated responses in the recorded striatal units, we first performed
principal components analysis (PCA)48 on the grooming transition-triggered-average activity of all
recorded SPNs and FSIs. We performed PCA separately on SPN activity aligned to groom start, SPN
activity aligned to groom end, FSI activity aligned to groom start, and FSI activity aligned to groom end.
The first principal component (PC) from each group reflects units that undergo a step-like increase or
decrease in their activity at the grooming transition (Figure 3A, B, F, G, K, L, P, Q, SPNs aligned to
groom start: 336 units with positive contributions to the first PC (denoted “> 0”), 640 < 0, SPNs aligned
to groom end: 526 > 0, 424 < 0, FSIs aligned to groom start: 66 > 0, 1 < 0, FSIs aligned to groom end: 22
> 0, 44 < 0). The second PC from each group reflects units whose activity transiently peaks or decreases
around the grooming transition (Figure 3C, D, H, I, M, N, R, S, SPNs aligned to groom start: 364 > 0,
292 < 0, SPNs aligned to groom end: 164 > 0, 518 < 0, FSIs aligned to groom start: 4 > 0, 19 < 0, FSIs
aligned to groom end: 5 > 0, 19 < 0). Taken together, these results show that single unit SPNs and FSIs
encode transitions into and out of an innate naturalistic behavior.
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
7
Figure 3. Emergent motifs in SPN and FSI activity around grooming transitions. A. First principal component
from decomposing 10 seconds of SPN activity centered around grooming bout start times (1,632 units, explains
9.3% of variance). B. Activity around grooming start for units that had the largest magnitude weight for the first
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
8
principal component. Units with weight > 0 are shown above the horizontal black line (336 units) followed by units
with weight < 0 (640 units). Units are sorted by their weight for PC1. Each unit’s activity was normalized to the
range from zero to one. C. Same as A, but for the second principal component (explains 5.1% of variance). D. Same
as B, but for the second principal component (364 units with weight > 0, 292 units with weight < 0). E. Donut plot
depicting the number of units with positive and negative weights for the first two principal components. F-J. Same
as A-E, but for FSIs aligned to groom start (66 units with PC1 weight > 0, 1 unit with PC1 weight < 0, 2 units with
PC2 weight > 0, and 19 units with PC2 weight < 0. PC1 explains 21.2% of variance and PC2 explains 7.1% of the
variance). K-O. Same as A-E, but for SPNs aligned to groom end (526 units with PC1 weight > 0, 424 units with
PC1 weight < 0, 164 units for PC2 weight > 0, and 518 units with PC2 weight < 0. PC1 explains 12.9% of variance
and PC2 explains 5.2% of the variance). P-T. Same as A-E, but for FSIs aligned to groom end (22 units with PC1
weight > 0, 44 units with PC1 weight < 0, 5 units with PC2 weight > 0, and 19 units with PC2 weight < 0. PC1
explains 34.6% of variance and PC2 explains 8.6% of the variance).
The event-triggered average responses of striatal neurons reveal several patterns of firing rate modulation
aligned with the start or end of grooming. However, because this analysis relies on trial-averaging, it
cannot be used to determine whether the striatum contains ensembles of neurons that are consistently co-
active. To address this question, we looked for functional clusters, or ‘ensembles’ of co-active striatal
neurons with grooming related activity. To achieve this, we first constructed a matrix containing the
grooming activity of all units in a given session, where the activity of each unit plus 5 seconds before and
after grooming was concatenated. This matrix is shown for an example session in Figure 4A; dendrogram-
based sorting of recorded units makes evident the presence of synchronous activity in groups of units.
Synchrony among units is also suggested by the block-diagonal structure of the correlation matrix for this
example session (Figure 4B). This synchrony is further suggested by comparison to a time-shuffled
version of the data (Figure 4—figure supplement 1A) and its corresponding correlation matrix (Figure
4—figure supplement 1B).
To test for the presence of ensembles and to estimate the number of potential ensembles within each
session, we used an eigenvalue-based statistical method49,50, where we identify dimensions of the neural
covariance matrix that capture more variance than expected by chance and found each session to have
three to ten ensembles (Figure 4C, 6.2 ± 0.3 ensembles, 33 sessions, see Methods for details). Next, using
the meta-k-means clustering algorithm51, we identified the ensembles present in each session. Meta-k-
means is an extension of k-means where one performs N iterations of k-means, keeping track of how many
times each pair of units gets clustered together. The proportion of times that each pair gets clustered
together is used to assign intermediate clusters before a final merging step. We chose to use meta-k-means
for two reasons. First, meta-k-means does not always result in cluster assignment for all units, which is
preferable because our recording configuration only samples a small subset of neurons in striatum and we
do not expect all recorded units to belong to an identified striatal ensemble. Second, meta-k-means allows
for the final number of identified ensembles to be greater or less than the initial choice of k, which is
preferable because we do not have a priori knowledge of ensemble numbers present in each session.
We found that 80% of recorded SPNs (1,074 units) and 70% of recorded FSIs (41 units) were clustered
into ensembles of two or more units (Figure 4—figure supplement 1C). The majority of clusters were
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
9
composed of only SPNs, and FSIs were almost always assigned clusters together with SPNs (Figure 4—
figure supplement 1D; 88% (214 clusters) SPN only, 1% (1 cluster) FSIs only, 11% (28 clusters) SPN
and FSIs). Within our identified ensembles, units in the same ensemble tended to be spatially closer than
units that are not within the same ensemble (Figure 4D), consistent with striatal ensembles detected using
imaging techniques30,38,39. During grooming, the pairwise correlation between units within the same
cluster is higher than for the correlation between units not in the same cluster, whether those units are
unclustered or belong to a different cluster (Figure 4E). The distributions of pairwise correlations
computed using data from the whole session are shown in Figure 4F. This in-versus-out of cluster
difference is weaker when comparing unit activity during the whole session, rather than during grooming
(Figure 4G, grooming AUC: 0.81, whole session AUC: 0.69).
Figure 4. Identification and characterization of striatal grooming ensembles. A. Heatmap of activity during
grooming for all units in an example session (53 units, 6.55 minutes). Arrows point out a subset of synchronous
events. Each unit’s activity is normalized to [0, 1]. B. Correlation matrix for the activity shown in A. C. Distribution
of statistical estimate for the number of ensembles within a given session (4 mice, 33 sessions). The estimate is
obtained by computing the number of eigenvalues from the data that are above the 99th percentile of the distribution
of eigenvalues from 5,000 random shuffles of the data. D. Average cumulative distribution of pairwise unit distances
for each pair of units that are within the same cluster (red) and each pair of units that are not within the same cluster
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
10
(blue). Plot depicts the mean ± SEM of the cumulative distribution across mice (4 mice). E. Distribution of pairwise
unit correlations during grooming for each pair of units that are within the same cluster (pink 2,747 pairs) and each
pair of units that are not within the same cluster (blue 27,421 pairs). Left: histogram. Right: cumulative distribution.
F. Same as in E, but for pairwise correlations computed from activity during the entire session including grooming
times. G. Comparison between the difference in pairwise unit correlations for units within and not within the same
cluster computed during grooming (green) and during the whole session (orange) (grooming AUC: 0.81, whole
session AUC: 0.69).
The distribution of the number of ensembles identified in each session is shown in Figure 4—figure
supplement 1E. We found a significant positive relationship between the number of ensembles identified
and the number of units in each session (Figure 4—figure supplement 1F, R2 = 0.239, p = 0.004). The
distribution of the number of units within each cluster is shown in Figure 4—figure supplement 1G
(median cluster size = 4 units, mean = 4.6 ± 0.2 units). Cluster size did not increase with the number of
units recorded in a given session (Figure 4—figure supplement 1H, R2 = 0.01, p = 0.582). The
distribution of the percent of clustered units in each session is shown in Figure 4—figure supplement 1I
with half of sessions having at least 82% clustered units.
Figure 4—figure supplement 1. Statistics of identified clusters and activity patterns. A. Heatmap of activity
during grooming with shuffled time bins for all units in the example session shown in 4A (53 units, 6.55 minutes).
Arrows are in the same position as in Figure 4A highlighting the absence of synchrony after shuffling. Each unit’s
activity is normalized to the range from zero to one. B. Correlation matrix for the shuffled activity shown in A. C.
Total number of SPNs and FSIs that were clustered (pink) and unclustered (blue) (4 mice, 33 sessions, 243 clusters).
D. Total number of clusters that comprised of only SPNs (purple), only FSIs (green), and of both SPNs and FSIs
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
11
(orange) (data as in C). E. Distribution of the number of clusters in each session. F. Relationship between the
number of clusters found in each session and the number of units in that session (R2 = 0.239, p = 0.004). G.
Distribution of the number of units in each cluster (data as in C). H. Relationship between the average cluster size
in each session and the number of units in that session (R2 = 0.01, p = 0.582). I. Cumulative distribution of the
percent of clustered units in each session. Dashed lines denote that half the sessions have at least 82% clustered
units (data as in C).
Having demonstrated the existence of ensemble activity during grooming, we next asked whether
ensemble activity was enriched during specific timepoints during grooming. A heatmap displaying the
average grooming activity for all significant ensembles is shown in Figure 5A (112 ensembles, 4 mice,
33 sessions). To visualize the average grooming activity of ensembles across grooming bouts of varying
duration, we first linearly time-warped ensemble activity during grooming. We found that ensemble peak
activity is enriched around the transitions into and out of grooming (Figure 5B), but that the dynamics of
grooming ensemble activation are diverse. For example, we found ensembles with higher activity during
grooming, lower activity during grooming, and with peak activity at the start or end of grooming, with
individual cluster examples of these patterns shown in Figure 5 C-F and Figure 5—figure supplement
1C. This finding was unchanged when we analyzed the percentage of active units within each ensemble
rather than the ensemble-average firing rate (Figure 5—figure supplement 1A, B).
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
12
Figure 5. Striatal ensembles encode features of self-grooming. A. Heatmap depicting the grooming-aligned
average activity of all striatal ensembles. Ensemble averages are normalized to the range from zero to one. Prior to
averaging across grooming bouts, ensemble activity during each grooming bout, excluding the 5 seconds before
and after grooming, was linearly time warped to a fixed duration. Ensembles are sorted by peak time (112
ensembles, 4 mice, 33 sessions). B. Distribution of time at which ensemble average activity peaked (data as in A).
C. Representative example of an ensemble with increased average activity around grooming transitions. Grey region
denotes the range of activity for shuffled ensemble activity. Bottom of the range depicts the 2.5th percentile of the
shuffled activity, top of the range depicts the 97.5th percentile of the shuffled activity, and grey line depicts the
average shuffled activity. D. Representative example of an ensemble with increased average activity at the start of
grooming (grey region as in C). E. Representative example of an ensemble with increased average activity at the
end of grooming (grey region as in C). F. Representative example of an ensemble with increased average activity
throughout the duration of grooming (grey region as in C). G. Neural trajectories traced out in factor space by the
population of units recorded during all grooming bouts in an example session (65 units, 22 grooming bouts). Colors
depict different grooming bouts, pluses denote the start of grooming, and asterisks denote the end of grooming. H.
Neural trajectories traced out in factor space by the population of clustered units during all grooming bouts in an
example session (49 units, 22 grooming bouts). Visualization elements as in G. I. Ensemble trajectories traced out
in factor space by the striatal ensembles during all grooming bouts in an example session (13 ensembles, 22
grooming bouts). Visualization elements as in G.
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
13
To contrast the encoding of grooming-related activity in ensembles vs unclustered units, we used
nonnegative matrix factorization to perform dimensionality reduction on the neural activity during
grooming within a single session. The trajectories traced out by the population activity of all units during
all grooming bouts in an example session are shown in Figure 5G (65 units). During most grooming bouts
the population activity moves out along factor 1, then up along factor 2, and finally returns toward the
origin along factor 3, corresponding to population encoding of grooming onset, maintenance, and
termination. The neural trajectories computed from unclustered units do not retain the dynamics present
in the trajectories from all units or the clustered ones (Figure 5—figure supplement 1D, 16 unclustered
units; Figure 5H, 49 clustered units). Notably, the ensemble trajectories computed from the activity of
ensembles retain most of the dynamics seen in the trajectories computed from the activity of single units
(Figure 5I, 13 ensembles).
Figure 5—figure supplement 1. Patterns of cluster engagement. A. Heatmap depicting the percent of units
within each ensemble that are active during grooming averaged across all grooming bouts in a given session. Prior
to averaging across grooming bouts, ensemble activity during each grooming bout was interpolated to a fixed
duration, excluding the 5 seconds before and after grooming. Ensembles are in the same order as in Figure 5A and
data are normalized to the range from zero to one (112 ensembles, 4 mice, 33 sessions). B. Distribution of times
when the percent of active units in an ensemble peaked (data as in A). C. Representative example of an ensemble
with decreased average activity throughout the duration of grooming (grey region as in Figure 5C). D. Neural
trajectories traced out in factor space by the population of unclustered units during all grooming bouts in an example
session (16 units, 22 grooming bouts). Visualization elements as in Figure 5G.
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
14
Discussion
Here, we developed a semi-automated approach to identify grooming events in mouse behavioral videos.
We recorded population activity in the dorsolateral striatum of freely moving mice and found SPNs and
FSIs with activity that encodes the start and end of spontaneous grooming bouts. Previous studies reported
changes in striatal single unit activity around the start and end of naturalistic42,43,52 and learned
behaviors24,53,54. Our single unit data elaborate the changes in striatal unit activity around the transitions
of a naturalistic behavior. Single unit responses were heterogenous and included units with changes in
activity at the start or end of grooming, as well as units that were active or silenced throughout the duration
of grooming. We identified striatal ensembles with units that were more correlated during grooming than
during the entire session. These striatal ensembles encoded grooming start time, end time, and bout
duration. Single session trajectories computed from ensemble activity retain most of the dynamics present
in trajectories computed from all units in the session.
The distribution of pairwise distances between units within an ensemble is shifted towards smaller
distances, compared to the distribution of distances for units that do not belong to the same ensemble. This
is consistent with striatal ensembles detected using imaging techniques30,38,39 although our identified
ensembles are less spatially compact than those previously reported. Notably, however, striatal 2-photon
imaging approaches and microendoscopic imaging of genetically encoded calcium indicators yield a
recording area that extends along the medial-lateral and anterior posterior axes (i.e., horizontally), whereas
our four-shank electrophysiological recordings yield a recording field that extends along the anterior-
posterior and dorsal-ventral axes (i.e., vertically), potentially accounting for this difference in findings.
Together, the ensemble distances recorded via both methods suggest the possibility that striatal ensembles
are isotropically organized, which is well-aligned with studies of cortical and thalamic projection patterns
to the striatum55–57.
While the ensembles we characterized were identified during grooming behavior, it is possible that they
are not grooming-specific. One possibility for the functional organization of striatal ensembles is that
ensemble membership is stable across different behaviors. Then, ensemble activation encodes some
common movement motif or state that is present across multiple behavioral settings. However, the units
within our identified striatal ensembles were more correlated during grooming than during the entire
recording session. Our data therefore support an alternative to the stable membership hypothesis, wherein
individual units can be members of multiple ensembles, such that when a given unit is active, the behavior
the animal is performing can only be determined by looking at the population level. For example, a set of
units might be members of a single ensemble that encodes the start of grooming, but each unit could also
be part of different ensembles that encode aspects of other natural behaviors, such as eating or walking.
This ‘mixed selectivity’ is broadly consistent with previously reported data on striatal activity patterns
and cluster memberships that are not conserved across divergent behavioral motifs30,39.
Striatal FSIs are parvalbumin-containing GABAergic interneurons that make up approximately 1% of
striatal neurons33,58,59. FSIs receive direct cortical input, form inhibitory synapses onto SPNs33,60,61, and
are interconnected amongst themselves via gap junctions on their dendrites62. Previous studies found
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
15
uncoordinated, idiosyncratic task-related changes in FSI activity63, as well as changes in FSI activity that
correlated with movement features like velocity64, with one study showing grooming-related activity in a
small number of recorded putative FSIs43. We recorded units that match spike waveform features and
firing rates of FSIs45,59 and found them to have grooming related activity. These units displayed decreased
or increased activity during grooming, as well as transient activity changes at the transitions into and out
of grooming. Consistent with strong connectivity present between FSIs and SPNs65, a majority of FSIs
(70%) were part of identified ensembles and almost all FSIs were part of ensembles together with SPNs.
Striatal control of movement is mediated via two parallel pathways: the direct and indirect pathway,
composed of dSPNs and iSPNs66–68. Previous recordings of direct and indirect pathway striatal ensemble
activity have found that d- and iSPNs exhibit a similar time course of behavior-related changes in their
activity23,30,38 and have similar ensemble organization30, suggesting mixed pathway membership within
ensembles. Indeed, simultaneous recording of direct and indirect pathway SPNs showed that striatal
ensembles are composed of d- and iSPNs in equal proportions39. These prior data suggest that striatal
ensembles encoding self-grooming might be composed of both d- and iSPNs, in similar proportions and
with similar encoding of grooming, although this remains to be confirmed.
Within bouts of rodent self-grooming, animals perform highly stereotyped grooming sequences called
syntactic grooming69,70. This sequence is comprised of four distinctive phases and found in a variety of
species8–10. A large body of work has established a function for the striatum in the sequential ordering of
syntactic grooming phases41,52,71,72. On a longer time scale, grooming is one of many behaviors an animal
can perform at a given time. Since self-grooming, although broadly important, is not often an immediate
concern, grooming is considered a low priority behavior73. Thus, the control of grooming has been
characterized by a disinhibition model, in which grooming takes place in the time left over by other higher
priority behaviors when grooming would be inhibited74. Previous studies have demonstrated a striatal role
in behavioral sequencing on this longer time scale as well25,30. Thus, self-grooming represents an
ethologically meaningful behavioral paradigm providing a path to study neural control of an innate,
conserved behavior at multiple spatiotemporal scales.
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
16
Materials and Methods
Subjects
Animals were handled according to protocols approved by the Northwestern University Animal Care and
Use Committee (protocol number: IS00009022). Adult male and female C57BL/6J mice (p57-105) were
used in this study (The Jackson Laboratory, RRID:IMSR_JAX:000664). All mice were group-housed in
a humidity-controlled, ambient temperature facility, with standard feeding, 12 hr. light-dark cycle, and
enrichment procedures.
Electrode implantation
Mice were anesthetized with isoflurane (3% for induction, 1.5-2% for maintenance) and placed on a small
animal stereotax frame (David Kopf Instruments, Tujunga, CA). A 4-shank 64-channel silicon electrode
(part #A4x16-Poly2-5mm-23s-200-177-H64LP_30mm mounted on a dDrive-m, NeuroNexus
Technologies, Ann Arbor, MI) was implanted into the dorsolateral striatum (0.5 mm AP, 2 mm ML, and
lowered 0.25 mm) and secured with Vetbond (3M, Maplewood, MN) followed by dental cement (Micron
Superior 2, Prevest DenPro, Jammu, India, or C&B Metabond, Parkell, Edgewood, NY). The electrode
shanks were aligned with the brain’s anterior-posterior axis. A skull screw was connected to the electrode
ground wire and fastened to the skull above the ipsilateral cerebellum. The screw was secured with
Vetbond followed by dental cement. Mice were monitored following the surgery to ensure a full recovery
and were administered post-operative analgesics. Mice recovered for at least 5 days after implantation.
Behavioral recording
On the first day of experimentation, mice were acclimated to the experimental arena for 30 minutes. All
subsequent experimental sessions were 120 minutes long. The experimental arena was an equilateral
triangular arena constructed from transparent acrylic (Figure 1A. 12-inch sides and height, 1/8-inch thick.
Part #8536K131, McMaster-Carr, Elmhurst, IL) fastened together with clear epoxy (Part #31345, Devcon,
Solon, OH). While in the arena, mice were given DietGel (ClearH2O, Westbrook, ME) for food and
hydration. One mouse was in the arena at a time. The arena was cleaned with 70% ethanol after each
session. The arena was enclosed by a dark curtain and illuminated by infrared LEDs. Experiments were
conducted during the animal’s active phase.
Mouse behavior was captured with three side-view cameras at 125 fps using a custom fork of the campy
Python package75 (Figure 1A. image size 1440 x 608 pixels. cameras: Part #BFS-U3-16S2M-CS
Teledyne FLIR, Wilsonville, OR. Lenses: Part #8595755548 Yohii, China). To synchronize recordings
from all cameras, each frame grab was triggered by a TTL pulse sent from a microcontroller (Arduino,
Turin, Italy). To facilitate alignment of videos and neural data, each frame grab TTL pulse was also sent
to the electrophysiology acquisition board and the video and neural recordings were simultaneously
initiated by pressing a button connected to the microcontroller.
Electrophysiological recording
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
17
A 64-channel headstage (part #C3325 Intan Technologies, Los Angeles, CA) was connected to the
implanted electrode. In the arena, the headstage was connected to a 12-channel commutator supported by
a balance arm (Part # FL-12-C-MICRO-BAL Dragonfly Inc., Ridgeley, WV). Neural recordings were
acquired at 30 kHz with an Open Ephys acquisition board76 and the Open Ephys GUI76 (GUI version
0.5.5, Open Ephys, Atlanta, GA). To facilitate alignment of videos and neural data, the video and neural
recordings were simultaneously initiated by pressing a button connected to the microcontroller.
Neural recordings were spike sorted offline using KiloSort377 in MATLAB (MathWorks, Natick, MA).
We only considered units labeled as ‘good’ by KiloSort. Additionally, we manually inspected the
waveforms of all units labeled as ‘good’ and excluded units with waveform shapes that did not resemble
an action potential. Recordings were performed from each animal until the number of ‘good units, as
identified by KiloSort, stayed below 15 for 2 consecutive days (27.3 ± 4.3 days since implant).
Unit classification
All recorded units were classified as either putative striatal projection neurons (SPN), fast-spiking
interneurons (FSI), or ‘other’ based on their spike waveform and mean firing rate across the entire session
following established criteria45–47. Units were classified as putative SPNs (88.2 %) if they had peak width
> 150 µs, peak-valley interval > 500 µs, and mean firing rate ≤ 10 Hz. Units were classified as FSIs (3.2
%) if they had peak width ≤ 150 µs, peak-valley interval ≤ 500 µs, and mean firing rate ≥ 0.1 Hz. Units
that were not identified as either putative SPNs or FSIs were labeled ‘other’ (8.6 %) and excluded from
all analyses.
Histology
After the recordings, coronal brain sections were obtained from all mice to determine electrode placement.
Mice were deeply anesthetized with isoflurane and transcardially perfused with 4% paraformaldehyde
(PFA) in 0.1 M phosphate buffered saline (PBS). Brains were post-fixed for 1-2 days and washed in PBS.
Brains were then sectioned on a vibratome (Leica Biosystems, Wetzlar, Germany) at 60 µm from frontal
cortex to posterior striatum and then dried and cover slipped under glycerol:TBS (9:1) with Hoechst 33342
(2.5 µg/ml, Thermo Fisher Scientific, Waltham, MA). Sections were imaged on an Olympus VS120 slide
scanning microscope (Olympus Scientific Solutions Americas, Waltham, MA) with DAPI for localization
of cell nuclei and FITC for background fluorescence to enable electrode localization.
Electrode localization
Coronal slices containing electrode tracts were processed using WholeBrain software package78 in R79.
Histological slices were analyzed and registered to the Allen Mouse Brain Common Coordinate
Framework (CCFv3)80 as described previously81. Striatal sections with electrode tracts were analyzed at
60 µm intervals and frontal lobe cortical sections, which rarely contained electrode tracts, were analyzed
at 100-200 µm intervals. A total of 6-18 section images were analyzed per mouse brain. Electrode
placement for each brain section was denoted at the most ventral location that the electrode tract was
observed. Medial-lateral and dorsal-ventral coordinates registered to the CCFv3 were obtained for each
section and plotted on a representative coronal section using the WholeBrain package.
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
18
Grooming identification
We identified mouse grooming bouts in behavioral videos using a semi-automated 4-step procedure
(Figure 1C). As detailed further below, first, we tracked the mouse limb positions in 2D; second, we
triangulated to the 2D limb positions to 3D; third, the 3D limb positions were used to isolate likely
grooming times; and fourth, using the likely times of grooming we manually identified grooming bout
start and stop times.
For 2D pose estimation, we used DeepLabCut (version 2.2.0.5)82,83 to detect 15 keypoint positions (snout,
both paws, wrists, elbows, shoulders, eyes, ears, and hind paws) on the frames from each camera. We
labeled the 15 keypoints in 1,627 frames from 14 videos, 3 animals, and all 3 cameras. We trained a
ResNet-50-based neural network84,85 with default parameters on 90% of the labeled frames for 300,000
iterations. We validated with 1 shuffle and got a train error of 3.88 pixels and test error of 6.64 pixels
(image size: 1440 x 608 pixels). We used a p-cutoff of 0.6 to condition the x and y coordinates for future
analyses. With the p-cutoff, the train error was 3.27 pixels and test error 5.06 pixels. This network was
then used to analyze all videos from the same experimental setting.
For 3D triangulation of the 2D poses we relied on Anipose86. We calibrated our 3 cameras with a 3-minute
video of a ChArUco board throughout the camera fields of view (125 FPS. Image size 1440 x 608 pixels).
The ChArUco board was printed on paper and taped onto a stiff plastic board. The ChArUco pattern had
7x10 squares containing 4-bit markers and a dictionary size of 50 markers. Before triangulation, we
applied a Viterbi filter to the 2D poses with F = 12 frames. The triangulation was performed via an
optimization constrained on the distance between the two eyes and the distance between each eye and the
snout. We chose scale_smooth = 5, scale_length = 2, and score_threshold = 0.3.
To isolate times when the mouse was likely grooming, we identified frames where the mouse was rearing,
and its paws were near its head. To identify frames where the mouse was rearing, we set thresholds on the
snout height and the distance between the midpoint of the eyes and the midpoint of the hindlimbs. To
identify frames where the mouse’s paws were near its head, we set thresholds on the distance between the
midpoint of the paws and the snout, the distance between the midpoint of the paws and the midpoint of
the eyes, and height of the midpoint of the paws. Per-frame labels within 1.2 seconds were merged to form
predictions over a window. Predicted grooming bouts less than 2 seconds long were discarded. Parameter
values were evaluated by generating predictions for a set of videos and viewing the predictions aligned to
the video in BENTO87.
Grooming bout start and stop times were manually refined by 4 trained annotators, with each annotator
labeling a different subset of videos. Annotators used the predictions from the previous thresholding step
to navigate the videos and score grooming behaviors. The videos were annotated in VLC media player88
using the Time v3.289 and Speed controller90 extensions. To assess inter-annotator reliability, all
annotators were also given the same 2-hour session to annotate. The average pairwise Jaccard index (or
Intersection over Union) computed on the annotations was 0.76 ± 0.04.
Identification of units with grooming-related activity
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
19
To isolate units with grooming related activity, we first down sampled activity to 2 Hz, by summing spike
counts within non-overlapping 500 ms bins. We defined units as having grooming-related activity if their
average activity at the start or end of grooming was 2 standard deviations above their average activity
during a 3 second-long, grooming-free baseline period. For activity aligned to groom start, we used the
activity from 5 to 2 seconds before grooming start as the baseline and compared that to the activity from
1 second before until 1 second after the grooming start time. For activity aligned to groom end, the activity
from 2 to 5 seconds after grooming was chosen as the baseline and was compared to the average activity
from 1 second before until 1 second after groom end. These selection criteria were only used to identify
neurons to serve as examples in Figure 2; all subsequent analyses were performed on the full dataset.
Characterization of trial-averaged grooming responses
We characterized the grooming responses exhibited by the recorded units by computing each unit’s event-
triggered average response in a ± 5-second window relative to the start and (separately) end of grooming.
Responses were down sampled to 4 Hz, by summing spike counts within non-overlapping 250 ms bins.
To simplify interpretation, we restricted averaging to grooming bouts that were ‘well-isolated.’
Specifically, because we included the 5 seconds before and after each bout in this analysis, grooming
bouts that started within 10 seconds of the end of the previous bout were not included in this analysis. An
exception to this is instances with less than 3 seconds between the end of one grooming bout and the start
of the next, in which case we merged these two annotations into a single bout.
To better visualize and interpret grooming-associated activity we next performed principal component
analysis (PCA)48 on the set of event-triggered averages. Specifically, we performed PCA separately on
SPN activity aligned to groom start, SPN activity aligned to groom end, FSI activity aligned to groom
start, and FSI activity aligned to groom end. For each cell type and condition combination, we
concatenated the associated units to form a units-by-time matrix, relative to groom start/stop. The response
of each unit in this matrix was then Z-scored, after which PCA was used to extract the first two principal
components.
To group units into ‘response types’ for visualization, we examined the weight (or ‘score’) for each unit’s
contribution to the largest and second-largest principal component. Units for which the absolute value of
this weight was greater for the first principal component than the second formed the “PC1” response
group, while those with greater-magnitude weights for the second principal component formed the “PC2”
response group. Finally, we sorted the units within each group according to their contribution to the first
(PC1) or second (PC2) principal component of the dataset (weight * activity).
Grooming-associated striatal ensemble identification
To identify grooming-associated striatal ensembles within a given session, we took the neurons-by-time
matrix of recorded spiking from the full two-hour recording session and excluded all frames that did not
occur during grooming or within a 5-second window before or after grooming. Due to the low firing rate
of SPNs, it was rare to find units that were co-active at high sampling rates. Therefore, to instead identify
units that were frequently active at around the same time, we binned spike counts at a sampling rate of
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
20
0.667 Hz (bin size of 1.5 seconds). The spike counts for each unit were then normalized to between zero
and one, and further smoothed by convolving with a Gaussian filter with a standard deviation of 3 seconds.
Using this smoothed and coarsened estimate of cell activity, we next applied meta-k-means51 to identify
sets of cells that were often co-active. We chose to use meta-k-means for clustering, because it does not
force all units in a session to be assigned to a cluster, and it allows for the number of ensembles to be
greater or less than the initial choice of k. Briefly, meta-k-means employs repeated runs of standard k-
means clustering to identify groups of units that are consistently clustered together. As with standard k-
means, meta-k-means requires the user specify an initial number of clusters k, which we set to be the
square root of the number of units in the given session, as in Barbera et al38. We then ran 1,000 repeats of
the k-means clustering algorithm on the matrix of filtered grooming-related activity described above, with
units as variables and time bins as observations. Cluster centroids for each repeat were initialized using
the greedy k-means++ algorithm91. As in prior work30,38,92, units that were assigned to the same cluster in
>80% of k-means runs were considered to be part of the same meta-k-means cluster.
When merging clusters as part of the meta-k-means algorithm, we used the silhouette score93 to evaluate
the outcome of a potential cluster merge. To ensure adequate sample size for downstream analyses,
ensemble identification was restricted to sessions with at least 30 SPNs and FSIs.
Statistical analysis of striatal ensembles
To compute a statistical estimate on the number of ensembles present in each session we used an
eigenvalue based statistical method from Peyrache at al49,50. Briefly, if two neurons have correlated firing,
then we expect to observe common fluctuations in their spiking activity during recording. This can be
visualized by plotting the firing rates of the two neurons against each other, in the form of a direction in
neural activity space along which observations tend to be distributed. Conversely, without any correlated
firing, the variance in the dataset will be roughly equally distributed in all directions, and one would not
expect to see structure when plotting the activity of two cells against each other. These relationships hold
for any n-dimensional set of neurons, where structure emerges from correlated activity. The eigenvectors
of the covariance matrix of a dataset represent the directions of maximally shared variance, thereby
capturing the correlations present in the data. Each eigenvalue quantifies the variance of the data along
the axis defined by its corresponding eigenvector. Thus, in a matrix of neurons-by-time, the eigenvalues
of its covariance matrix capture the correlations among neurons (i.e., ensembles) and comparing the
eigenvalues to those computed from the covariance matrix of a shuffled version of the data provides a
measure of the number of ensembles present.
To apply this method, we first binned spike counts at the same sampling rate as for clustering (0.667 Hz,
bin size of 1.5 seconds) and Z-scored the activity of each neuron. Next, we shuffled the time bins for each
neuron independently, and computed the maximal eigenvalue of the covariance matrix of the shuffled
data. We repeated this 5,000 times to form a null distribution and counted the number of eigenvalues from
the covariance matrix of the actual data that were above the 99th percentile of this null distribution.
Time-normalized grooming-related activity
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
21
To compare ensemble average activity during grooming across grooming bouts of varying duration, we
linearly temporally rescaled the activity of each unit during each grooming bout to a single fixed length.
We chose the length for the interpolated values from the distribution of grooming bout durations from all
clustered sessions. To avoid ‘blurring’ activity associated with the start and end of grooming bouts, the
activity during the 5 seconds before and after each bout was not interpolated.
Bootstrap significance testing of grooming-related ensemble activity
To test for periods during grooming when the grooming ensemble average activity was significantly
higher or lower than chance, we computed the mean, 2.5th, and 97.5th percentiles of the distribution of
randomly sampled ensemble activity. To generate this distribution, we computed the population-average
ensemble activity during 1,000 random duration windows of time sampled throughout the 2-hour
recording session. Start times were sampled uniformly from 5 seconds into the recording session until 5
seconds before the end of the session. Window durations were sampled from the distribution of observed
grooming bout durations across all sessions.
Neural trajectories
To visualize neural trajectories, neural activity during grooming was decomposed onto 3 components
using non-negative matrix factorization94. For the neural trajectories, we decomposed a matrix containing
each unit’s activity during all grooming bouts within that session. For each unit, we concatenated its
activity during all grooming bouts including the five seconds before and after each bout. For the ensemble
trajectories, we averaged the activity of all units within each ensemble and concatenated each ensemble’s
activity during all grooming bouts including 5 seconds before and after each bout. We initialized using
Nonnegative Double Singular Value Decomposition with zeros filled with the average neural activity and
minimized the Frobenius norm of the loss.
Statistical methods
All statistical tests were two-sided. Statistical significance was set to p = 0.05. Summary data in all figures
are reported as mean ± SEM.
Software
All custom software was written in Python95 unless stated otherwise. In addition to those mentioned
elsewhere, we used the following Python packages: numpy96, scipy97, matplotlib98, scikit-learn99, and
pandas100,101.
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
22
Acknowledgements
The authors would like to thank Lindsey Butler for mouse colony management.
This research was supported in part through the computational resources and staff contributions
provided for the Quest high performance computing facility at Northwestern University which is jointly
supported by the Office of the Provost, the Office for Research, and Northwestern University
Information Technology.
Data visualization colors were chosen from ColorBrewer102.
Author contributions
Conceptualization: SM, AK, YK. Methodology: SM. Software: SM. Validation: SM, YK. Formal
Analysis: SM. Investigation: SM, MAM, FHM, HY, SNF, EC. Resources: SM, AK, YK. Data Curation:
SM. Writing - Original Draft Preparation: SM, YK. Writing - Review and Editing: SM, MAM, FHM,
HY, SNF, EC, AK, YK. Visualization: SM, SNF. Supervision: AK, YK. Project Administration: SM,
AK, YK. Funding Acquisition: AK, YK.
The following authors contributed equally, and their names were ordered alphabetically in the author
list: MAM, FHM, and HY.
Funding
This work was supported by the National Institute of Neurological Disorders and Stroke (R01NS107539
to YK), National Institute of Mental Health (R01MH117111 to YK; R00MH117264 to AK), One Mind
Nick LeDeit Rising Star Award (to YK). SM is a National Science Foundation Graduate Research
Fellow (DGE-1842165). SNF was supported by T32MH067564.
The content is solely the responsibility of the authors and does not necessarily represent the official
views of the National Institutes of Health or other funders.
Declaration of interests
The authors declare no competing interests.
Code availability
Upon publication, code will be available in a public repository on our lab GitHub page
(https://github.com/kozorovitskiylaboratory).
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
23
References
1. Lefebvre, L. Grooming in crickets: Timing and hierarchical organization. Animal Behaviour 29, 973–984 (1981).
2. Dawkins, R. & Dawkins, M. Hierachical organization and postural facilitation: Rules for grooming in flies.
Animal Behaviour 24, 739–755 (1976).
3. Lefebvre, L. & Joly, R. Organization rules and timing in kestrel grooming. Animal Behaviour 30, 1020–1028
(1982).
4. Lefebvre, L. The organization of grooming in budgerigars. Behavioural Processes 7, 93–106 (1982).
5. van Rhijn, J. G. The Patterning of Preening and Other Comfort Behaviour in a Herring Gull. Behav 63, 71–109
(1977).
6. Fentress, J. C. Interrupted ongoing behaviour in two species of vole (Microtus agrestis and Clethrionomys
britannicus). I. Response as a function of preceding activity and the context of an apparently ‘irrelevant’
motor pattern. Animal Behaviour 16, 135–153 (1968).
7. Fentress, J. C. Interrupted ongoing behaviour in two species of vole (Microtus agrestis and Clethrionomys
britannicus). II. Extended analysis of motivational variables underlying fleeing and grooming behaviour.
Animal Behaviour 16, 154–167 (1968).
8. Berridge, K. C. Comparative fine structure of action: rules of form and sequence in the grooming patterns of
six rodent species. Behaviour 113, 21–56 (1990).
9. Colonnese, M. T., Stallman, E. L. & Berridge, K. C. Ontogeny of action syntax in altricial and precocial rodents:
grooming sequences of rat and guinea pig pups. Behaviour 133, 1165–1195 (1996).
10. Ferron, J. & Lefebvre, L. Comparative Organization of Grooming Sequences in Adult and Young Sciurid
Rodents. Behaviour 81, 110–127 (1982).
11. Delius, J. D. Displacement Activities and Arousal. Nature 214, 1259–1260 (1967).
12. Jolles, J., Rompa-Barendregt, J. & Gispen, W. H. ACTH-induced excessive grooming in the rat: The influence
of environmental and motivational factors. Hormones and Behavior 12, 60–72 (1979).
13. Hainsworth, F. R. Saliva spreading, activity, and body temperature regulation in the rat. American Journal of
Physiology 1288–1292 (1967) doi:10.1007/978-3-642-16472-9-24.
14. Stricker, E. M. & Hainsworth, F. R. Evaporative cooling in the rat: interaction with heat loss from the tail. Exp
Physiol 56, 231–241 (1971).
15. Tanaka, H., Kanosue, K., Nakayama, T. & Shen, Z. Grooming, body extension, and vasomotor responses
induced by hypothalamic warming at different ambient temperatures in rats. Physiology and Behavior 38,
145–151 (1986).
16. Ritter, R. C. & Epstein, A. N. Saliva lost by grooming: A major item in the rat’s water economy. Behavioral
Biology 11, 581–585 (1974).
17. Golani, I. & Fentress, J. C. Early Ontogeny of Face Grooming in Mice. Developmental Psychobiology 18, 529–
544 (1985).
18. Bolles, R. C., Woods, P. J. & College, H. The ontogeny of behaviour in the albino rat. Animal Behaviour 12,
427–441 (1964).
19. Small, W. S. Notes on the Psychic Development of the Young White Rat. The American Journal of Psychology
11, 80 (1899).
20. Richmond, G. & Sachs, B. D. Grooming in Norway Rats: The Development and Adult Expression of a Complex
Motor Pattern. Behaviour 75, 82–96 (1980).
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
24
21. Altman, J. & Sudarshan, K. Postnatal development of locomotion in the laboratory rat. Animal Behaviour 23,
896–920 (1975).
22. Westerga, J. & Gramsbergen, A. The development of locomotion in the rat. Developmental Brain Research
57, 163–174 (1990).
23. Kravitz, A. V. et al. Regulation of parkinsonian motor behaviours by optogenetic control of basal ganglia
circuitry. Nature 466, 622–626 (2010).
24. Jin, X. & Costa, R. M. Start/stop signals emerge in nigrostriatal circuits during sequence learning. Nature 466,
457–462 (2010).
25. Markowitz, J. E. et al. The Striatum Organizes 3D Behavior via Moment-to-Moment Action Selection. Cell
174, 44-58 (2018).
26. Gurney, K., Prescott, T. J. & Redgrave, P. A computational model of action selection in the basal ganglia. I. A
new functional anatomy. Biological Cybernetics 84, 401–410 (2001).
27. Stephenson-Jones, M., Samuelsson, E., Ericsson, J., Robertson, B. & Grillner, S. Evolutionary conservation of
the basal ganglia as a common vertebrate mechanism for action selection. Current Biology 21, 1081–1091
(2011).
28. Mink, J. W. The Basal Ganglia: Focused Selection and Inhibition of Competing Motor Programs. Progress in
Neurobiology 50, 381–425 (1996).
29. Cui, G. et al. Concurrent activation of striatal direct and indirect pathways during action initiation. Nature
494, 238–242 (2013).
30. Klaus, A. et al. The Spatiotemporal Organization of the Striatum Encodes Action Space. Neuron 95, 1171–
1180 (2017).
31. Janet M. Kemp & Powell, T. P. S. The structure of the caudate nucleus of the cat: light and electron
microscopy. Phil. Trans. R. Soc. Lond. B 262, 383–401 (1971).
32. Rymar, V. V., Sasseville, R., Luk, K. C. & Sadikot, A. F. Neurogenesis and stereological morphometry of
calretinin-immunoreactive GABAergic interneurons of the neostriatum. J. Comp. Neurol. 469, 325–339
(2004).
33. Kita, H., Kosaka, T. & Heizmann, C. W. Parvalbumin-immunoreactive neurons in the rat neostriatum: a light
and electron microscopic study. Brain Research 536, 1–15 (1990).
34. Jaidar, O. et al. Dynamics of the Parkinsonian Striatal Microcircuit: Entrainment into a Dominant Network
State. Journal of Neuroscience 30, 11326–11336 (2010).
35. Carrillo-Reid, L. et al. Encoding Network States by Striatal Cell Assemblies. Journal of Neurophysiology 99,
1435–1450 (2008).
36. Adler, A. et al. Temporal Convergence of Dynamic Cell Assemblies in the Striato-Pallidal Network. Journal of
Neuroscience 32, 2473–2484 (2012).
37. Bakhurin, K. I., Mac, V., Golshani, P. & Masmanidis, S. C. Temporal correlations among functionally
specialized striatal neural ensembles in reward-conditioned mice. Journal of Neurophysiology 115, 1521–
1532 (2016).
38. Barbera, G. et al. Spatially Compact Neural Clusters in the Dorsal Striatum Encode Locomotion Relevant
Information. Neuron 92, 202–213 (2016).
39. Parker, J. G. et al. Diametric neural ensemble dynamics in parkinsonian and dyskinetic states. Nature 557,
177–182 (2018).
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
25
40. Roberts, B. M., White, M. G., Patton, M. H., Chen, R. & Mathur, B. N. Ensemble encoding of action speed by
striatal fast-spiking interneurons. Brain Struct Funct 224, 2567–2576 (2019).
41. Berridge, K. C. & Fentress, J. C. Disruption of natural grooming chains after striatopallidal lesions.
Psychobiology 15, 336–342 (1987).
42. Aldridge, J. W., Berridge, K. C., Herman, M. & Zimmer, L. Neuronal Coding of Serial Order: Syntax of
Grooming in the Neostriatum. Psychological Science 4, 391–395 (1993).
43. Sjöbom, J., Tamtè, M., Halje, P., Brys, I. & Petersson, P. Cortical and striatal circuits together encode
transitions in natural behavior. Sci. Adv. 6, eabc1173 (2020).
44. Corbit, V. L. et al. Dissociable roles of central striatum and anterior lateral motor area in initiating and
sustaining naturalistic behavior. bioRxiv (2020). doi: 10.1101/2020.01.08.899070
45. Berke, J. D., Okatan, M., Skurski, J. & Eichenbaum, H. B. Oscillatory Entrainment of Striatal Neurons in Freely
Moving Rats. Neuron 43, 883–896 (2004).
46. Gage, G. J., Stoetzner, C. R., Wiltschko, A. B. & Berke, J. D. Selective Activation of Striatal Fast-Spiking
Interneurons during Choice Execution. Neuron 67, 466–479 (2010).
47. Dhawale, A. K., Wolff, S. B. E., Ko, R. & Ölveczky, B. P. The basal ganglia control the detailed kinematics of
learned motor skills. Nat Neurosci 24, 1256–1269 (2021).
48. Hotelling, H. Analysis of a complex of statistical variables into principal components. Journal of Educational
Psychology 24, 417–441 (1933).
49. Peyrache, A., Benchenane, K., Khamassi, M., Wiener, S. I. & Battaglia, F. P. Principal component analysis of
ensemble recordings reveals cell assemblies at high temporal resolution. J Comput Neurosci 29, 309–325
(2010).
50. Lopes-dos-Santos, V., Ribeiro, S. & Tort, A. B. L. Detecting cell assemblies in large neuronal populations.
Journal of Neuroscience Methods 220, 149–166 (2013).
51. Ozden, I., Lee, H. M., Sullivan, M. R. & Wang, S. S.-H. Identification and Clustering of Event Patterns From In
Vivo Multiphoton Optical Recordings of Neuronal Ensembles. Journal of Neurophysiology 100, 495–503
(2008).
52. Aldridge, J. W. & Berridge, K. C. Coding of serial order by neostriatal neurons: a ‘natural action’ approach to
movement sequence. J Neurosci 18, 2777–2787 (1998).
53. Jin, X., Tecuapetla, F. & Costa, R. M. Basal ganglia subcircuits distinctively encode the parsing and
concatenation of action sequences. Nature Neuroscience 17, 423–430 (2014).
54. Geddes, C. E., Li, H. & Jin, X. Optogenetic Editing Reveals the Hierarchical Organization of Learned Action
Sequences. Cell 174, 32-43 (2018).
55. Hintiryan, H. et al. The mouse cortico-striatal projectome. Nature Neuroscience 19, 1100–1114 (2016).
56. Oh, S. W. et al. A mesoscale connectome of the mouse brain. Nature 508, 207–214 (2014).
57. Hunnicutt, B. J. et al. A comprehensive excitatory input map of the striatum reveals novel functional
organization. eLife 5, 1–32 (2016).
58. Cowan, R. L., Wilson, C. J., Emson, P. C. & Heizmann, C. W. Parvalbumin-containing gabaergic interneurons in
the rat neostriatum. J. Comp. Neurol. 302, 197–205 (1990).
59. Berke, J. D. Functional Properties of Striatal Fast-Spiking Interneurons. Front. Syst. Neurosci. 5, (2011).
60. Bennett, B. D. & Bolam, J. P. Synaptic Input and Output of Parvalbumin-Immunoreactive Neurons in the
Neostriatum of the Rat. Neuroscience 62, 707–719 (1994).
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
26
61. Tepper, J. M., Tecuapetla, F., Koós, T. & Ibáñez-Sandoval, O. Heterogeneity and Diversity of Striatal
GABAergic Interneurons. Frontiers in Neuroanatomy 4, 1–18 (2010).
62. Fukuda, T. Network Architecture of Gap Junction-Coupled Neuronal Linkage in the Striatum. Journal of
Neuroscience 29, 1235–1243 (2009).
63. Berke, J. D. Uncoordinated Firing Rate Changes of Striatal Fast-Spiking Interneurons during Behavioral Task
Performance. Journal of Neuroscience 28, 10075–10080 (2008).
64. Kim, N., Barter, J. W., Sukharnikova, T. & Yin, H. H. Striatal firing rate reflects head movement velocity. Eur J
Neurosci 40, 3481–3490 (2014).
65. Koós, T. & Tepper, J. M. Inhibitory control of neostriatal projection neurons by GABAergic interneurons.
Nature Neuroscience 2, 467–472 (1999).
66. Smith, Y., Bevan, M. D., Shink, E. & Bolam, J. P. Microcircuitry of the Direct and Indirect Pathways of the Basal
Ganglia. Neuroscience 86, 353–387 (1998).
67. Freeze, B. S., Kravitz, A. V., Hammack, N., Berke, J. D. & Kreitzer, A. C. Control of Basal Ganglia Output by
Direct and Indirect Pathway Projection Neurons. Journal of Neuroscience 33, 18531–18539 (2013).
68. Calabresi, P., Picconi, B., Tozzi, A., Ghiglieri, V. & Di Filippo, M. Direct and indirect pathways of basal ganglia:
a critical reappraisal. Nat Neurosci 17, 1022–1030 (2014).
69. Fentress, J. C. & Stilwell, F. P. Grammar of a movement sequence in inbred mice. Nature 244, 52–53 (1973).
70. Berridge, K. C., Fentress, J. C. & Parr, H. Natural syntax rules control action sequence of rats. Behavioural
Brain Research 23, 59–68 (1987).
71. Cromwell, H. C. & Berridge, K. C. Implementation of action sequences by a neostriatal site: a lesion mapping
study of grooming syntax. The Journal of neuroscience 16, 3444–58 (1996).
72. Berridge, K. C. Substantia nigra 6-OHDA lesions mimic striatopallidal disruption of syntactic grooming chains:
A neural systems analysis of sequence control. Psychobiology 17, 377–385 (1989).
73. Spruijt, B. M., van Hooff, J. A. & Gispen, W. H. Ethology and neurobiology of grooming behavior.
Physiological Reviews 72, 825–852 (1992).
74. McFarland, D. J. Time-Sharing as a Behavioral Phenomenon. in Advances in the Study of Behavior 201–225
(1974).
75. Kyle Severson. campy. https://github.com/ksseverson57/campy
76. Siegle, J. H. et al. Open Ephys: an open-source, plugin-based platform for multichannel electrophysiology. J.
Neural Eng. 14, 045003 (2017).
77. Pachitariu, M., Steinmetz, N. A., Kadir, S. N., Carandini, M. & Harris, K. D. Fast and accurate spike sorting of
high-channel count probes with KiloSort. Advances in Neural Information Processing Systems (NIPS) 4448–
4456 (2016) doi:10.2108/zsj.30.135.
78. Fürth, D. et al. An interactive framework for whole-brain maps at cellular resolution. Nat Neurosci 21, 139–
149 (2018).
79. R Core Team. R: A Language and Environment for Statistical Computing. (2017).
80. Wang, Q. et al. The Allen Mouse Brain Common Coordinate Framework: A 3D Reference Atlas. Cell 181, 936-
953.e20 (2020).
81. Freda, S. N. et al. Brainwide input-output architecture of paraventricular oxytocin and vasopressin neurons.
bioRxiv (2022). doi:10.1101/2022.01.17.476652.
82. Mathis, A. et al. DeepLabCut: markerless pose estimation of user-defined body parts with deep learning.
Nature Neuroscience 21, 1281–1289 (2018).
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint
27
83. Nath, T. et al. Using DeepLabCut for 3D markerless pose estimation across species and behaviors. Nat Protoc
14, 2152–2176 (2019).
84. Insafutdinov, E., Pishchulin, L., Andres, B., Andriluka, M. & Schiele, B. DeeperCut: A Deeper, Stronger, and
Faster Multi-person Pose Estimation Model. in Computer Vision – ECCV 2016 (eds. Leibe, B., Matas, J., Sebe,
N. & Welling, M.) vol. 9910 34–50 (Springer International Publishing, 2016).
85. He, K., Zhang, X., Ren, S. & Sun, J. Deep Residual Learning for Image Recognition. in 2016 IEEE Conference on
Computer Vision and Pattern Recognition (CVPR) 770–778 (IEEE, 2016). doi:10.1109/CVPR.2016.90.
86. Karashchuk, P. et al. Anipose: A toolkit for robust markerless 3D pose estimation. Cell Reports 36, 109730
(2021).
87. Segalin, C. et al. The Mouse Action Recognition System (MARS) software pipeline for automated analysis of
social behaviors in mice. eLife 10, e63720 (2021).
88. VideoLan. VLC media player. (2006). https://www.videolan.org/vlc/
89. Mederi. Time v3.2. (2012). https://addons.videolan.org/p/1154032
90. Andrei Hutu. Speed Controller. (2021). https://github.com/Anndrey24/VLC_Speed_Controller
91. Arthur, D. & Vassilvitskii, S. k-means++: The Advantages of Careful Seeding. Stanford, (2006)
92. Dombeck, D. A., Graziano, M. S. & Tank, D. W. Functional Clustering of Neurons in Motor Cortex Determined
by Cellular Resolution Imaging in Awake Behaving Mice. Journal of Neuroscience 29, 13751–13760 (2009).
93. Rousseeuw, P. J. Silhouettes: A graphical aid to the interpretation and validation of cluster analysis. Journal
of Computational and Applied Mathematics 20, 53–65 (1987).
94. Lee, D. D. & Seung, H. S. Learning the parts of objects by non-negative matrix factorization. Nature 401, 788–
791 (1999).
95. Van Rossum, Guido & Drake, Fred L. Python 3 Reference Manual. (CreateSpace, 2009).
96. Harris, C. R. et al. Array programming with NumPy. Nature 585, 357–362 (2020).
97. Virtanen, P. et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nat Methods 17,
261–272 (2020).
98. Hunter, J. D. Matplotlib: A 2D Graphics Environment. Comput. Sci. Eng. 9, 90–95 (2007).
99. Pedregosa, F. et al. Scikit-learn: Machine Learning in Python. MACHINE LEARNING IN PYTHON.
100. The pandas development team. pandas-dev/pandas: Pandas. (2020).
101. McKinney, W. Data Structures for Statistical Computing in Python. in 56–61 (2010). doi:10.25080/Majora-
92bf1922-00a.
102. Brewer, Cynthia A. ColorBrewer. (2013). https://colorbrewer2.org
.CC-BY 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted February 23, 2023. ; https://doi.org/10.1101/2023.02.23.529669doi: bioRxiv preprint