Main

According to the classical rate model of Parkinson’s disease, dSPNs and iSPNs normally have balanced activity rates, and the loss of dopamine induces an activity imbalance that suppresses movement by enhancing basal ganglia inhibition of the thalamo-cortical motor system1,2,3,4. The premise of the rate model, that the direct and indirect pathways are functionally opposed, concisely explained multiple aspects of basal ganglia function and dysfunction and led to descriptions of dystonia and Huntington’s disease1,2, Tourette’s syndrome5, dyskinesia6, addiction7, chronic pain8, depression9 and schizophrenia10 based on imbalanced SPN activity rates. However, without cellular-level recordings that enable the comparison of dSPN and iSPN activity levels, no definitive evidence of a striatal activity imbalance has been shown in any of these conditions.

Optogenetic studies support the idea that dSPNs and iSPNs have opposing roles in movement initiation11. However, fluorescence recordings have recently shown that both cell types normally activate at movement onset with similar time courses12,13,14. These results challenge the rate model and reinvigorate models in which the direct and indirect pathways coordinate action selection by concurrently activating and suppressing competing motor programs, respectively15. The two pathways could still be opposed in some manner, but the oversimplicity of the rate model may underlie its inability to explain several notable features of Parkinson’s disease16, including the loss of movement-specific activity in nuclei downstream of the striatum17. Therefore, imbalanced SPN dynamics might only partially account for the motor symptoms of Parkinson’s disease.

l-DOPA is the mainstay therapy for treating these symptoms, but whether it alters SPN activity and why it is superior to dopamine-receptor agonism remain unknown18. Notably, the efficacy of l-DOPA gradually decreases, as patients increasingly exhibit involuntary movements termed l-DOPA-induced dyskinesia (LID)18. Effective alternatives are needed to delay l-DOPA treatment and supplement or replace it upon loss of efficacy. LID is not fully understood, but might involve an activity imbalance opposite to that found in Parkinson’s disease, with dSPN hyperactivity19. However, as with Parkinson’s disease direct proof for these ideas has been lacking. To examine these issues, we compared dSPN and iSPN dynamics in freely behaving mice, under normal and parkinsonian conditions, before and after common treatments for Parkinson’s disease and during LID.

Striatal encoding of movement

To selectively monitor dSPNs or iSPNs in the dorsomedial striatum, we respectively injected Drd1acre (Drd1a is also known as Drd1) or Adora2acre driver mice with a virus mediating Cre-dependent expression of the green-fluorescent Ca2+-indicator GCaMP6m20,21 (Methods). Control studies in live striatal tissue slices confirmed that somatic Ca2+ dynamics report spiking equivalently in dSPNs and iSPNs (Extended Data Fig. 1a–i).

To track SPN activity over weeks without affecting locomotor behaviour, we used a head-mounted microscope22,23 and time-lapse microendoscopy24 to image SPN dynamics as mice explored an open arena (Fig. 1 and Extended Data Fig. 1j, k). We computationally extracted activity traces of individual SPNs from the Ca2+ movies (262 ± 11 dSPNs (mean ± s.e.m.), 277 ± 8 iSPNs per mouse per session; 369 total 1-h-long sessions in 17 Drd1acre mice, 21 Adora2acre mice). Ca2+ transient events occurred at similar rates for dSPNs and iSPNs and had waveforms consistent with those in striatal slices (Extended Data Fig. 1l–n).

Fig. 1: Ca2+ imaging of SPNs in freely behaving mice.
figure 1

a, Timeline of Ca2+ imaging sessions, 6-OHDA infusion and drug treatments. SKF, SKF81297. b, An Inscopix miniature microscope and microendoscope imaged SPN activity patterns. Infusion of 6-OHDA into substantia nigra (SNc) on day 0 ablated dopamine cells. c, Somata (red) of 573 dSPNs and 356 iSPNs in example Drd1acre (left) and Adora2acre (right) mice, atop mean fluorescence images of the dorsomedial striatum. Scale bar, 125 μm. d, Example Ca2+ activity traces in mice exploring an open arena. Grey shading, running periods; white shading, resting periods.

During movement, Ca2+ event rates rose markedly in both SPN types with similar dependencies on locomotor speed (Fig. 2a, b and Supplementary Videos 1, 2). Averaged over all Ca2+ events, locomotor speed rose after Ca2+ excitation with indistinguishable latencies in dSPNs and iSPNs (192 ± 9 ms (mean ± s.e.m.) and 196 ± 11 ms, respectively; P = 0.8; rank-sum test). Averaged over all movement bouts, mean SPN activity rose approximately 1 s before motion onset (Fig. 2c), with mean times to reach the half-maximum amplitude that were indistinguishable given the approximately 40-ms resolution of our statistical analysis (Drd1acre mice, −0.53 ± 0.04 s (mean ± s.e.m.) relative to motion onset, 17 mice, 5,372 cells, 2,899 movement bouts; Adora2acre mice, −0.48 ± 0.04 s, 21 mice, 5,880 cells, 3,559 movement bouts; P = 0.7; rank-sum test).

Fig. 2: SPNs encode movement via spatially clustered bursts of activity.
figure 2

a, Mean SPN Ca2+ event rates versus running speed, relative to mean rates in resting mice (<0.5 cm s−1). Grey shading denotes locomotion (>0.5 cm s−1) in a and c. b, Mean speed relative to occurrences of Ca2+ events, normalized to mean speed 2 s before Ca2+ excitation. Traces are averages across all dSPNs (blue trace) and iSPNs (red trace). c, Mean speed (bottom), Ca2+ event rate (top) and spatial coordination of SPN activity (middle), relative to times of motion onset and offset. Top two traces are normalized to mean values in resting mice. Kinks in speed traces at motion onset/offset reflect the definition of a motion bout, for which the minimum speed to initiate a bout exceeds that to sustain one. d, Mean pairwise coactivity during locomotion versus the separation of cell pairs, normalized to values in temporally shuffled datasets (dashed line). Cyan, proximal (20–100 μm) cell pairs. e, Coactivity of proximal cell pairs exceeded that of the activity in shuffled datasets (**P < 5 × 10−4; signed-rank test comparing real and shuffled data; n = 17 Drd1acre, 21 Adora2acre mice). Exact P values can be found in the Supplementary Information for all figures. ae, Data based on the same recordings (day −5; 17 Drd1acre, 21 Adora2acre mice). ad, Colour shading indicates the s.e.m. e, In box-and-whisker plots, the horizontal lines denote median values, boxes cover the middle two quartiles and whiskers span 1.5× the interquartile range. Box-and-whisker plots in all other figures are formatted identically.

SPN activity was markedly clustered during movement, although the clusters of coactive cells were not absolutely stereotyped14. The spatial coordination of coactive SPNs rose and fell at motion onset and offset, respectively, with time courses that resembled those of the Ca2+ activity (Fig. 2c and Extended Data Fig. 2). Cell pairs within 100 μm or less were especially coactive, but beyond this distance pairwise activity correlations gradually decreased (Fig. 2d, e). By comparing the sets of cells that were activated during five different types of movement, we found that SPNs activated during bouts of the same movement type were, on average, more similar and closer together than those activated during different movement types13 (Extended Data Fig. 3 and Methods).

To examine how dSPN and iSPN activity patterns were inter-related, we imaged their concurrent dynamics by two-photon microscopy in head-fixed mice in which both SPN-types expressed GCaMP6m and only dSPNs expressed the red-fluorescent marker tdTomato (Extended Data Fig. 4 and Supplementary Video 3). As the mice ran in place, dSPN and iSPN dynamics tracked locomotor behaviour indistinguishably. Nearby (20–100 μm) SPNs were equally coactive with other SPNs regardless of type, and the two cell populations encoded running speed equivalently.

