Mouse-optimized interval timing.

A) We trained mice to perform an interval timing task in which they had to respond by switching nosepokes after a 6 second interval (in gray shade in all panels). Mice start trials by making a back nosepoke, which triggers an auditory and visual cue. On 50% of trials, mice were rewarded for a nosepoke after 6 seconds at the designated ‘first’ front nosepoke; these trials were not analyzed. On the remaining 50% of trials, mice were rewarded for switching to the ‘second’ nosepoke; initial nosepokes at the second nosepoke after 18 seconds triggered reward when preceded by a first nosepoke. Switch response time was defined as the moment mice depart the first nosepoke prior to second nosepoke arrival. Because cues are identical and on for the full trial on all trials, switch responses are a time-based decision guided explicitly by temporal control of action; indeed, mice switch nosepokes only if they don’t receive a reward at the first nosepokes after the 6 second interval. Top row - screen captures from the operant chambers during a trial with switch response. B) Response probability distribution from 30 mice for first nosepokes (purple), switch responses (green), and second nosepokes (orange). Responses at the first nosepoke peaked at 6 seconds, and switch responses peaked after 6 seconds. Because nosepoking at the second nosepoke was only rewarded after 18 seconds, second nosepokes tended to be highly skewed. Shaded area is standard error. C) Cumulative switch response density for each of 30 mice. D) Average cumulative switch response density; shaded area is standard error. E) DeepLabCut tracking of position during interval timing from a single mouse behavioral session revealed increased velocity after trial start and then constant velocity throughout the trial. Shaded area is standard error. In B-E, the 6 second interval is indicated in gray.

Summary of mice, sessions, # of switch trials, and MSNs

D2-MSNs and D1-MSNs have opposing dynamics during interval timing.

A) D2-MSNs in the indirect pathway, which project from the striatum to the globus pallidus external segment (GPe; sagittal section) and internal segment (GPi) and B) D1-MSNs, which project from the striatum to the GPe, GPi, and substantia nigra (SNr; sagittal section). Peri-event raster C) from an optogenetically tagged putative D2-MSN (red) and D) from an optogenetically tagged putative D1-MSN (blue). Shaded area is the bootstrapped 95% confidence interval. E) Peri-event time histograms (PETHS) from all D2-MSNs and F) from all D1-MSNs. were binned at 0.2 seconds, smoothed using kernel-density estimates using a bandwidth of 1, and z-scored. Average activity from PETHs revealed that G) D2-MSNs (red) tended to ramp up, whereas H) D1-MSNs (blue) tended to ramp down. Shaded area is standard error. Data from 32 tagged D2-MSNs in 4 D2-Cre mice and 41 tagged D1-MSNs in 5 D1-Cre mice.

Quantification of opposing D2-MSN and D1-MSN dynamics

A) Principal component analysis revealed that the first component (PC1) exhibited time-dependent ramping. B) The first principal component explained ∼54% of variance across tagged MSN ensembles. C) Differences between D2-MSNs (red) and D1-MSNs (blue) were captured by PC1 which exhibited time-dependent ramping. D) These differences were also apparent in the linear slope of firing rate vs time in the interval, with D1-MSNs (blue) having a more negative slope than D2-MSNs (red). In C and D, each point represents data from a tagged MSN. * = p < 0.05 via linear mixed effects models accounting for variance between mice. Data from 32 tagged D2-MSNs in 4 D2-Cre mice and 41 tagged D1-MSNs in 5 D1-Cre mice.

Four-parameter drift-diffusion computational model of striatal activity during interval timing.

A) We modeled interval timing with a low parameter diffusion process with a drift rate D, noise ξ(t), and a baseline firing rate b that drifts toward a threshold T indicated by dotted lines. With D2-MSNs disrupted (solid red curves), this drift process decreases and takes longer to reach the threshold. B) The same model also accounted for D1-MSNs with an opposite drift. With D1-MSNs disrupted (solid blue curves), the drift process again takes longer to reach the threshold. Because both D2-MSNs and D1-MSNs contribute to the accumulation of temporal evidence, this model predicted that C) disrupting D2-MSNs would increase response times during interval timing (dotted red line) and D) disrupting D1-MSNs would also increase response times (dotted blue line). Threshold T depends on b and target firing F. For details on the selection of parameter values in DDM, see Methods and Fig S7-S8.

Disrupting D2- or D1-MSNs increases response times.