Striatal activity after dopamine depletion

We next examined SPN dynamics in a classic model of Parkinson’s disease25. Ipsilateral to the imaged striatum, we lesioned dopamine cells of the subtantia nigra pars compacta (SNc) using the neurotoxin 6-OHDA. Immunostaining for tyrosine hydroxylase, a marker of dopamine neurons, confirmed that the lesioned SNc lacked dopamine cell bodies 24 h after 6-OHDA infusion (Extended Data Fig. 5a, b). Following Ca2+ imaging, immunofluorescence intensities in the ipsilateral striatum more than 17 days after 6-OHDA infusion were 6 ± 1% (mean ± s.e.m.) of those contralateral to the lesion (P = 6 × 10−8; n = 25 mice; signed-rank test; Fig. 3a), verifying loss of dopamine neuron axons.

Fig. 3: Dopamine loss differentially alters dSPN and iSPN activity patterns.
figure 3

a, Brain slices were immunostained for tyrosine hydroxylase (red) >14 days after unilateral 6-OHDA lesion and show unilateral loss of dopamine cell bodies and axons. White lines, brain area boundaries38. DAPI was used to stain the nuclei (blue). Scale bars, 1 mm. b, Example locomotor trajectories (15 min), before 6-OHDA lesion and 1 and 14 days after the lesion. c, Distance travelled, normalized for each mouse to its pre-lesion value. **P < 3 × 10−3 compared to pre-lesion; *P = 0.013 comparing 1 day to >14 days; signed-rank test, n = 25 mice. d, Traces of locomotor speed and mean Ca2+ event rate in example Drd1acre (left) and Adora2acre (right) mice, before (black), 1 day (orange) and 14 days (pink) after 6-OHDA lesion. e, Mean Ca2+ event rates versus speed, before and after 6-OHDA lesion, normalized to mean rates at rest (<0.5 cm s−1) before the lesion. f, Ca2+ event rates (mean ± s.e.m.) before and after 6-OHDA lesion, normalized to pre-lesion values. ***P < 5 × 10−17; signed-rank test comparisons to pre-lesion; n = 12 Drd1acre, 13 Adora2acre mice. NS, not significant. g, Mean Ca2+ event rates (top), SPN spatial coordination (middle) and locomotor speed (bottom) relative to motion onset and offset, before and 14 days after 6-OHDA lesion. Given their similarity (Fig. 2c), pre-lesion traces for both SPN-types were combined. Traces are normalized to mean values from −2 s to −1 s relative to motion onset. Motion-related activity decreased in both SPN types after 6-OHDA lesion (P = 10−61 (Drd1acre); P = 10−111 (Adora2acre)), but was more profoundly reduced in iSPNs. Rank-sum test; n = 1,905–3,110 motion bouts for both mouse lines at both time points. Spatial coordination of iSPN (P = 10−9) but not dSPN activity (P = 0.4) decreased on day 14 to below pre-lesion values. n = 1,326–2,957 bouts with ≥2 active cells, for both mouse lines and time points; rank-sum test. h, Mean speeds relative to occurrences of Ca2+ events, normalized to values 2 s before Ca2+ excitation. At 14 days after 6-OHDA lesion, the mean speed rise within ±500 ms of a Ca2+ event was 0.8 ± 0.3% (mean ± s.e.m.) for iSPNs, 11 ± 1% for dSPNs. n = 3,498–5,529 cells per day, for both mouse lines. i, Rises in Ca2+ event rates at motion onset, based on data from g. For each group, we averaged over all movement bouts and compared the event rates during the intervals −2 to −1 s before and 0–1 s after motion onset. Values normalized to the pre-lesion values. *P = 0.03; **P = 9 × 10−7; rank-sum test compared to pre-lesion values; n = 12 Drd1acre and 13 Adora2acre mice. j, Coactivity values in proximal SPN pairs (20–100 μm apart) during locomotion, after subtraction of coactivity values in shuffled datasets. Values normalized to pre-lesion values. **P < 2 × 10−4; ***P < 4 × 10−12; rank-sum test comparing pre-lesion to 1 day and > 14 days; n = 96–416 coactivity values for both mouse lines and all three time points. c, e–j, Data are from the same 12 Drd1acre and 13 Adora2acre mice. e, g, h, Colour shading indicates the s.e.m. Pre-lesion data were acquired on day −5. Data for > 14 days were from 1-h recordings on day 14 plus 30-min recordings on days 15, 17 and 20 performed after saline vehicle administration but before drug treatment.

One day after the mice received 6-OHDA, locomotion was reduced relative to mice that had received saline infusions (Fig. 3b, c and Extended Data Fig. 5c). During Ca2+ imaging, background fluorescence was also reduced, but with almost no effect on the detection of Ca2+ events or SPNs (Extended Data Fig. 5d–h). Consistent with the rate model of Parkinson’s disease, post-lesion (1 day) activity rates during rest and locomotion were decreased in dSPNs and increased in iSPNs compared to pre-lesion values (Fig. 3d–f and Extended Data Fig. 6). These effects resembled those of acute treatment with either D1 dopamine receptor (D1R) or D2 dopamine receptor (D2R) antagonists (Extended Data Fig. 7), which can cause parkinsonism in humans26.

By 14 days after the lesion, a time point that may be more representative of the sustained dopamine depletion in patients with Parkinson’s disease27, locomotor activity had risen but remained below normal levels (Fig. 3c). iSPN activity remained elevated at baseline but barely rose at movement onset, no longer reflected locomotor speed and had lost nearly all of its spatial coordination (Fig. 3d–j). These abnormalities were also present during a rotarod assay of motor coordination (Extended Data Fig. 6c–e). The iSPN ensembles activated during different types of movement also became less distinctive after dopamine depletion, indicating reduced encoding specificity (Extended Data Fig. 8). By comparison, dSPN activity rates remained consistently depressed but still rose at motion onset and retained spatial coordination, a clear relationship to locomotion and selectivity for specific movement types (Fig. 3d–j). Thus, between acute and extended dopamine depletion, iSPN but not dSPN ensembles underwent pronounced changes in how their spatiotemporal dynamics encoded locomotion.

Treatment of aberrant neural dynamics

We next examined whether dopamine replacement or receptor agonism could reverse these aberrant SPN dynamics. Across days 15–20 after 6-OHDA infusion, we successively administered 1 or 6 mg kg−1 of a D2R agonist (quinpirole), a D1R agonist (SKF81297), or l-DOPA. As in past work using the 6-OHDA model of Parkinson’s disease, these agents induced locomotor turning contralateral to the lesioned SNc25, to equipotent levels within the tested dosage ranges (Fig. 4a and Extended Data Fig. 9a–e).

Fig. 4: l-DOPA better reversed the deficits in SPN activity than dopamine receptor agonism.
figure 4