A) As predicted by our DDM in Fig 4, optogenetic inhibition of D2-MSNs (red) shifted cumulative distributions of response times to the right, and B) increased response times; data from 10 D2-Cre mice expressing halorhodopsin (Halo). Also as predicted by our DDM, C) optogenetic inhibition of D1-MSNs shifted cumulative distribution functions to the right, and D) increased response times; data from 6 D1-Cre mice expressing Halo. Similarly, E) pharmacologically disrupting D2-dopamine receptors (red) with the D2 antagonist sulpiride shifted cumulative distribution functions to the right, and F) increased response times; data from 10 wild-type mice. Also, G) pharmacologically disrupting D1-dopamine receptors (blue) with the D1 antagonist SCH23390 shifted cumulative distribution functions to the right, and H) increased response times; data from the same 10 wild-type mice as in E-F. In B, D, F, and H connected points represent the mean response time from each animal in each session, and horizontal black lines represent group medians. *p = < 0.05, signed rank test. See Figure S6 for data from opsin- negative controls.

D2 and D1 blockade shift temporal dynamics.

A) We recorded dorsomedial striatal medium spiny neuron (MSN) ensembles during interval timing in sessions with saline, D2 blockade with sulpiride, or D1 blockade with SCH23390. Made with BioRender.com. B-D) Example peri-event raster from MSNs in sessions with saline (black), D2- dopamine blockade (red), or D1-dopamine blockade (blue). Shaded area is the bootstrapped 95% confidence interval. E) MSNs from 99 neurons in 11 mice from saline, D2 blockade, or D1 blockade session; MSNs were matched across sessions based on waveforms and interspike interval. Each row represents a peri-event time histogram (PETH) binned at 0.2 seconds, smoothed using kernel-density estimates using a bandwidth of 1, and z-scored. Colors indicate z-scored firing rate. See Fig S11 for analyses that assume statistical independence. F) Principal component analysis (PCA) identified MSN ensemble patterns of activity. The first principal component (PC1) exhibited time-dependent ramping. G) PC1 explained 54% of population variance among MSN ensembles; higher components were not analyzed. H) PC1 scores were closer to zero and significantly different with D2 or D1 blockade; * = p < 0.05 via linear mixed effects; data from 99 MSNs in 11 mice.

D2 and D1 blockade degrade MSN temporal encoding.

We used naïve Bayesian classifiers to decode time from MSN ensembles in A) saline sessions, B) D2 blockade sessions, and C) D1 blockade sessions. Color represents the temporal prediction across 20 trials with red representing stronger predictions. D) Temporal encoding was strong early in the interval, and D2 or D1 blockade degraded classification accuracy. Temporal encoding was decreased later in the interval. Each point represents the R2 for each trial of behavior for MSN ensembles from 11 mice. * p < 0.05 vs saline from 0-6 seconds. Horizontal black lines in (D) represent group medians.

Gamma distribution parameters

A) Recording locations in the dorsomedial striatum (targeting AP +0.4, ML -1.4, DV -2.7). Electrode reconstructions for D2-Cre (red), D1-Cre (blue), and wild-type mice (green). Only the left striatum was implanted with electrodes in all animals. B) MSN classification by waveform criteria for sessions with optogenetic tagging. C) Example of an optogenetically tagged MSN. This neuron expresses ChR2 and fired action potentials within 5 milliseconds of 473 nm laser pulses (red line). Spikes from laser trials shown as red ticks; trials without laser shown as blue ticks. Inset on bottom right – waveforms from laser trials (red) and trials without laser (blue). Across 73 tagged neurons, waveform correlation coefficients for laser trials vs trials without laser was r = 0.97 (0.92-0.99), indicating that optogenetically triggered spikes were similar to non-optogenetically triggered spikes. D) MSN classification by waveform criteria for pharmacology sessions.

D2- and D1-MSN activity over a longer epoch from 10 seconds prior to trial start, when mice initiated trials at the back nosepoke, to the end of 18 seconds, after which making a second nosepoke led to reward. A) Tagged D2-MSN from Figure 2C shown over a longer interval, and B) tagged D1-MSN from Figure 2D shown over a longer interval. C) Peri-event time histograms from D2-MSNs and D) from D1-MSNs over a longer interval. E) We noticed that on average, D2-MSNs and D1-MSNs had the biggest differences in dynamics during the 6- second interval after trial start, where they tended to have distinct slopes (Fig 3C&D); slope analyses were less reliable for other epochs. Data from 32 tagged D2-MSNs in 4 D2-Cre mice and 41 tagged D1-MSNs in 5 D1-Cre mice as in Fig 2.

Effects in individual mice from optogenetic tagging experiments for A) PC1 and B) trial-by-trial GLM slope of firing rate over the interval; red = D2-MSN, and blue = D1-MSN. C) Effects in individual mice for PC1 for all neurons from combined pharmacology and neuronal ensemble recording; black is saline, red is D2 Blockade, and blue is D1 Blockade. Black lines indicate the median for each condition in each mouse. All statistics analyzing these data used linear-mixed effects models as incorporating a random effect for each mouse into the model allows to account for inherent between-mouse variability.

Trial-by-trial predictions of switch response time from D2-MSN and D1-MSN ensemble dynamics.

A) Exemplar integral of network activity x(t) = ∑ βjxj(t) generated from an ensemble of 13 D2-MSNs for a single animal on a single trial. The coefficients β! were computed from the logistic regression fit to the switch time tusing the neurons firing rates (xj(t))j as the predictor matrix (see Methods). On this trial, this integral drifted towards the response threshold 0.5, and logistic regression accurately predicted the switch response time. B) Exemplar integral network activity x(t) generated from an ensemble of 15 D1-MSNs in a single animal on a single trial. C) Across all D2-MSN and D1-MSN ensembles per individual mouse, we found that the trial-by-trial accuracy increased with ensemble size, exceeding >90% when D2-MSN and D1-MSN ensembles were >11 neurons. Neuronal data from 5 D1- Cre (blue dots) and 4 D2-Cre (red dots) mice in Figures 2-3. Corresponding light blue/light red dots show accuracy values computed in 100 simulations of respective D2-MSN/D1-MSN ensembles with Poisson spikes matched to MSN firing rates.

Fiber optic locations from A) an opsin-expressing mouse with mCherry-tagged halorhodopsin and bilateral fiber optics, and B) across 10 D2-Cre mice (red) and 6 D1-cre mice (blue) with fiber optics (targeting AP +0.9, ML +/-1.3, DV –2.5).

To control for heating and nonspecific effects of optogenetics, we conducted control experiments that with identical laser exposures except a virus without opsin was used. Experiments in D2-Cre mice injected with virus without opsins did not reliably affect A) cumulative density functions (CDFs) or B) switch response times (signed rank p = 0.44). Experiments in D1-Cre mice expressing virus without opsins did not reliably affect C) CDFs or D) switch response times (signed rank p = 0.81). Laser parameters (589 nm laser, 12 mW, 18 second duration) were identical to experimental animals in Fig 5.

DDM parameter exploration.

The relative error of simulated mean (μS) to the behavioral gamma-fit mean (μM), or Eμ = |(μSμM)/μM|, for A) D2-Cre mice with Laser Off and for B) D2-MSN inhibition. The absolute error of the DDM computed coefficient of variation CVS relative to the behavioral Gamma-fit CVM, or (E9: = |CVSCVM|), for C) D2-Cre mice with Laser Off and for D) D2-MSN inhibition. The relative error of simulated mean (μS) to the behavioral gamma-fit mean (μM), for E) D1-Cre mice with Laser Off and for F) D1-MSN inhibition. The absolute error of the DDM computed coefficient of variation CVS relative to the behavioral Gamma-fit CVM for G) D1-Cre mice with Laser Off and for H) D1-MSN inhibition. Black squares and triangles represent parameters D and σ for Fig 4.

Model details. Histograms of behavioral data from D2-Cre mice with A) Laser Off and B) D2-MSN inhibition (red). Data from D1-Cre mice with C) Laser Off and with D) D1- MSN inhibition (blue). E-H) model predictions. I-L) Comparisons of empirical data vs model. All panels: fits for the gamma distribution with dotted circles; see Table S2 for the parameter values defining each gamma distribution. Behavioral data: from 10 D2-Cre mice and 6 D1-mice from Fig 5A-D. Model data: from numerical simulations of the DDM model shown in Fig 4.

Optogenetically inhibiting D2-MSNs or D1-MSNs does not affect task-specific motor control.

We measured nosepoke duration (time of nosepoke entry to exit) on switch responses. During interval timing there was no effect of optogenetic inhibition (red) of dorsomedial striatal D2-MSNs on A-B) nosepoke duration or C) the traversal time between the first and second nosepokes; traversal time is distinct from the switch response, which is the moment animals depart the first nosepoke prior to arriving at the second nosepoke. There was also no effect of optogenetic inhibition (blue) of dorsomedial striatal D1-MSNs on nosepoke duration (D-E) or F) switch traversal time. Data from the same 10 D2-Cre mice and 6 D1-Cre mice, as in Fig 5. Horizontal black lines in B, C, E, and F represent group medians.

A) Standard deviation of switch response times for D2-MSN inhibition sessions (signed rank test, p = 0.19) and B) D1-MSN inhibition sessions (p = 0.84), and the number of total rewards for C) D2-MSN inhibition sessions (p = 0.07) and d) D1-MSN inhibition sessions (p = 0.25). Data from 10 D2-Cre mice and 6 D1-Cre mice as in Fig 5.

We analyzed MSN ensembles in sessions with saline (158 neurons), D2 blockade (167 neurons), or D1 blockade (144 neurons) – unlike Figure 6; all sessions were sorted independently and assumed to be fully statistically independent. A) Principal component analysis (PCA) identified MSN ensemble patterns of activity. The first principal component (PC1) exhibited time-dependent ramping. B) PC1 explained 55% of population variance among MSN ensembles. C) PC1 scores were shifted and significantly different with D2 or D1 blockade as when all sessions were sorted together in Fig 6. * = p < 0.05 via linear mixed effects models accounting for variance between mice; all analyses assumed statistical independence.