a, Contralateral turning bias during 40-min periods of locomotion, >14 days after 6-OHDA lesion, after administration of saline vehicle, or 1 mg kg−1 or 6 mg kg−1 D2R agonist (quinpirole), D1R agonist (SKF81297) or l-DOPA. n = 13 mice; one treatment per day, in the order stated. bd, Mean SPN Ca2+ event rates versus locomotor speed, under different treatment conditions (days 15–21 after 6-OHDA lesion). Values were normalized to mean event rates in mice at rest (<0.5 cm s−1) after saline injection. Colour shading indicates s.e.m. bh, Data are from the same 7 Drd1acre, 6 Adora2acre mice. e, f, Ca2+ event rates when mice were resting (e) or moving (f). Values in eh were normalized for each mouse to measured values after saline treatment and 6-OHDA lesion (dashed lines). n = 14 speed bins <0.5 cm s−1, n = 24 speed bins >0.5 cm s−1, n = 7 Drd1acre, 6 Adora2acre mice. g, Increases in Ca2+ event rates at motion onset. For each treatment, we averaged over all motion bouts and computed the mean rate 0–2 s after motion onset, normalized to rates from −2 to −1 s before motion onset (dashed lines). n = 11 time bins per mouse per treatment. h, Coactivity in proximal SPN pairs (20–100 μm apart) during movement, after subtracting coactivity values in shuffled datasets. n = 8 bins of cell–cell separation, n = 7 Drd1acre, 6 Adora2acre mice. i, Summary of effects. Arrows indicate mean changes of ≥10% at the 6 mg kg−1 dose of each drug. Encircled arrows indicate effects unpredicted by the rate model of Parkinson’s disease. Statistical tests are signed-rank tests with Dunn–Sidak correction for multiple comparisons. †P = 2.4 × 10−3 for comparisons to pre-lesion; *P < 6 × 10−3, **P < 6 × 10−4, ***P < 6 × 10−7 for comparisons to vehicle treatment; #P < 0.05, ##P < 5 × 10−3, ###P < 5 × 10−7 for comparisons between drug doses. Pre-lesion data were acquired on day −5. Vehicle data were aggregated for 30-min recordings on days 15–21 after saline administration but before drug treatment.

All three drugs also increased dSPN activity, unexpectedly so for quinpirole, given the lack of D2Rs on dSPNs28,29 (Fig. 4b–d). Quinpirole and the 6 mg kg−1 l-DOPA dose, but not SKF81297, further ameliorated the activity imbalance by reducing the elevated iSPN activity in resting mice. The two agonists had divergent effects from those in normal mice, in which they both unexpectedly depressed SPN activity (Extended Data Fig. 7d–f and Supplementary Note). Given the unilateral lesion and systemic drug administration, drug effects in the contralateral striatum or even outside striatum could contribute to these observations, although the brain’s greatest densities of dopaminergic inputs and dopamine receptors are in the striatum30.

Beyond rebalancing SPN activity, l-DOPA mostly restored the coupling to locomotion and spatial clustering of iSPN activity (Fig. 4b, e–i). D2R agonism failed to restore the iSPN activity rise at motion onset, whereas D1R agonism rescued neither the elevated rates nor spatial clustering of iSPN activity (Fig. 4c, f–i). Thus, although l-DOPA and both agonists reversed the activity imbalance, only l-DOPA reversed the deficits in both motion-related iSPN activity and its spatial coordination. These differences in treating neural abnormalities arose even at doses equally affecting turning behaviour, the standard metric of therapeutic efficacy in this model of Parkinson’s disease25.

Late in the treatment of Parkinson’s disease, patients commonly develop LID, which we modelled by giving parkinsonian mice a dyskinesiogenic (10 mg kg−1) l-DOPA dose31 that induced abnormal facial, limb and trunk movements (Extended Data Fig. 9f–j). During dyskinesia, dSPNs were hyperactive and iSPNs hypoactive. Furthermore, dSPNs lost their spatial coordination and movement-evoked responses, whereas iSPNs became more responsive to motion onset (Fig. 5). Thus, the signature dSPN and iSPN dynamics in parkinsonian and dyskinetic states were diametric opposites of each other (Supplementary Video 4). This anti-symmetry provides an attractive explanation for the opposite motor symptoms of Parkinson’s disease and LID.

Fig. 5: In LID, iSPNs are hypoactive and dSPNs have uncorrelated patterns of hyperactivity.
figure 5

a, Turning bias (mean ± s.e.m.) and abnormal involuntary movement score (AIMS) within 40 min after saline vehicle or l-DOPA injection, >14 days after 6-OHDA lesion. ##P < 10−3 for comparisons of contralateral bias to vehicle treatment; signed-rank test; *P = 10−2 and **P = 10−4 comparing AIMS values to those after vehicle treatment; rank-sum test; n = 13 mice. 10 mg kg−1 l-DOPA induced higher AIMS values than 6 mg kg−1. #P = 0.013; signed-rank test. b, Peak AIMS (mean ± s.e.m.), separated by movement type, within 40 min after vehicle or l-DOPA treatment in mice >14 days after 6-OHDA lesion. *P < 0.05, **P < 5 × 10−3 for comparisons to vehicle treatment; rank-sum test; n = 13 mice. c, Mean SPN Ca2+ event rates versus locomotor speed before 6-OHDA lesion, and >14 days after the lesion following either vehicle or 10 mg kg−1 l-DOPA treatment. Values are normalized to mean rates when mice were resting (<0.5 cm s−1) after vehicle treatment. Grey shading indicates >0.5 cm s−1 locomotion. Colour shading indicates the s.e.m. cg, Data are from the same 7 Drd1acre, 6 Adora2acre mice. de, Ca2+ event rates when mice were resting (<0.5 cm s–1; d) or moving (>0.5 cm s−1; e). All values in dg are normalized to those after vehicle treatment in lesioned mice (dashed lines). Statistical tests in dg are signed-rank tests with Dunn–Sidak correction for multiple comparisons. *P < 6 × 10−3, **P < 6 × 10−4, ***P < 6 × 10−7 for comparisons to vehicle treatment. n = 14 speed bins <0.5 cm s−1, 24 speed bins >0.5 cm s−1 for all 13 mice. f, Rises in Ca2+ event rates at motion onset. For each treatment, we averaged over all motion bouts and computed the mean rate 0–2 s after motion onset, relative to the values from −2 to −1 s before onset. n = 11 time bins per mouse per treatment. g, Coactivity in proximal SPN pairs (20–100 μm apart) during movement, after subtracting coactivity values in shuffled datasets. n = 8 bins of cell–cell separation per mouse. h, Summary of effects. Arrows indicate mean changes ≥10%. Encircled arrows indicate effects unpredicted by the classical rate model. Pre-lesion data were acquired on day −5. Vehicle data aggregates 30-min recordings on days 15–21 were acquired after vehicle administration but before drug treatment.

Implications for basal ganglia function

Our data show dSPNs and iSPNs normally have indistinguishable kinetics at motion onset and offset12 (Fig. 2), challenging the idea that the two cell types respectively mark movement start and end32. Activation patterns in the two SPN types were comparably clustered, consistent with previous reports13,14. Supporting one recent study13, the clusters of active SPNs that we identified were neither absolutely stereotyped nor spatially compact.

The ensemble activity that we observed in both SPN types precisely encoded locomotor speed (Extended Data Fig. 4l, m) and as in recent work13 arose in clusters that preferentially encoded specific movement types (Extended Data Fig. 3, 10). Simultaneous Ca2+ imaging in both SPN types revealed interspersed patterns of dSPN and iSPN activity (Extended Data Fig. 4j, k). Together, these findings pose a challenge to ‘suppression–selection’ models15, in which the main iSPN function is to broadly suppress competing actions other than the one selected. Such models predict that iSPN dynamics should be less selective, more diffuse and perhaps less velocity-sensitive than those of dSPNs. Instead, it appears that iSPNs and dSPNs jointly engage in movement selection via synchronized activation in interspersed cell clusters of comparable size coupled indistinguishably to locomotion. The data here come from the dorsomedial striatum, and future work should explore whether the findings generalize to other striatal regions.

The spatial extent of dSPN and iSPN coactivation resembles that of corticostriatal neurons with focal axonal arborizations (around 100–300 μm wide) within the rodent striatal matrix33. Striatal areas receiving these projections are termed matrisomes and have somatotopically organized cortical inputs and projections to basal ganglia output nuclei34. Thus, the spatiotemporal organization of cortical input and the convergence of signals from the direct and indirect pathways are probably both vital for sculpting the motor output signals of the basal ganglia15,32,35 (Extended Data Fig. 11).

Signatures of a parkinsonian state

The notion that an excess or deficiency of dopamine signalling unbalances striatal dynamics has long provided the conceptual basis for treating basal ganglia disorders1,2,5,6,7,8,9,10, but direct evidence of imbalanced striatal activity has been lacking. We uncovered opposite imbalances in dorsomedial striatum after dopamine depletion and LID, and additional facets of SPN pathophysiology that probably contribute to the symptoms of Parkinson’s disease, their reversal by dopamine restoration, and the hyperkinesia of LID.

We found four distinct signatures of a parkinsonian state: reduced spontaneous dSPN activity; increased spontaneous iSPN activity; reduced coupling of iSPN activity levels to motion onset and offset; and decreased spatial clustering of iSPN activity (Extended Data Fig. 11). Collectively, these signatures expose the incompleteness of the rate model. Notwithstanding, these findings support the model’s predictions for how spontaneous rates of SPN activity change in Parkinson’s disease. Abnormal rates of spontaneous SPN activity may indeed impede movement by increasing activity in the inhibitory output projections of the basal ganglia. The loss of spatially clustered iSPN activity and its coupling to movement lie beyond the rate model and probably also contribute to parkinsonian symptoms. These unexpected deficits might indicate disruptions to matrisome33,34 function that preclude the spatiotemporal dynamics required in basal ganglia output nuclei for well-choreographed actions. The added deficits did not arise after acute dopamine depletion or D1R or D2R antagonism and are consistent with electrophysiological recordings in a genetic mouse model of progressive dopamine cell loss36.

These progressive pathophysiologic changes probably reflect neural adaptations that occur during chronic dopamine depletion, many of which preferentially affect iSPNs, such as reduced dendritic spine density and increased input from inhibitory interneurons (Supplementary Note). Notably, the long-term adaptations in SPN dynamics were precisely those best treated by l-DOPA and D2R agonism. The mechanisms by which these treatments immediately counteracted the long-term facets of SPN pathophysiology are unclear but important to identify, because the capabilities of the different compounds for reversing the neural abnormalities matched their clinical utilities18 (in order of efficacy: l-DOPA, D2R agonism, D1R agonism) and might underlie the varying utility of dopamine agonist monotherapy versus that of l-DOPA in different stages of Parkinson’s disease37.

Anti-symmetric deficits in LID

Notably, during LID the dorsomedial striatum exhibits diametric abnormalities to those in the parkinsonian state. Dyskinesia is characterized by decreased spontaneous iSPN activity, increased spontaneous dSPN activity and a loss of spatially clustered and movement-coupled dSPN activity. These features are the polar opposite of those of the parkinsonian state and may explain the opposite motor symptoms of the two conditions. They also fit with reported cellular adaptations in Parkinson’s disease versus LID, including reductions of dendritic spines on iSPNs and dSPNs, respectively19,27. A caveat is that we examined a model of acute LID, which differs from models with more prolonged courses of l-DOPA treatment known to induce a range of cellular adaptations27.

As with uncorrelated iSPN hyperactivity in the parkinsonian state, uncorrelated dSPN hyperactivity in LID probably also disrupts movement selection, but in this case causing excessive, unplanned movements. However, it remains unclear whether and how dSPN activity patterns relate to specific dyskinetic movements. Just as pharmacological restoration of spatially coordinated iSPN activity was associated with clinical efficacy in treating the symptoms of Parkinson’s disease, reversing or preventing the loss of spatially coordinated dSPN activity in LID might benefit patients with late-stage Parkinson’s disease. Overall, the distinctive neural signatures of Parkinson’s disease and LID established here may provide biomarkers facilitating development of substitutes for l-DOPA or treatment regimens extending its period of efficacy.

Beyond Parkinson’s disease and dyskinesia, our results provide the impetus and means for testing whether other basal ganglia disorders unbalance striatal activity and disrupt its coding dynamics5,7,8,9,10. As with Parkinson’s disease and LID, it is probable that ideas beyond the rate model framework will be required to explain the spectrum of basal ganglia abnormalities and patient symptoms. Current treatment approaches often aim to correct activity imbalances, but our results indicate that next-generation therapies should also target the concomitant biological adaptations that disrupt striatal neural ensemble coding.

Methods

Mice

We obtained the GENSAT BAC-transgenic Cre-driver mouse lines, Drd1acre (FK150) and Adora2acre (KG139), from the Mutant Mouse Research & Resource Centers (https://www.mmrrc.org). We crossed these mice with wild-type C57BL/6 mice. We inbred the resulting heterozygous offspring to generate homozygous BAC-transgenic animals, which we maintained through further homozygous crosses. To generate mice for our two-photon imaging experiments, we crossed homozygous Drd1acre with homozygous reporter mice (Ai14 (also known as Gt(ROSA)26Sortm14(CAG-tdTomato)Hze mice); Allen Brain Institute) expressing the red fluorophore tdTomato in a Cre-dependent manner. We used both male and female mice, aged 12–24 weeks at the start of behavioural experiments. The Stanford Administrative Panel on Laboratory Animal Care (APLAC) approved all experiments.

Virus injections

For miniature microscope and brain slice experiments, we used AAV2/9-CAG-FLEX-GCaMP6m-WPRE.SV40 (1.37 × 109 genome copies (GC) μl−1; Penn Vector Core). For two-photon imaging experiments, we used the Camk2a promoter to drive GCaMP expression (AAV2/9-CaMKII-GCaMP6m; 1.8 × 109 GC μl−1) in both SPN types. To inject the virus, we anaesthetized mice with isoflurane (2% in O2) and stereotaxically injected virus into the dorsomedial striatum (anteroposterior (AP): 1.0 mm from bregma; mediolateral (ML): 1.5 mm from midline; dorsoventral (DV): −2.7 mm (down to −3.2 mm then back up to −2.7 mm from dura)). The injection needle had a 33-gauge bevelled tip. We injected 500 nl of virus at a rate of 250 nl min−1. After the injection was done, we waited 10 min and then withdrew the syringe. We recorded the bregma–dura distance for subsequent positioning of the optical guide tube, sutured the scalp, and allowed the mice to recover for a week before implanting the guide tube.

In vitro electrophysiological and Ca2+ imaging studies in striatal tissue slices

Using established techniques39, we performed dual Ca2+ imaging and electrophysiological studies of SPN dynamics in live brain slices obtained from Drd1acre and Adora2acre mice >3 weeks after virus injection. The numerical aperture of the imaging system was matched to that of the miniature microscope used in freely behaving mice. We imaged striatal Ca2+ transients at a frame acquisition rate of 20 Hz, using a scientific-grade CMOS camera (ORCA-Flash 4.0 LT, Hamamatsu Photonics) and MicroManager software (NIH)40. Concurrently, we performed whole-cell current-clamp recordings of SPN activity using a patch pipette (3–5 MΩ) and a Multiclamp 700B (Molecular Devices) patch-clamp amplifier. Additional details can be found in the Supplementary Methods.

Surgeries

To prepare mice undergoing 6-OHDA lesions and imaging, we anaesthetized mice with isoflurane (2% in O2) and used a 0.5-mm-diameter drill bit to create a craniotomy dorsal to the SNc (AP = −3.5 mm; ML = 1.25 mm) for insertion of a 26-gauge guide cannula (2.5-mm-long projection, Plastics One, Inc.). We drilled three additional small holes (0.5-mm diameter) at spatially distributed locations for insertion of stabilizing skull screws.

We used a 1.4-mm-diameter drill bit to create another craniotomy (AP = 1.0 mm; ML = 1.5 mm) for implantation of the optical guide tube. We fabricated this guide tube by using ultraviolet liquid adhesive (Norland #81) to fix a 2.5-mm-diameter disc of #0 glass to the tip of a 3.8-mm-long, extra-thin 18-gauge stainless steel tube (McMaster-Carr). We ground off any excess glass using a polishing wheel (Ultratec). Using a 27-gauge blunt-end needle, we aspirated the cortex down to DV = −2.1 mm from the dura and implanted the exterior glass face of the optical guide tube at DV = −2.35 mm. We lowered the SNc guide cannula to DV = −1.0 mm from the dura. After stereotaxic placement of these components, we applied Metabond (Parkell) to the skull and fixed the full assembly using dental acrylic (Coltene). After the acrylic hardened, we used a second batch of acrylic to attach an aluminium head bar to the cranium, for the purpose of head-fixing the mice during subsequent experimental procedures. Mice recovered for 3–4 weeks before two-photon imaging experiments or mounting of the miniature microscope.

Mounting of the miniature microscope

At 3–4 weeks after guide tube implantation, we assessed the extent of Ca2+ indicator expression in the dorsomedial striatum. To do this, we inserted a gradient refractive index (GRIN) lens (1 mm diameter; 4.12 mm length; 0.46 numerical aperture; 0.45 pitch; GRINTECH GmbH or Inscopix Inc.) into the optical guide tube and used a commercial two-photon fluorescence microscope (Ultima, Bruker) to image the striatum of each mouse while it was anaesthetized with isoflurane (2% in O2). In mice with uniform indicator expression, we secured the GRIN lens in the guide tube with ultraviolet (UV)-light curable epoxy (Loctite 4305).

After affixing the GRIN lens, we lowered a miniature microscope (nVistaHD, Inscopix Inc.) towards the GRIN lens until the fluorescent tissue was in focus. To secure the miniature microscope to the cranium, we created a base on the cranium around the GRIN lens using blue-light curable resin (Flow-It ALC; Pentron). We attached the base plate of the miniature microscope to the resin base using UV-light curable epoxy (Loctite 4305). After affixing its base plate, we released the microscope and attached a base plate cover (Inscopix Inc.). We coated the resin with black nail polish (Black Onyx, OPI) to make it opaque.

6-OHDA infusions

To block serotonin and noradrenaline transporters and thereby prevent lesioning of non-dopamine monoamine neurons, we injected mice with desipramine (25 mg kg−1; i.p.) 30 min before 6-OHDA infusion41. We anaesthetized the mice with isoflurane (2% in O2) and stereotaxically inserted into the craniotomy above the SNc (see ‘Surgeries’) an injection cannula (33 gauge, 17-mm-long) that was connected to a syringe pump loaded with 6-OHDA (4 μg μl−1 in saline). We sequentially infused 6-OHDA (650 nl at 100 nl min−1) at three sites: DV = −4.2 mm, −4.0 mm and −3.8 mm below the dura. We withdrew the injection cannula 10 min after the final infusion. After infusion, we monitored the body mass of each mouse and subcutaneously administered 1 ml lactated Ringer’s solution to prevent dehydration. In the first 3 days after 6-OHDA infusion, we provided the mice with manually crumbled mouse chow, to aid recovery.

Pharmacology

We dissolved the D1R agonist (SKF81297; 1, 3 or 6 mg kg−1), D1R antagonist (SCH23390; 0.2 mg kg−1), D2R agonist (quinpirole; 1, 3 or 6 mg kg−1), D2R antagonist (raclopride; 1 mg kg−1), or l-DOPA (1, 6 or 10 mg kg−1) mixed with benserazide (15 mg kg−1) in 0.9% saline solution (all compounds from Sigma-Aldrich). We delivered all drugs systemically to the mice via intraperitoneal injection (10 ml kg−1 injection volume). We selected doses based on published receptor occupancy data in systemically injected rodents42,43,44 and our own evaluations of the dose-dependent effects of these drugs on behaviour in hemiparkinsonian mice (Extended Data Fig. 9). Specifically, we aimed to select doses with overlapping ranges of behavioural potency to test during Ca2+ imaging (Fig. 4). Note that SCH23390 does bind to 5HT2 receptors, but its receptor occupancy level on 5HT2 receptors is 40–50 times less than that of D1Rs at the dose we used45,46. For all Ca2+ imaging sessions, we waited 15 min after drug injections before recording neural activity for 30 min. See Extended Data Fig. 9 for the time-dependence of drug efficacy.

Experimental timeline

Before the lesion, we administered mice the D1R antagonist SCH23390 (day −4, 0.2 mg kg−1), the D2R antagonist raclopride (day −3, 1 mg kg−1), the D1R agonist SKF81297 (day −2, 1 mg kg−1), and the D2R agonist quinpirole (day −1, 1 mg kg−1). After the lesion, we administered quinpirole (day 15, 1 mg kg−1; day 16, 6 mg kg−1), SKF81297 (day 17, 1 mg kg−1; day 18, 6 mg kg−1), and the dopamine precursor l-DOPA (day 19, 1 mg kg−1; day 20, 6 mg kg−1; day 21, 10 mg kg−1). On days on which mice received drug treatments, we performed 30 min of Ca2+ imaging before administering the drug, and another 30 min of Ca2+ imaging afterward.

Ca2+ imaging in freely moving mice

Brain imaging in freely moving mice occurred in a circular arena (31 cm in diameter). To habituate mice to this arena, we allowed them to explore it for 1 h on each of three sequential days before any Ca2+ imaging. Prior to each imaging session (Fig. 1a), we head-fixed each mouse by its implanted head bar and allowed the mouse to walk or run in place on a running wheel. We then attached the miniature microscope and adjusted the focal setting to optimize the field-of-view, in the first imaging session, or in subsequent sessions to match the field-of-view to that of all prior sessions (Extended Data Fig. 1j).

After securing the microscope to the head of the mouse, we detached the mouse from its head restraint and allowed it to freely explore the circular arena. After allowing ≥10 min for the mouse to habituate to the arena, fluorescence Ca2+ imaging commenced using 50–200 μW of illumination power at the specimen plane and a 20-Hz frame acquisition rate. We also acquired 20-Hz movies of the behaviour of each mouse using a TTL-triggered video camera (SVWGAM; EPIX Inc.), a varifocal lens (T3Z2910CS; Computar), an image frame grabber card (PIXCI-SI; EPIX Inc.) and image-acquisition software (XCAP; EPIX Inc.). We concurrently recorded behavioural and Ca2+ imaging data in sessions generally lasting 60 min in total. On days on which the mouse received drug treatments (Fig. 1a), we gave the mouse an injection of saline vehicle, waited 5 min, and then performed 30 min of Ca2+ imaging. We then administered the drug, waited 15 min for the drug to take effect, and then acquired another 30 min of Ca2+ imaging data.

Two-photon Ca2+ imaging in behaving mice

We acquired volumetric Ca2+ imaging data from four different axial planes in the brains of head-fixed mice free to behave on a running wheel. The mice expressed the red fluorophore tdTomato in dSPNs and GCaMP6m in both SPN types (see ‘Mice’). After implantation of an optical guide tube and GRIN microendoscope in the dorsomedial striatum (see ‘Surgeries’), we head-fixed the mice beneath the microscope objective lens carrier of a custom-built two-photon microscope47. The microscope was equipped with a resonant galvanometer laser-scanning mirror (CRS 8 K, Cambridge Technologies), allowing a 30-Hz frame acquisition rate (512 × 512 pixels) under the control of ScanImage 5.2 software48 (Vidrio Technologies). Additional details can be found in the Supplementary Methods.

Rotarod assay

Before day −5 (Fig. 1a), we trained mice for 3–4 days on an accelerating rotarod (EzRod; Omnitech) to ensure that they could remain on the rotarod. Each mouse performed three trials per day, with the rod accelerating from 6 to 60 r.p.m. in 3 min. During subsequent rotarod sessions (days −5, 1 and 14), we imaged SPN Ca2+ activity as mice walked on the rotarod at a constant speed of 5 r.p.m. for 10 min. After dopamine depletion, we excluded from analyses of SPN Ca2+ activity any mouse that could not stay on the rotarod for the full 10 min of Ca2+ imaging.

Turning bias assay

To eliminate any potential effects on mouse turning behaviour from the miniature microscope or its cable, we studied the behaviour of a separate cohort of mice that underwent unilateral dopamine depletion. This allowed us to assay the dose-dependent behavioural effects of the same drugs that we studied with in vivo Ca2+ imaging. We manually scored the number of rotations that mice made ipsilateral and contralateral to the right cerebral hemisphere during 1 h recordings of open field locomotion. We computed the rotational bias of each mouse as the difference between the total numbers of rotations in each direction. We then lesioned the right SNc with 6-OHDA and repeated this scoring procedure 1 day and 14 days after the lesion.

We then evaluated the effects of intraperitoneal injections of saline vehicle, quinpirole (1, 3 and 6 mg kg−1), SKF81297 (1, 3 and 6 mg kg−1) and l-DOPA (1, 6 and 10 mg kg−1) during 3 h of locomotion in the open field, on sequential days. We manually scored the rotational bias of each mouse off-line in 20-min time bins (Extended Data Fig. 9a–d).

Dyskinesia assay

In the same mice and behavioural sessions used to quantify the turning bias, we measured the abnormal involuntary movement score (AIMS) for each mouse following established procedures31. This score is a well-known metric used to quantify dyskinesia levels in parkinsonian mice in response to a range of drug treatments and experimental manipulations31. In brief, for a period of 3 h after systemic drug injection, every 20 min we assigned each mouse an AIMS value by observing the behaviour of the mouse for a sample period of 60 s. We monitored the mouse for the presence of abnormal (i) axial, (ii) limb and (iii) orofacial movements. To provide multiple viewing perspectives of the mouse during AIMS scoring, we placed a pair of rectangular mirrors (30.5 cm × 45.7 cm) outside the open field arena, at 90° to each other, behind the mouse and opposite to the experimenter. During each 60-s sample period, we assigned the mouse a score of 0–4 in each category (i–iii). A score of ‘0’ signified no observed abnormalities. A score of ‘1’ or ‘2’ signified abnormal behaviour that respectively lasted <30 s or >30 s. A ‘3’ signified abnormal behaviour that lasted 60 s but that could be interrupted by an external stimulus (for example, a loud clap). A ‘4’ indicated abnormal behaviour that lasted 60 s and could not be interrupted. For each 60-s sample period, we summed the individual category AIMS values to attain the total AIMS value.

Histology

After all behavioural and Ca2+ imaging experiments, we euthanized and intracardially perfused the mice with phosphate-buffered saline (PBS) and then a 4% solution of paraformaldehyde in PBS. We sliced the fixed brain tissue using a vibratome (Leica VT1000s) to obtain 80-μm-thick coronal sections. We immunostained the tissue sections with antibodies against tyrosine hydroxylase (1:500, Aves TYH) and GFP (1:1,000, Molecular Probes A-11122) and then applied fluorophore-conjugated secondary antibodies (Jackson Immunoresearch 703-586-155 and 711-546-152, respectively). We visualized immunofluorescence in our sections using a slide-scanning microscope (Olympus VS-120) and confirmed that all mice included for post-lesion analyses had a complete unilateral loss of dopamine neurons in the SNc.

Video analysis of mouse behaviour

We used custom software written in MATLAB to analyse the videos (20-Hz frame acquisition rate) of mouse behaviour acquired during Ca2+ imaging with the miniature microscope. First, we ranked all the pixels in each video frame according to their intensity values. Under the lighting conditions used to acquire the videos, the mouse appeared much darker than the surrounding open field arena (Supplementary Videos 1, 2). Therefore, we next determined the centroid location of the mouse in each frame as the mean location of the 1,500 darkest pixels. By visual inspection of each movie, we confirmed that this approach reliably tracked the movements of each mouse and yielded an accurate record of its position. To match the temporal resolution of our down-sampled Ca2+ recordings, we down-sampled the locomotor speed traces to 5 Hz via linear interpolation. We classified each 200-ms time bin as one in which the mouse was either ‘resting’ or ‘moving’, according to the down-sampled speed trace and using a threshold value of 0.5 cm s−1 to separate the two states. If the mouse was ‘moving’ in two time bins separated by <1 s, we classified the intervening time bins as ones in which the mouse was ‘moving’.

We applied these analytic procedures uniformly to the behavioural videos across all experimental and drug treatment conditions. Under dyskinetic conditions, mice commonly exhibit ongoing movements of the face, limbs and trunk. In general, these movements did not translate the body centroid sufficiently rapidly to register as locomotor episodes. Nevertheless, an important caveat is that under dyskinetic conditions a greater number of sub-threshold movements may have occurred during the computationally identified ‘resting’ periods than under normal or parkinsonian conditions.

Classification of movement types

To study and compare movements of different types made by freely moving mice (Extended Data Figs. 3, 8), we used custom software written in MATLAB (Mathworks) to extract from the behavioural videos the intervals from –4 to 4 s surrounding the onset of each movement bout. Using this software, we visually scored each movement bout as an instance of forward locomotion, a left or right turn, grooming, or upward rearing. Additional details are shown in Extended Data Fig. 3.

Quantification of movement in head-restrained mice

To analyse the locomotor behaviour of mice during two-photon Ca2+ imaging sessions (see ‘Two-photon Ca2+ imaging in behaving mice’; Extended Data Fig. 4), we computed the running speed of the mouse using the signals from a rotary encoder on the running wheel and identified movement periods during which the running speed was above a minimum threshold. Additional details are shown in Extended Data Fig. 4.

Basic processing of in vivo fluorescence Ca2+ movies

To reduce processing times, we spatially down-sampled the raw Ca2+ videos from the miniature microscope using 4 × 4 bi-linear interpolation. To correct images for lateral motions of the brain, we used the image-alignment algorithm, TurboReg49, to perform a rigid image registration across all frames of the movie. To correct for fluctuations in background fluorescence intensity, we applied a Gaussian low-pass filter to each image, which smoothed all structures <100 μm in size, and then divided each image frame by its low-pass filtered version. Using the resultant normalized movie (F(t)), we subtracted the time-averaged, mean fluorescence intensity (F0) of each pixel to obtain the difference movie, ΔF(t) = F(t)−F0. We then divided this difference by F0 to obtain movies of relative fluorescence changes, ΔF(t)/F0. Finally, we temporally down-sampled (4×) the ΔF(t)/F0 movies to a 5-Hz frame rate via a linear interpolation, and we used the resulting videos for extraction of individual neurons and their Ca2+ activity traces.

We processed the raw two-photon Ca2+ videos with the same procedures, but with two exceptions: we did not down-sample the movies in space or time, and we applied a median spatial filter (6 × 6 pixels) to the two-photon ΔF(t)/F0 movies before proceeding to cell sorting. For display purposes only (Supplementary Video 3), we converted the fluorescence trace, F(t), of each pixel into a trace of z scores, ΔF(t)/σ. Here ΔF(t) = F(t)−F0 denotes the deviation of each pixel from its mean value, F0, and σ denotes the background noise of each pixel, which we estimated by taking the standard deviation values calculated with a sliding 250-s window.

Identification of individual neurons

We identified individual cell bodies in the brain imaging videos by applying to the pre-processed one- and two-photon ΔF(t)/F0 movies an established algorithm for cell sorting based on principal component and independent component analyses (PCA–ICA)50. As in previous work50, the extracted spatial filters generally had sizes, morphologies and corresponding Ca2+ activity traces that were characteristic of individual neurons, but there were also some filters that were obviously not neurons that we discarded. We verified every cell included in the analyses by visual inspection. We did not register individual cells over multiple days; hence all analyses characterizing the rates, amplitudes and durations of Ca2+ events (Extended Data Fig. 1l–n) were conducted separately for each day of experimentation, over the uniform imaging duration (1 h per session).

Cells identified in the two-photon Ca2+ videos underwent further analyses, to classify each cell as being either an iSPN or dSPN, and to remove duplicate copies of individual cells found in more than one image plane. We first manually identified the centroids of all visible cells in each plane labelled with tdTomato. We then compared these centroid locations to those of the cells extracted from the two-photon Ca2+ videos and matched each tdTomato-expressing cell to the nearest unassigned cell in the Ca2+ video (Extended Data Fig. 4b, c).

To remove duplicate copies of individual cells seen on more than one plane of the two-photon Ca2+ videos, we computed for all nearby cells found on different planes both the distance between the centroids of the two cells and the Pearson correlation coefficient of their ∆F(t)/F0 activity traces. We identified duplicate copies of the same cell as cell pairs within 15 μm of each other and with an activity correlation coefficient >0.7. Among the duplicates, we retained the one with the Ca2+ activity trace with the highest signal-to-noise ratio.

Detection of Ca2+ transients

After identifying individual cells in the one- and two-photon brain imaging datasets, we detected Ca2+ events in the fluorescence trace of Ca2+ activity of each cell using a threshold-crossing algorithm to detect fluorescence peaks that were ≥3 s.d. above the baseline signal value for ≥1.4 s. We determined the time of each Ca2+ event as the temporal midpoint between the time of the Ca2+ event’s fluorescence peak and the most recent preceding trough in fluorescence23.

On 6.4 ± 3% (mean ± s.d.) of all detected Ca2+ events in the one-photon datasets, bright fluorescence increases from a Ca2+ event in one cell occupied more pixels than a single spatial filter. To prevent contamination of the time traces of other cells we took a conservative approach and allowed only a single cell among a group of neighbours to register a Ca2+ event in a single 200-ms time frame. We defined neighbours as cells that had centroids within 20 μm of one another23. If multiple Ca2+ events arose within 200 ms in neighbouring cells, we retained only the transient with the greatest peak value.

To characterize the waveforms of the Ca2+ transients of the cells (Extended Data Figs. 1l–n, 5f–h), we took the spatial filter of each cell, zeroed all pixels with values <50% of the peak value, and applied the truncated filter to the movie of ΔF(t)/F0 to generate a time trace of Ca2+ activity (Fig. 1d). Using the previously identified Ca2+ events, we then considered the statistical distribution of Ca2+ transient waveforms among all events and SPNs of a given type. From this distribution, we computed the median and interquartile range values of Ca2+ transient amplitude and duration (Extended Data Fig. 1l–n). With the exception of these basic characterizations of the Ca2+ transient waveforms, all subsequent analyses made use only of the occurrence times of the Ca2+ transients and treated these occurrences as binary events.

Determinations of coactivity levels in cell pairs

SPN ensembles displayed prominent temporal correlations between cells across timescales of ~1–2 s (Supplementary Videos 14). To characterize correlations at these timescales, we first applied a ‘forward-smoothing’ by taking the binarized traces of Ca2+ events of individual cells and extending the number of time bins (200 ms per bin after temporal down-sampling; see ‘Basic processing of in vivo fluorescence Ca2+ movies’) in which a cell was marked as active so as to include all frames within 1 s after the Ca2+ event. Then, to assess the extent to which pairs of cells had correlated patterns of activity, for each cell pair we computed the Jaccard index characterizing the similarity between the binarized Ca2+ activity traces of two cells. We used this index as a metric of pairwise coactivation and determined it as the total number of time bins during which both cells in a pair were active, divided by the total number of time bins in which either cell was active. We chose the Jaccard index because, unlike more common measures of correlation, such as the Pearson correlation coefficient, the Jaccard index does not depend on the number of time bins in which neither cell is active and in this sense is more sensitive to the periods of joint activity rather than those of joint inactivity. We computed the mean value of the Jaccard index as a function of the distance between the cells in a pair (Fig. 2d and Extended Data Figs. 4j, 6e).

To control for changes in pairwise coactivation that might be simply owing to the changes in Ca2+ event rates resulting from the experimental manipulations and drug treatments, we also computed the Jaccard index for shuffled datasets in which the Ca2+ events of each cell were randomly re-distributed in time. We performed 1,000 independent shuffles of the Ca2+ event times for each cell, when mice were resting or in locomotion. To compare pairwise coactivation levels in the real data against those in the shuffled data, we normalized the plots of mean Jaccard index for the real data by the corresponding values for the shuffled data (Fig. 2d, e and Extended Data Figs. 4j, k, 6e). Alternatively, we subtracted the coactivity values determined from the shuffled datasets from those of the real data, and compared the resultant values across different experimental conditions for the proximal cell pairs (cell centroid separations between 20–100 μm lateral separation) (Figs. 3j, 4f, 5g and Extended Data Fig. 7i, j).

We also checked whether SPN activity rates varied across the imaging field-of-view and thus affected estimates of coactivity levels. We computed the Pearson correlation coefficient between the Ca2+ event rate of every cell and its distance from the centre of the field-of-view. We found a very weak but statistically significant correlation between these two variables (r = 0.07 ± 0.02; P < 10−10; n = 29,097 cells; n = 19 mice, each sampled during five imaging sessions), which explained almost none of the variations in the Ca2+ activity rates of the cells across the SPN population (R2 = 0.005). Overall, effects arising from the locations of the cells in the field-of-view were far too weak to account for the substantial distance-dependence of pairwise coactivity levels of the cells (Fig. 2d).

We determined pairwise coactivity levels in the two-photon Ca2+ videos using identical procedures as for the one-photon Ca2+ videos.

Spatial coordination index

In the Ca2+ videos, there were plainly evident, spatially correlated patterns of SPN activation at the seconds time scale. To characterize the spatial structure of these patterns at individual time points in the videos, we computed an index of spatial coordination. To calculate how this index varied over an entire imaging session (Extended Data Fig. 2), we took the binarized traces of the Ca2+ events of individual cells and extended the number of time bins (200 ms each after temporal down-sampling; see ‘Determinations of coactivity levels in cell pairs’) in which a cell was marked as active so as to include all frames within 1 s after each Ca2+ event. We performed this temporal expansion, which increased the time window over which cells appeared as jointly active, to highlight the spatially clustered activation of cells at the seconds time scale. For each time bin, we then computed the set of distances between all pairs of cells that were active in the time bin. For each time bin, we also calculated this set of pairwise distances for shuffled versions of the data, in which we randomized the identities of the active cells while maintaining their centroid coordinates as well as the same number of active cells in the time bin. We performed 1,000 independent shuffles for each time bin. Aggregating the results across all 1,000 shuffles, we computed the cumulative distribution function of pairwise distances between active cells. For each time bin, we also computed this cumulative distribution function for the real data, and performed a pair of one-tailed Kolmogorov–Smirnov tests that compared the cumulative distribution functions of pairwise distances in the shuffled and real versions of the data. With one of the two tests, we examined the hypothesis that the active cells in the real data were distributed closer together than expected by chance, and with the other, we examined the hypothesis that the active cells in the real data were distributed further away from each other than expected by chance. We took the logarithm (base ten) of the lesser of the two P values (that is, the P value from the test that more significantly rejected its null hypothesis). We multiplied the resultant number by negative one or one, respectively, according to whether the locations of the active cells in the time bin were spatially correlated or anti-correlated (as determined by which of the two Kolmogorov–Smirnov tests gave the more significant result). We assigned the spatial coordination index (SCI) the value of the resulting product.

To characterize the time-dependent relationship between mouse speed and the SCI, we computed the time-dependent cross-correlation function between the two variables (Extended Data Fig. 2e, f). To analyse the effects of the temporal sampling rate on these calculations, before computing the SCI, we first forward-smoothed (see previous paragraph) the Ca2+ event rasters using a variety of different smoothing time constants from 200 to 1,000 ms. After computing the speed-SCI cross-correlation function, we normalized it to the mean of its values between the intervals from −4 to −3 s and from 3 to 4 s.

Analyses of Ca2+ event rates as a function of locomotor speed

To examine how the rate of Ca2+ events varied with changes in locomotor speed (Figs. 2a, 3e, 4b–d, 5c and Extended Data Figs. 4g, 7d, e), we sorted the individual image frames of the behaviour video of each mouse according to the instantaneous locomotor speed of the mouse. We then binned the image frames into sets of images for which the locomotor speed was the same to within 0.036–0.73 cm s−1, using finer bins at lower speeds and coarser bins at higher speeds. For each image set, we computed its mean rate of Ca2+ events across all detected SPNs.

To make comparisons between mice (Fig. 2a), we took the mean Ca2+ event rate of each mouse as a function of locomotor speed and normalized this curve to the mean Ca2+ event rate of each mouse while it was at rest (speed <0.5 cm s−1). We averaged these normalized traces across the set of all Drd1acre or Adora2acre mice.

To compare Ca2+ event rates during the various drug treatments to those following injections of saline vehicle (Figs. 4b–d, 5c and Extended Data Fig. 7d, e), we normalized the Ca2+ event rates for each mouse and each drug condition by the mean rate when the mouse was at rest after having been given saline vehicle. For each drug condition, we then averaged these normalized curves across all mice in the cohort.

To compare Ca2+ event rates before and after dopamine depletion (Fig. 3e), we first computed the curve of the mean Ca2+ event rate of each mouse as a function of locomotor speed. We averaged these curves across mice of a given genotype, and then normalized the resulting trace to the mean rate when the mice were at rest in baseline recordings, before 6-OHDA lesion. For all comparisons, we calculated the s.e.m. for the mean Ca2+ event rate for each mouse and speed bin.

Determinations of motion onset- and offset-triggered averages

We identified onsets of locomotion by finding all movement bouts (≥2 s in duration) that occurred ≥2 s after the prior movement bout. We identified offsets of locomotion by finding all movement bouts that preceded the next movement bout by ≥2 s. To calculate motion onset- or offset-triggered averages, for each mouse we first normalized the speed-dependent, mean rates of Ca2+ events or mean spatial coordination indices to the corresponding mean values from when each mouse was at rest during the period of −2 to −1 s relative to motion onset. We then took all motion onset and offset occurrences and calculated the time-dependent, onset- and offset-triggered averaged traces of the normalized Ca2+ event rate or spatial coordination index. We averaged these traces across all mice in each cohort.

To calculate the average times at which dSPN and iSPN activity reached their half-maximum values relative to the onset of movement, we fit logistic curves to the mean trace of the Ca2+ event rate of each mouse for the interval of −2 to 2 s relative to movement onset. We then determined the half-maximum activation time from the fit parameters. We averaged these time values over all mice of the same genotype.

To calculate the average times at which dSPN and iSPN activity commenced relative to the onsets of locomotion on the running wheel (Extended Data Fig. 4h), we calculated the percentage of cells of each type that were active in each time bin in the binarized traces of Ca2+ activity (see ‘Detection of Ca2+ transients’). Across all instances of motion onset, we computed the average number of dSPNs and iSPNs that were active in each time bin over the interval of −3 to 1 s relative to motion onset. We then fit these averaged traces to a logistic curve. From each parameterized fit curve, we determined the onset time as the time at which the mean percentage of active cells was ≥3 s.d. of the percentage of active cells during the baseline periods of −3 to −1 s relative to motion onset.

Analysis of Ca2+ event-triggered averages

To examine how the occurrences of the Ca2+ events of cells (in the one- or two-photon imaging datasets) correlated in time with changes in the locomotor speed of the mice (Figs. 2b, 3h and Extended Data Fig. 4i), we computed the time trace of the Ca2+ event-triggered, mean locomotor speed for each cell. For each mouse, we averaged these event-triggered traces of mean speed across all cells and normalized the resulting trace by its value at either −2 s or −20 s relative to Ca2+ event onset, in the one- and two-photon imaging studies, respectively. In experiments with freely moving mice, we averaged these traces across all mice with the same genotype. In dual-colour imaging experiments with head-fixed mice, we averaged the traces across all SPNs of the same type. We computed the first temporal moment of the resulting averaged trace across the interval of −2 to 2 s, to determine the temporal offset between peak locomotor speed and the occurrence of an SPN Ca2+ event.

Similarities of the neural ensembles activated by movements of different types

To statistically evaluate the relative similarity of the neural ensembles activated during movement bouts of the same or different types, and during baseline periods, we used the Jaccard similarity index (Extended Data Figs. 3d, e, 8d–g). Additional details can be found in the Supplementary Methods.

Decoding mouse locomotor speed based on SPN Ca2+ activity

We used a generalized linear model (GLM) to make time-dependent predictions of the locomotor speeds of mice based on the ΔF(t)/F0 activity traces of the cells as determined by two-photon Ca2+ imaging. Additional details are shown in Extended Data Fig. 4.

Computational simulations of SPN activity traces

To examine the temporal accuracy with which we could use Ca2+ events in SPNs to determine the times of the accompanying action potentials, we created and analysed artificial datasets based on the fluorescence responses to action potentials observed in our dual electrical–optical recordings in vitro and on basic facets of the fluorescence recordings in vivo. Additional details can be found in the Supplementary Methods.

Data analyses and statistical tests

We performed data analysis using custom software written in MATLAB and ImageJ. We also used the Prism (Graphpad) and R programming environments for statistical analyses. We used two-tailed, non-parametric statistical tests to avoid assumptions of normal distributions and equal variance across groups. All signed-rank tests were Wilcoxon signed-rank tests. All rank-sum tests were Wilcoxon rank-sum tests. Analyses were performed unblinded. The sizes of our mice samples were chosen to approximately match those of previous work, as there was no pre-specified effect size. In all box-and-whisker plots, horizontal lines denote median values, boxes cover the middle two quartiles, and whiskers span 1.5× the interquartile range. P and n values for the statistical tests performed in all the figures can be found in the Supplementary Information.

Reporting summary

Further information on experimental design is available in the Nature Research Reporting Summary linked to this paper.

Code availability

The algorithm used for image registration is available on its author’s website49. The algorithm used for cell sorting is available as Supplementary Material published elsewhere50. Other software code that support the findings of this study are available from the corresponding authors upon reasonable request.

Data availability

The data that support the findings of this study are available from the corresponding authors upon reasonable request.