Summary
Motor cortex controls skilled arm movement by sending temporal patterns of activity to lower motor centers1. Local cortical dynamics are thought to shape these patterns throughout movement execution2–4. External inputs have been implicated in setting the initial state of motor cortex5,6, but they may also have a pattern-generating role. Here, we dissect the contribution of local dynamics and inputs to cortical pattern generation during a prehension task in mice. Perturbing cortex to an aberrant state prevented movement initiation, but after the perturbation was released, cortex either bypassed the normal initial state and immediately generated the pattern that controls reaching, or it failed to generate this pattern. The difference in these two outcomes was likely due to external inputs. We directly investigated the role of inputs by inactivating thalamus; this perturbed cortical activity and disrupted limb kinematics at any stage of the movement. Activation of thalamocortical axon terminals at different frequencies disrupted cortical activity and arm movement in a graded manner. Simultaneous recordings revealed that both thalamic activity and the current state of cortex predicted changes in cortical activity. Thus, the pattern generator for dexterous arm movement is distributed across multiple, strongly-interacting brain regions.
Introduction
Reaching, grasping, and object manipulation play a central role in the lives of mammals with prehensile forelimbs. Motor cortex is a key brain hub involved in the control of skilled movements of the arm and hand. In primates and rodents, lesions of motor cortex can impair dexterity7–9, stimulation of cortical neurons evokes movements10–15, the activity of these neurons is closely linked to movement parameters1,16–25, and optogenetic perturbations have a range of effects on different forelimb behaviors14,22,26–28. Recent work has emphasized that the motor cortex is a dynamical system in which neural firing rates evolve over time based on the local dynamics imposed by the cortical architecture, as well as on external inputs from other areas, such as the thalamus and other cortical regions2,3 (Fig. 1a). The dynamical principles governing the cortical system, however, remain largely unknown.
Figure 1:
Motor cortex as a dynamical system controlling the arm. a, The dynamical systems model for motor cortical control of reaching (see Methods). b, Left: generation of firing rate patterns if motor cortex were driven by strong recurrent dynamics, h(r(t)), with external inputs, u(t), exerting a limited influence and not necessary for pattern generation. Right: generation of firing rate patterns if motor cortex were dependent on strong temporally-patterned external inputs, u(t). c, Experimental setup. Head-fixed mice reached for a pellet of food following an acoustic cue during recording and optogenetic perturbation of cortical activity. d, Raw video, electrophysiological recording, and mouse behavior on a single trial. Three-dimensional hand trajectories and the timing of each waypoint in the behavioral sequence were extracted from video using computer vision methods. e, Spike raster plots and peri-event time histograms for four example neurons recorded in d, centered on lift. Numbers indicate the maximum value of the y-axis, in spikes per second. f, Average z-scored firing rates and mean firing rates for all motor cortical neurons (n = 19 mice, n = 39 sessions, n = 843 neurons). During prehension, most neurons exhibited increases (39%) or decreases (37%) in spike counts around lift (two-sided rank sum test with Benjamini-Hochberg correction, q < .05). g, Distribution of lift times on control (yellow), laser + cue (blue), and laser-only (magenta) trials for VGAT-ChR2-EYFP mice (n = 5 animals, n = 7 sessions). h, Neural population activity from lift −100 ms to lift +425 ms on control (yellow) and post-laser (blue) reaches in VGAT-ChR2-EYFP mice, obtained using trial-averaged principal component analysis (n = 4 animals, n = 6 sessions, n = 144 neurons).
External inputs to motor cortex carry sensory information about the arm29, as well as signals from the cerebellum, basal ganglia, and higher cortical areas. Inputs are known to be important for movement preparation5,6,30–33 and sensory-based corrections29, but how do these inputs work together with local dynamics to produce motor cortical output during the execution of an unperturbed movement? One possibility is that once motor cortex has been set to the appropriate initial condition by external input, strong local dynamics generate the output during execution, while external inputs are weak; that is, the motor cortical dynamical system is largely autonomous from its inputs during movement4 (Fig. 1b, left). However, previous studies have shown movement-locked patterns in many brain areas providing input to motor cortex, coherence between motor cortex and these regions34,35, and disrupted cortical activity following cerebellar cooling36 or in animal models of Parkinson’s disease37. A second possibility is that external inputs are needed to maintain the motor cortical dynamics in a pattern-generating regime, but the precise temporal pattern of these inputs is not critical to producing the correct output pattern38. A third possibility is that local dynamics within motor cortex must receive a strong, time-varying input pattern in order to produce the appropriate output (Fig. 1b, right). While firing rates in thalamus are modulated on a kinematic timescale39–43, the hypothesis that this temporal modulation is required for the generation of time-varying output within cortex has not been tested directly. Here, we dissect the contribution of external inputs to cortical dynamics controlling this dexterous behavior by combining optogenetic perturbations of motor cortex and thalamus with high-density electrophysiology and movement tracking.
Results
Recovery from perturbed initial states
In order to study cortical dynamics during dexterous movement, we trained mice to perform a reach-to-grasp movement which we have previously shown to depend on motor cortex26 (Fig. 1c), and extracted arm kinematics and behavioral waypoints from high-speed video (Fig. 1d; video 1). Using silicon probes, we recorded from neural ensembles in contralateral forelimb motor cortex (Fig. 1d). While the responses of individual cells were highly consistent across trials, we observed a wide diversity of patterns across neurons, including increases, decreases, and multi-phasic responses (Fig. 1e–f). These patterns are consistent with previous findings in the primary motor cortex of nonhuman primates1,16,17 and rodents18–23 performing dexterous behaviors.
If motor cortex were largely autonomous during movement execution (Fig. 1b, left), then the initial pre-movement state of cortex, which is set by external inputs, should determine the subsequent evolution of activity during execution. Thus, in this model, if cortex were perturbed to an aberrant state, it would need to be reset to the appropriate initial condition by the external inputs before the initiation of movement, and this reset would likely increase the animal’s reaction time. In order to examine how cortex recovers from aberrant initial states, we performed three cell-type-specific manipulations of the cortical network by activating either inhibitory interneurons (VGAT-ChR2-EYFP mice), intratelencephalic neurons (Tlx3-Cre X Ai32), or pyramidal tract neurons (Sim1-Cre X Ai32). Each of these perturbations had a large effect on cortical activity (Extended Data Fig. 1a, b) and blocked the initiation of reaching (Fig. 1g; Extended Data Fig. 1c–d). Following the release of each motor cortical perturbation, we frequently observed kinematically normal post-laser reaches (Extended Data Fig. 1c–f). The reaches occurred with a shorter reaction time than on control trials following the VGAT and Tlx3 perturbations (Extended Data Fig. 1e), contrary to the predictions of the autonomous model, and they also occurred following laser stimulation in the absence of a cue (Fig. 1g; Extended Data Fig. 1c–e). In post-perturbation reaches, the neural population activity, estimated using dimensionality reduction, did not return to the initial state observed on control trials, but immediately generated patterns that largely recapitulated those observed on control trials (Fig. 1h; Extended Data Fig. 1g, 2; videos 2–3). Furthermore, it was possible to decode the post-laser hand trajectories using a decoder trained on control trials (Extended Data Fig. 3). This suggests that cortex does not need to return to a specific pre-movement state, as required by the autonomous model (Fig. 1b, left).
In the dynamical systems view, the contribution of local dynamics depends only on the current state of cortex. We observed that silencing motor cortex in VGAT-ChR2-EYFP mice fixes motor cortex to a constant state across trials (Extended Data Fig. 4a). Thus, unless the network is extremely sensitive to small differences in initial state44 (as in a chaotic system), trial-to-trial variability in neural activity following the release of the laser will reflect variability in external inputs. When we compared trials on which a post-laser reach occurred with trials with no reach (Fig. 2a), we found that the two trial types started in the same initial state, but rapidly diverged after the release of the laser (Fig. 2b–c; Extended Data Fig. 5c), suggesting a difference in external input between reach and no-reach trials (Fig. 2d). We estimated this difference in inputs by subtracting the firing rate derivatives of the two conditions (Fig. 2e; see Methods). The result of this experiment suggests that external input is critical to producing the correct reaching pattern.
Figure 2:
Divergence of neural trajectories from the same initial state. a, Average hand trajectory for trials with (blue) and without (red) post-laser reaches in VGAT-ChR2-EYFP mice (n = 4 animals, n = 6 sessions). b, Neural population activity aligned to the end of the laser for trials with (blue) and without (red) a post-laser reach (n = 128 neurons). Time limits are 250 ms before the end of the laser to 250 ms after the end of the laser. Black dot indicates baseline activity before the start of the trial. c, Spatial (left) and neural (right) distance to target, centered on the end of the laser, for trials with (blue) and without (red) post-laser reaches. d, Schematic illustrating that a divergence in neural trajectories from the same initial state implies a difference in external inputs. e, Estimated difference in external inputs between reach and no reach conditions (see Methods). The divergence of the traces shortly before the end of the laser is due to smoothing (Extended Data Fig. 5a–d).
Input is required for pattern generation
If the motor cortex requires external input throughout movement execution, then blocking or interrupting the input pattern should perturb both motor cortical activity and arm kinematics. In order to test this hypothesis directly, we implanted optical fibers above motor thalamus contralateral to the arm in VGAT-ChR2-EYFP mice. This enabled us to activate inhibitory terminals in this region, which has been shown to suppress activity in the projections to motor cortex31 (Fig. 3a). Thalamic inactivation at the start of the trial blocked the initiation of coordinated reaching (Fig. 3b), and inactivation in the middle of the reach interrupted the progression of the hand to the target (Fig. 3c, Extended Data Fig. 6). These results demonstrate that external inputs are required to control the hand throughout the entire movement.
Figure 3:
External inputs are required for the motor cortical pattern during reaching. a, Experimental schematic: placement of fibers over motor cortex and thalamus. b, Distribution of lift times on control (yellow) and thalamic inactivation (green) trials; n = 3 animals (VGAT-ChR2-EYFP), n = 7 sessions. Right inset shows the probability of a lift within the first 500 ms following the cue for control and thalamus inactivation trials. c, Hand position in the upper direction centered on lift on control trials (light yellow) and mid-reach thalamic inactivation trials (black; green indicates laser on) for a single dataset. Dots indicate the start of the laser. Data from all animals (n = 4 mice, n = 6 sessions) shown in Extended Data Fig. 6. d, Lift times for control trials (yellow), cortical inactivation (blue), and sequential inactivation of cortex and thalamus (green); n = 3 mice (VGAT-ChR2-EYFP), n = 4 sessions. e, Average firing rate Z-scores for all recorded neurons under inactivation of cortex alone (left) and sequential inactivation of cortex and thalamus (right); n = 3 mice, n = 4 sessions, n = 127 neurons. f, Population activity following the end of cortical inactivation for trials with cortical inactivation only (blue) and inactivation of thalamus after cortex (green). Plotting limits start 500 ms before the end of cortical inactivation and finish 500 ms after the cortical inactivation (blue trace) and 500 ms after the thalamic inactivation (green trace). The divergence of the trajectories shortly before the end of cortical inactivation is due to smoothing (Extended Data Fig. 5e–h), and inhibitory interneurons were excluded. g, Schematic illustrating that the divergence from the cortex-inactivated state reveals differences in input. h, Estimated difference in external inputs following the end of cortical inactivation between thalamus inactivated and not inactivated conditions.
In order to isolate the effect of inputs from local dynamics, we first set the motor cortical network - and thus the contribution of local dynamics - in the same initial state by silencing cortex in VGAT-ChR2-EYFP mice. Then, when we removed the motor cortical inactivation, we allowed the network to recover on some trials, but immediately silenced the thalamus on other trials. This thalamic inactivation blocked reaching following the removal of motor cortical suppression (Fig. 3d). Thalamic inactivation did not act by merely silencing motor cortical spiking; firing rates during this epoch fluctuated extensively (Fig. 3e; Extended Data Fig. 7c). The animal frequently reached to the target following the removal of thalamic inactivation (Fig. 3d; Extended Data Fig. 7a). These post-thalamic-inactivation reaches were generated by the same neural pattern that drove reaching on control trials and post-motor-cortical-inactivation trials (Extended Data Fig. 7b). Population activity with and without thalamic inactivation began in the same initial state, but rapidly diverged after the end of motor cortical suppression (Fig. 3f; Extended Data Fig. 5g; video 4). When thalamus was inactivated, the cortical trajectory exhibited a brief transient, then converged to a new fixed point, which could reflect the influence of local dynamics. Because the difference between the two trial types consisted of whether or not we silenced thalamus, the rapid divergence of the corresponding trajectories from the cortex-inactivated state was due to differences in external inputs, rather than extreme sensitivity to initial conditions (Fig. 3g). We estimated the difference in external inputs between the two conditions (see Methods), revealing a strong influence of inputs on the first principal component of neural activity (Fig. 3h).
Graded disruption of the input patterns
Our thalamic inactivation results show that inputs are necessary to produce the correct cortical output, but is a precise temporal pattern in these inputs required (Fig. 1b, right)? In order to address this question, we corrupted the input pattern by expressing ChR2 in thalamic neurons and stimulating thalamocortical terminals at frequencies of 4 Hz, 10 Hz, and 40 Hz while recording from motor cortex during reaching (Fig. 4a). Stimulation of the terminals entrained spiking activity in motor cortex (Extended Data Fig. 8a), but produced relatively small changes in mean postsynaptic firing rates (Extended Data Fig. 8b), compared to the changes induced by direct stimulation of cortical neurons (Extended Data Fig. 1b). Stimulation partially blocked the initiation of reaching, and the blocking effect was stimulus-frequency-dependent (Extended Data Fig. 8d; p = 6.7e-6, F = 18.0, one-way ANOVA). At 4 Hz stimulation, the animal was able to reach to the pellet, and the hand and neural trajectories largely recapitulated the control trajectories (Fig. 4b, Extended Data Fig. 8c, 9, video 5), though the hand was transiently perturbed at the pulse times (Extended data Fig. 9a). At 10 Hz, the animal often initiated a movement, but was usually unable to reach to the pellet, and in some cases, the limb oscillated at the stimulation frequency. At 40 Hz, the initiation and execution of reaching were severely impaired. The neural and hand trajectories were more different from the control trajectories at higher stimulation frequencies (p = .0040 and .0052, F = 8.2 and 7.6 respectively, one-way ANOVAs; Fig. 4c, left and center), and the magnitude of the difference was correlated for the neural and hand activity (Spearman’s ρ = 0.94, p = 1.7e-6; Fig. 4c, right). Thus, our data suggest that the temporal pattern of inputs directly influences cortical activity and hand kinematics.
Figure 4:
Modification of the temporal pattern of inputs perturbs cortical activity and movement. a, Experimental design. Mice expressing ChR2 in thalamic neurons performed the task during recording of cortical activity and optogenetic stimulation of thalamocortical terminals. b, Left: example average hand trajectory on control trials and stimulation trials with stimulation frequencies of 4, 10, and 40 Hz from a single experimental session. Data from all animals (n = 3 mice, n = 6 sessions) shown in Extended Data Fig. 9. Time limits are cue −250 ms to cue +1000 ms. Right: average neural activity (first two principal components) in the same session. Dots indicate the end of the trajectory at cue +1000 ms. c, Left: average Euclidean distance from the hand position in each stimulation condition to the control hand position at the same time point. Each curve shows a single experimental session (n = 3 animals; n = 6 sessions). Center: Euclidean distance from the neural state in the stimulated conditions to the neural state in the control condition. Right: distance from hand trajectory to control vs distance from the neural trajectory to control.
Thalamocortical coupling
We have shown that time-varying thalamic inputs are required for cortical pattern generation, but how strong is the contribution of these inputs relative to local dynamics? In order to address this question, we simultaneously recorded in motor cortex and in motor thalamus using a 384-channel Neuropixels probe45 and verified the targeting of thalamus with optogenetic tagging and histology (Extended Data Fig. 10a–c). Most thalamic neurons were modulated around movement onset (Extended Data Fig. 10d; increases in n = 73/98; decreases in n = 11/98), consistent with previous reports in both rodents39,42 and nonhuman primates40,41,43. Population activity in thalamus and cortex exhibited strong modulation in trial-averaged (Fig. 5b) and single-trial activity (Fig. 5c).
Figure 5:
Relationship between population activity in motor thalamus and motor cortex. a, Experimental setup. Spiking activity was simultaneously recorded in motor cortex with a four-shank, 64-channel probe and in thalamus with a 384-channel Neuropixels probe (n = 3 animals, n = 3 sessions). The thalamic region projecting to motor cortex was identified by optogenetic stimulation of thalamocortical terminals. b, Population trajectories for thalamus (left, green) and cortex (right, magenta) obtained with trial-averaged PCA. c, Single-trial population activity in thalamus (top) and cortex (middle), along with hand position (bottom). d, Goodness-of-fit of regression models (coefficient of determination, R2). The dependent variable was the derivative of the cortical population state for the first three principal components. The independent variable was either the cortical state (magenta), the thalamic state (green), or both (gray) for the first 1 … N principal components, where N was varied between 1 and 10. The top row shows the goodness-of-fit for trial-averaged data, and the bottom for single-trial data.
In the dynamical systems model, the derivative of the cortical state is a function of both external input and the current cortical state (Fig. 1a). Thus, we numerically differentiated the cortical population activity (single-trial or trial-averaged) and regressed it either on the cortical state, the thalamic state, or both. If local dynamics were strong during movement execution, then the model using the cortical state as the independent variable should provide a better fit. If, on the other hand, inputs were much stronger than local dynamics, then the model using thalamic state as the independent variable should provide a better fit. We found that the cortical derivative was predicted by both variables, with either thalamic state or cortical state providing a better fit, depending on the animal (Fig. 5d). This suggests that the cortical state does not evolve as a purely autoregressive process or simply integrate thalamic input; rather, both local dynamics and inputs contribute to generating the cortical pattern.
Discussion
Studies in nonhuman primates have emphasized the role of external inputs in setting up a specific initial state in motor cortex that allows the appropriate activity pattern to unfold during the execution of a movement4–6, though this state may be bypassed under certain conditions46. Under this view, the subsequent evolution of cortical activity may be strongly guided by autonomous dynamics, unless the cortex needs to correct for errors or perturbations4. After we optogenetically set cortex to aberrant initial states, it rapidly produced the appropriate pattern for reaching without returning to the initial state observed on control trials, provided the inputs were intact. This suggests that a specific initial state is not required for cortical pattern generation. Contrary to the predictions of the autonomous model (Fig. 1b, left), silencing or stimulating thalamus severely disrupted cortical pattern generation and arm movement. Thus, temporally-patterned inputs are critical for producing the cortical output pattern during movement execution (Fig. 1b, right).
Our data reveal experimental conditions in which the temporal pattern of external inputs drives the pattern in motor cortex, and in which this output pattern is required to skillfully control the arm and hand. These findings complement previous studies, which have suggested that dexterous behaviors that require precise coordination of the fingers and interaction with objects, such as grasping7–9,14,22,26, may be one class of cortically-dependent movement. The execution of other forelimb behaviors, such as locomotion14,47, pulling a grasped lever14, or timing a sequence of lever taps48, does not appear to require cortex. The source, modality, and function of inputs may also differ across species; it is possible, for instance, that long-range inputs from other cortical regions may be more important in primates, which have a highly differentiated cortical network for planning and executing reaching and grasping49. Species differences in sensorimotor delays50 and moment of inertia of limb segments, which are related to body size, could also affect the timescale on which peripheral inputs influence cortex.
We have shown that the cortical pattern controlling reaching can be produced only if temporally-patterned inputs are maintained throughout the entire movement. Thus, while motor cortex is a bottleneck for descending motor commands, its activity patterns during movement are crucially molded by its embedding within a vast and distributed network, which incorporates muscles, the sensory periphery, subcortical regions, and other cortical areas.
Methods
Dynamical systems model for motor cortical control of reaching
In this model2,3, depicted in figure 1a, the firing rates of motor cortical neurons, r(t), change as a result of two distinct influences. First, the local architecture intrinsic to motor cortex imposes a change, h(r(t)), based on the current firing rates. Second, brain regions outside motor cortex provide external input, u(t). This input is not identical to the firing rates of the neurons in upstream brain regions; rather, it represents the effect those upstream firing rates have on the firing rates of postsynaptic neurons in motor cortex. The firing rates evolve according to r’(t) = h(r(t)) + u(t). These firing rates control the muscle activation, m(t) = G(r(t)), through circuits in the lower motor centers, including the spinal cord. In turn, the muscles change the positions and velocities of the joint centers, x(t), through a function describing the musculoskeletal mechanics: x’(t) = F(m(t),x(t)). Delayed sensory feedback from the arm ascends into the brain and influences the external inputs u(t), closing the loop.
The additive interaction between inputs and local dynamics makes the model intuitive and tractable for estimating the difference in external input contributions across experimental conditions (Fig. 2e, 3h). However, it is likely that the network dynamics are nonlinear. That is, the evolution of cortical activity over time might be described by r’(t) = ϕ(r(t),u(t)), and thus local connectivity in motor cortex may amplify or distort simple changes in input, including changes in tonic drive. Modeling such complex, nonlinear interactions will require powerful new analysis tools, such as those that use deep learning to capture cortical dynamics51.
Behavioral task and video analysis
Mice of either sex aged 8–25 weeks were fitted with head posts, food restricted, and trained to reach for food pellets, as described previously26. All data in this manuscript, including those from the behavioral experiments, are previously unpublished. WaveSurfer (http://wavesurfer.janelia.org/) was used to control the behavioral stimuli. Video of the behavior was recorded at 500 Hz using BIAS software (IO Rodeo, available at https://bitbucket.org/iorodeo/bias) and two high-speed cameras (PointGrey, Flea3), which were calibrated to allow 3D triangulation of hand position (Caltech Camera Calibration Toolbox for Matlab, http://www.vision.caltech.edu/bouguetj/calib_doc/). Two types of information were extracted from video: ethograms labeling the frames in which lift, hand open, grab, supination, hand at mouth, and chew occurred, obtained using the Janelia Automatic Animal Behavior Annotator (https://github.com/kristinbranson/JAABA), and the position of the hand in space, obtained using the Animal Part Tracker (https://github.com/kristinbranson/APT). All procedures were approved by the Institutional Animal Care and Use Committee at Janelia Research Campus (protocols 13–99, 16–139, and 19–177).
Automatic behavior characterization
Using an adaptation of the Janelia Automatic Animal Behavior Annotator (JAABA), we trained automatic behavior classifiers which input information from the video frames and output predictions of the behavior category -- lift, hand-open, grab, supination, at-mouth, and chew. We adapted JAABA to use Histogram of Oriented Gradients52 and Histogram of Optical Flow53 features derived directly from the video frames, instead of features derived from animal trajectories. The automatic behavior predictions were post-processed as described previously26 to find the first lift-hand-open-grab and supination-at-mouth-chew sequences. For the mid-reach thalamic perturbation experiments (Fig. 3c, E6), we used the last lift detected before laser onset for aligning data. Tracking of hand position was performed using the Animal Part Tracker (APT) software package (https://github.com/kristinbranson/APT). Hand position was annotated manually for a set of training frames, and the cascaded pose regression54 algorithm was used to estimate the position of the hand in each remaining video frame. For the thalamus recordings and stimulation (Fig. 4, 5), APT was used with the DeepLabCut algorithm55, and lifts were detected using threshold crossings of the hand velocity.
Electrophysiological recordings in motor cortex
Neural recordings were performed using the Whisper acquisition system (Janelia Applied Physics and Instrumentation Group) and 64-channel silicon probes (NeuroNexus A4×16-Poly2–5mm-23s-200–177-A64 or Janelia 4×16 probes). These probes consisted of four shanks with 16 contacts at the tip of each, over a depth of 345 μm (NeuroNexus) or 320 μm (Janelia probes). The electrode contacts were coated with PEDOT to lower their impediance, and in some cases, the tip of the probe was sharpened to enable easier insertion. On the day before the experiment, a small craniotomy was made over motor cortex contralateral to the limb, and a stainless steel reference wire was implanted in visual cortex. During the recording session, the probe tips were positioned at approximately bregma +0.5 mm, 1.7 mm lateral, and slowly lowered to a depth of ~900 μm from the cortical surface, and a silicone elastomer (Kwik-Sil, World Precision Instruments) was applied to seal the craniotomy. At the end of the session, the probe was removed, and the craniotomy was re-sealed with silicone to allow a subsequent session on the following day. Signals were amplified with a gain of 200 and digitized to 16 bits at 25–50 kHz, and spike sorting was performed with JRClust (https://github.com/JaneliaSciComp/JRCLUST)56.
Optogenetic manipulations
Cell-type specific expression of ChR2 for cortical perturbations was achieved by either using VGAT-ChR2-EYFP mice57 expressing ChR2 in inhibitory neurons (Slc32a1-COP4*H134R/EYFP, The Jackson Laboratory), or by crossing a Cre driver line to a Cre-dependent ChR2 reporter mouse, Ai3258 (Rosa-CAG-LSL-ChR2(H134R)-EYFP-WPRE, The Jackson Laboratory). Experiments were performed in VGAT-ChR2-EYFP (n = 13), Tg(Tlx3-Cre)PL56Gsat X Ai32 (n = 3), Tg(Sim1-Cre)KJ18Gsat X Ai32 (n = 3), or Tg(Rbp4-Cre)KL100Gsat X Ai32 (n = 2) mice59. Rbp4-Cre X Ai32 mice were used for control trials only, as they provide poorer marking of pyramidal tract neurons than Sim1-Cre X Ai32. Experiments were attempted in three additional mice (VGAT-ChR2-EYFP, n = 2, and Tg(Sim1-Cre)KJ18Gsat X Ai32, n = 1), but were aborted due to the poor quality of the electrophysiological signals. An optical fiber (200 μm or 400 μm, NA 0.39, Thorlabs) was coupled to a 473 nm laser (LuxX 473–80, Omikron Laserage) and positioned 2–4 mm over motor cortex in the head fixation apparatus, as described previously26. Five VGAT-ChR2-EFYP mice were implanted with an optical fiber over motor thalamus (bregma −1.1 mm, lateral 1.3 mm, depth 3.3 mm). A blue light emitting diode array was directed at the animal’s eyes throughout the session in order to mask the laser stimulus. Three trial types were used: control trials, in which the cue was presented with no laser stimulation, laser + cue trials, in which both were presented, and laser-only trials, in which the laser was turned on without a cue or food administration. A two-second laser stimulus (40 Hz sine wave) was initiated synchronously with the cue for VGAT-ChR2-EYFP mice, or 200 ms before cue onset for Tlx3-Cre X Ai32 and Sim1-Cre X Ai32 mice. Laser power was calibrated to the minimum level necessary to block reaching in probe experiments in the final days of training; this ranged from 10–50 mW at the fiber tip for VGAT animals, and 0.5–6 mW for Tlx3 and Sim1 animals. In mid-reach interruption experiments, a region of the video frame between the average lift and hand open locations was identified using BIAS software, and a contrast change in this region was used to open the laser shutter for 2 s. All optogenetic perturbations were unilateral, on the side opposite the reaching arm. For mice with simultaneous recordings in motor cortex and thalamus (n = 3), ChR2 expression was driven in thalamus either by injecting a ChR2 reporter mouse Ai32 with AAV-2/9-Syn-Cre (n = 2), or by injecting a Vglut2-ires-Cre mouse (The Jackson Laboratory) with AAV5-EF1a-DIO-hChR2(H134R)-mCherry (n = 1). For mice with cortical recording during the stimulation of thalamocortical terminals (n = 3), we used Vglut2-ires-Cre mice (The Jackson Laboratory) with AAV5-EF1a-DIO-hChR2(H134R)-mCherry injected into motor thalamus, and stimulus trains consisting of 5 ms pulses at 4 Hz, 10 Hz, or 40 Hz for 2 s were initiated synchronously with the cue.
Simultaneous electrophysiological recordings in motor cortex and thalamus
Mice expressing ChR2 in motor thalamus were head-fixed and trained on the reaching task. On the day before recording, craniotomies were performed to allow access to motor cortex (bregma +0.5 mm, 1.7 mm lateral) and thalamus (bregma −2.3 mm, 1.3 mm lateral), and were sealed with silicone elastomer (Kwik-Sil). On the day of recording, a four-shank, 64-channel silicon probe was inserted vertically into motor cortex at a depth of 800 μm, and a 960-site, 384-channel Neuropixels probe45 (Option 3A) was inserted with a caudal tilt of 23 degrees from vertical to target thalamus. Once the thalamic probe was in position at ~4.6 mm from the surface, a pulse train of 473 nm light (40 Hz, 5 ms pulses, 2–12 mW) was applied through a fiber-coupled laser positioned over motor cortex. This pulse train stimulated thalamic terminals in motor cortex, and enabled identification of a region of the Neuropixels probe positioned in a thalamic region projecting to motor cortex (Fig. E10a). The position of the Neuropixels probe was further verified by examining the probe track in a histological section (Fig. E10b). The behavioral task was run as in the cortical recording experiments. Spike sorting was performed with Kilosort260 (https://github.com/MouseLand/Kilosort2) and the Phy GUI (https://github.com/kwikteam/phy). Hand position was tracked with APT using the DeepLabCut algorithm55, and stereo calibration was performed as described above. Lift times were defined as the time points at which the upward velocity of the hand exceeded 75 mm/s.
Data analysis
Peri-lift firing rates (Fig. 1f, E10d)
For each neuron, lift-centered spike trains were smoothed with a Gaussian kernel (σ = 50 ms) and averaged across trials, and Z-scored. Lift modulation was assessed using a rank sum test comparing the raw spike counts in a 500 ms window centered at lift +200 ms with counts in a 500 ms window centered at lift −750 ms. Multiple comparisons were corrected using the Benjamini-Hochberg false discovery rate framework (q < 0.05), and all statistical tests in the study were two-sided.
Trial-averaged principal component analysis (Fig. 1h, 2b, 3f, 4b, 5b, E1g E2, E5, E7b, E9c
Peri-lift firing rates were extracted by smoothing the spike trains with a Gaussian kernel (σ = 25 ms for Fig. 2b, 3f, σ = 100 ms in Fig. 4b and E9c, and σ = 50 ms in the other analyses), Z-scored, and averaged within each trial type for each neuron. The window used was −100 ms to 425 ms around each lift (Fig. 1h, E1g), −100 ms to 350 ms around lift (Fig. 5b, E7b), −250 ms to +250 ms from the end of cortical inactivation (Fig. 2b), −500 ms to +500 ms of the end of the cortical inactivation (Fig. 3f, blue), or −500 ms from the start of cortical inactivation to +500 ms from the end of the thalamic inactivation (Fig. 3f, green). Interneurons that increased their firing during cortical silencing were excluded in Fig. 2b and 3f, and one session in which no post-laser reaches occurred was excluded in Fig. 2. Principal component coefficients were fit using control trials only for lift-centered analyses (Fig. 1h, E1g), or cortex inactivation only (Fig. 3f), and scores were then extracted for all trial types. For the lift-aligned PCA analyses, a control trial was included if lift and grab occurred within 500 ms following the cue, and a laser trial was included if lift and grab occurred within 500 ms of the end of the laser. We excluded one VGAT dataset and one Sim1 dataset from this analysis, as they had only 0 and 1 post-laser trial meeting this criterion, respectively. In order to examine the time of the divergence of neural trajectories from the cortex-inactivated state, we also smoothed the laser-aligned data with causal filters that used spikes only from the past (Fig. E5). This resulted in trajectories that were causal, but not differentiable (as required by the analyses in Fig. 2e and 3h), so we used Gaussian smoothing for all other analyses.
Single-trial principal component analysis (Fig. 5c, E8c)
Spike trains were smoothed with a Gaussian kernel (σ = 100 ms) and z-scored using the baseline mean and standard deviation, and principal components were extracted from trial-averaged, lift-aligned data. Z-scores from individual trials were then projected onto these components to obtain single-trial population activity (Fig. 5c; Fig. E8c, lower two rows). Trial-averaged data in Fig. 4b (right) and E9c were obtained by averaging these single-trial estimates.
Gaussian Process Factor Analysis (GPFA) and neural distance (Fig. 2c, videos 2, 3)
Neural population activity was reduced to a five-dimensional latent variable space using GPFA61 (bin size 20 ms). A region of the dataset in which the recordings were stable was selected by finding the time interval and subset of neurons that maximized the quantity (usable neurons) X (usable seconds). The target spatial and neural states were defined using the three-dimensional position of the hand, and the five-dimensional latent variable representation of motor cortical activity obtained using GPFA, respectively. In both cases, the states were sampled at grab times, and the target state was defined to be the central location of the grab-triggered states, computed using convex hull peeling. Only 50% of the control trials were used to calculate the target states. The euclidean distance from the target was then computed for each trial and time point, and the resulting distance curves were centered on the end of the laser (Fig. 2c).
Estimation of difference in external input contributions (Fig. 2e, 3h)
We used the dynamical systems model, r’(t) = h(r(t)) + u(t), to calculate the difference in the contribution of external inputs between conditions following the end of cortical inactivation. Suppose we have two types of trial, A and B. In Fig. 2e, these types correspond to trials in which a post-laser reach occurred or did not occur, and in Fig. 3h, they correspond to trials in which thalamus was perturbed following the end of cortical inactivation and trials in which the thalamus was not perturbed. Let rA(t) and rB(t) denote the population activity (principal component scores) on these trial types, and suppose the cortical inactivation ends at t = 0.
For t ≤ 0, we have fixed rA(t) = rB(t) = 0. Let ε > 0. According to the dynamical systems model,
Thus, for small ε,
Thus, subtracting the derivative of population activity for the two conditions allows us to estimate the difference in the contributions of external inputs shortly after the end of cortical inactivation. This approximation relies on two assumptions. First, the firing rate derivative is additive in the autonomous and input-dependent contributions. Second, ε is small; that is, h(r(0)) = h(0) must be close to h(r(ε)).
Direction of neural trajectories (Fig. E2)
This analysis addresses the question of whether neural activity for post-laser reaches first returned to the control baseline state. For each perturbation (VGAT, Tlx3, and Sim1), we estimated the population activity on control reaches, rc(t), and post-laser reaches, rl(t), using the first six principal component scores. These captured 98%, 99%, and 97% of the variance in control reaches for VGAT, Tlx3, and Sim1, respectively. At each point in time around the lift, we computed the derivative and divided by the norm of the derivative. This yielded the direction in population activity for control and laser reaches (see Fig. E2a), shown for the first two principal components by the yellow and blue arrows in Fig. E2b–d. We compared the similarity between the control and laser directions at each point in time by computing the inner product between them. This yielded the yellow curves in the right panels in E2a–d. We then computed the difference between the population activity in the laser condition and the initial control state and normalized it to have length one; this resulted in the direction from the state in the laser condition to the initial control state at each point in time, shown by the red arrows in the left panels of Fig. E2b–d. We then found the similarity between this direction and the direction of the laser trajectory by computing their inner product, shown in the red curves in the right panels of Fig. E2b–d. This analysis suggests that following the perturbations, the neural population recapitulated the pattern for reaching without returning to the control initial state.
Neural decoding (Fig. E3)
A linear filter was designed to decode 3D hand velocities from neural activity during reaches. The decoded hand velocities were then used as proxies for the components of neural activity relevant to movement in order to assess the effect of different types of pre-lift perturbations (VGAT, Tlx3, Sim1) on the neural activity during reach.
For decoding, both the 3D hand trajectories (500 Hz, see ‘Behavioral task and video analysis’) and the multiunit neural activity (counts of all detected spikes on each recording channel with 2 ms bins, no single unit identification) were smoothed with the same Gaussian kernel (σ = 25 ms). Velocities were numerically derived from smoothed hand trajectories using a central difference filter of order 8. Firing rates were Z-scored with respect to the activity at rest, computed combining 1.5s windows preceding the start of each trial. Channels with mean absolute Z-scores greater than 100 during movement (e.g. for units with standard deviations very close to zero) were excluded from further analysis. The Z-scores of neural activity were then processed with Principal Component Analysis (PCA) for denoising and dimensionality reduction, with the Principal Components computed from the lift-aligned trial-averaged activity in control trials (window −100ms to 300ms around lift). The decoding results with this method were better than with any alternative choices we tried (Fig. E3m–n), which included: (a) computing the PCA components from the data matrix obtained concatenating all lift-aligned control and post-laser neural trajectories (after end of perturbation) rather than from trial-averaged control activity, (b) using only identified single-unit activity instead of multiunit activity, (c) using GPFA instead of PCA for dimensionality reduction, (d) smoothing the firing rates with different Gaussian kernels (ranging from σ = 2ms to σ = 500ms) before Z-scoring and dimensionality reduction.
The decoder uses time-invariant coefficients to decode the hand velocity at any given time as a linear combination of the 15 most recent samples of PCA-reduced neural activity (hence up to 28ms in the past). The decoder coefficients were obtained by regressing (ordinary least square sense, implemented via QR factorization in Matlab) velocity data against PCA-reduced neural data in a subset of trials (training set). Hand velocities were decoded during reaches in which the lift-to-grab sequence occurred within the first 500 ms after the cue (for control trials) or within the first 500 ms after the end of perturbation (for laser trials). Sessions without post-perturbation reaches satisfying these criteria (1 Vgat, 1 Sim1 session) or with only one such reach (1 Sim1 session) were excluded from the neural decoding analysis. The decoding window was extended by 50ms before lift and 50ms after grab, to include the beginning and the end of the reaching movement. Within each dataset, the training set used in fitting the decoder coefficients was comprised of a majority of control trials (3/5th). An additional subset of control trials (1/5th) was used to cross-validate the optimal choice of the number of PCA components to use in the decoder, as follows. For any choice of number of components to keep, a decoder was computed from the training control trials and used to decode the hand velocities in the validation control trials. The performance of each decoder was compared in terms of mean squared error (MSE) between observed and decoded velocities. The minimum number of PCA dimensions that guaranteed performance within 1% of the overall minimum MSE across all choices was selected (using this 1% margin guaranteed significant dimensionality reduction in some sessions without compromising decoding performance). Finally, the selected decoder was used to decode hand velocities in the remaining testing subset of control trials (1/5th), which were not used for training or cross-validation, and on the laser trials in which reaches occurred at the end of the perturbation.
We found that the decoder performance was not uniform across the three directions (forward, lateral, upward), but was consistently worse in the lateral direction than in the other two directions. This may reflect the smaller extent to which the reaching trajectories sample lateral movements of the hand, or may reflect an insufficient sampling of the neural population of motor cortical cells responsible for the lateral movement of the hand. We thus showed the decoding performance in each direction separately, and primarily used the coefficient of determination (R2) between decoded and observed hand velocities in each direction as the summary performance metric, except for the comparisons of decoding quality across trial types (Fig. E3c, g, and k) and choices of the decoder (Fig. E3m–n) in which all directions were pooled together before computing the coefficient of determination. In most of the datasets, the velocity decoding accuracy was higher for control testing trials than laser trials. Nevertheless, in most sessions the decoder trained only on control trials still performed reasonably well on laser trials (at least in some of the directions).
Analysis of simultaneous recordings from thalamus and cortex (Fig. 5)
For analysis of trial-averaged cortical and thalamic firing rates, and for the identification of lift-modulated thalamic units, analyses were performed as described above for the cortical recording experiments (Fig. 5b, E10d). For single-trial analysis of population activity, lift-aligned thalamic and cortical spiking was smoothed with a σ = 100 ms Gaussian kernel and Z-scored using the baseline firing rates from lift −500 ms to lift −100 ms. Activity was first averaged across trials, and principal component analysis was performed on the trial-averaged data matrix to obtain the principal component coefficients. Next, activity from individual trials was multiplied by this coefficient matrix, resulting in estimates of the single-trial population trajectories for cortex and thalamus (Fig. 5c).
According to the dynamical systems model, the derivative of the cortical state can be expressed as r’(t) = h(r(t)) + u(t). In the linear case, this corresponds to r’(t) = A*r(t) + B*s(t), where s(t) is the thalamic state. Because we measured cortical and thalamic activity simultaneously, we attempted to fit models of this form by regression. The cortical population trajectories (either the single-trial or trial-averaged estimates) for the first three principal components were numerically differentiated. We took these estimates of the derivative of the cortical state as the dependent variables for regression analyses using three different sets of independent variables: (1) thalamic population trajectories (first N principal components, with N ranging from 1 to 10), (2) cortical population trajectories (first N components), and (3) both thalamic and cortical population trajectories (first N components). These regression models were fit with ordinary least squares for both the trial-averaged (Fig. 5d, top row) and single-trial data (Fig. 5d, bottom row), with the goodness-of-fit of each model given by the coefficient of determination (R2 value).
All analyses were performed with custom-written software in Matlab, except where otherwise noted.
Extended Data
Extended data figure 1:
Summary of effects of optogenetic perturbations of motor cortex. Each of the three columns shows data from one mouse type: VGAT-ChR2-EYFP (n = 5 animals, n = 7 sessions, left column), Tlx3-Cre X Ai32 (n = 3 animals, n = 7 sessions, center column), and Sim1-Cre X Ai32 (n = 3 animals, n = 5 sessions, right column). a, Average z-scored firing rates of motor cortical neurons before, during and after optogenetic activation of inhibitory interneurons (left; VGAT-ChR2-EYFP mice), intratelencephalic neurons (center; Tlx3-Cre X Ai32 mice), and pyramidal tract neurons (right; Sim1-Cre X Ai32 mice). The blue bars under the x-axes represent laser-on epochs. In the left panel, the black bands at the bottom are putative inhibitory interneurons. b, Firing rates before and during laser stimulation for each mouse type. Firing rates less outside the range of 0.1 to 100 were plotted at these values, due to the log-log scale. c, Distribution of lift times on control (yellow), laser + cue (blue), and laser-only (magenta) trials for each mouse type. The histograms show data only for trials where a lift occurred. d, Probability of a lift in each time bin (binomial maximum likelihood estimate) for control (yellow), laser-only (magenta), and laser + cue (blue) trials. Error bars show 95% binomial confidence intervals. e, Distribution of lift times for trials in which a lift occurred within 500 ms of either the cue (for control trials, yellow), or following the end of the laser (for laser + cue trials, blue, and laser only trials, magenta). f, Average hand trajectories on control (yellow) and post-laser (blue) reaches. g, Neural population activity from lift −100 ms to lift +425 ms on control (yellow) and post-laser (blue) reaches, obtained using trial-averaged principal component analysis. For f and g, one session was removed for VGAT (n = 4 animals, n = 6 sessions), and one was removed for Sim1 (n = 2 animals, n = 4 sessions), due to the absence of post-laser reaches for alignment.
Extended data figure 2:
Comparison of the direction of neural trajectories for post-laser reaches with the direction of control trajectories, and with the direction to the initial cortical state on control trials. a, Explanation of the analysis method. We represent the population trajectory on control trials, rc(t), and laser trials, rl(t), using the first six principal component scores, which account for 98%, 99%, and 97% of the variance on control trials for VGAT, Tlx3, and Sim1, respectively. For each time point along the peri-lift neural trajectory rl(t) for post-laser reaches, we obtain the direction of the neural trajectory by computing the derivative and dividing by the norm of the derivative (blue). We perform the same calculation for the control trajectory rc(t) (yellow), and also compute the direction from the neural state in the laser trajectory to the initial control state (red). We then compare the direction of the laser trajectory with the control direction and the direction to the initial control state by taking the inner product with each. b, Left: neural population trajectories (first two principal components) for control (yellow) and post-laser (blue) reaches in VGAT-ChR2-EYFP mice (n = 4 mice, n = 6 sessions). The direction of the trajectories for control (yellow arrows) and laser (blue arrows) trajectories along the first two principal components are shown, along with the direction from the laser trajectory to the control initial state (red arrows). Right: similarity (inner product) between the direction of the laser trajectory and the direction of the control trajectory (yellow curve), and similarity between the direction of the laser trajectory and the control initial state (red curve). c, As in b, but for Tlx3-Cre X Ai32 mice (n = 3 mice, n = 7 sessions). d, As in b, but for Sim1-Cre X Ai32 mice (n = 2 mice, n = 4 sessions).
Extended data figure 3:
Decoding of hand velocity from motor cortical activity on control and post-perturbation reaches. a, Left: scatterplots of decoded vs observed hand velocity in the forward, right, and upward directions on control reaches in an example session from a VGAT-ChR2-EYFP mouse. Only testing trials not used for training the decoder were used. Right: R2 values for the regression of observed on decoded velocities for control reaches in each VGAT-ChR2-EYFP dataset (n = 4 mice; n = 6 sessions). b, Left: scatterplots of decoded vs observed hand velocity for post-laser reaches in the dataset from a. Right: R2 values for the regression of observed on decoded velocities for post-laser reaches in each VGAT-ChR2-EYFP dataset. c, Comparison of the decoder performance in control vs post-laser reaches for the dataset from a-b, assessed using the R2 computed after pooling across directions. d, Decoded position trajectories obtained by upsampling and numerically integrating (Simpson’s rule) the decoded velocity for control trials (left) and laser trials (right) for the dataset in a-b. e-h, Decoder performance for Tlx3-Cre X Ai32 mice (n=3 mice; n=7 sessions), organized as a-d. i-l, Decoder performance for Sim1-Cre X Ai32 mice (n=2 mice; n=3 sessions), organized as a-d. m, Decoding performance for control testing trials on all sessions, by decoding method used (n=9 mice; n=16 sessions; all perturbation types aggregated). For each method, the number of neural dimensions used for decoding was cross-validated (see Methods). Boxplot shows the median and the 25th and 75th percentiles. n, Decoding performance for PCA, with coefficients extracted on lift-aligned trial averages, by the standard deviation of the Gaussian kernel used to extract firing rates (n=9 mice; n=16 sessions).
Extended data figure 4:
Variability of firing rates during optogenetic perturbations to the cortical state. a, Standard deviation of firing rates across trials during laser stimulation in VGAT-ChR2-EYFP mice. The black curve is the standard deviation (over trials), averaged over all neurons (n = 5 animals, n = 7 sessions, n = 155 neurons). Error bars show standard error of the mean. Identified inhibitory neurons, which exhibited a firing rate increase during the laser, were excluded. Smoothing was applied with a 50 ms Gaussian kernel for each trial. b, Standard deviation of firing rates across trials during laser stimulation in Tlx3-Cre X Ai32 mice, as in a (n = 3 animals, n = 7 sessions, n = 100 neurons). c, Standard deviation of firing rates across trials during laser stimulation in Sim1-Cre X Ai32 mice (n = 3 animals, n = 5 sessions, n = 115 neurons). Because it wasn’t possible to identify inhibitory neurons when excitatory neurons were stimulated, all cells were included in b and c.
Extended data figure 5:
Effect of different spike train smoothing methods. a, Gaussian smoothing with a kernel width of σ = 25 ms for the reach / no reach experiment, as shown in Fig. 2b. Note that the activity appears to change from the constant perturbed state slightly before the end of the laser. This is because the kernel smooths forward into the post-laser epoch. b, Gaussian smoothing with σ = 50 ms. The divergence from the perturbed state begins earlier, due to a higher level of smoothing. c, Causal smoothing with a half-Gaussian kernel, truncated to use samples only from the past. Neural activity diverges from the perturbed state only after the end of the laser. d, Acausal smoothing with a half-Gaussian kernel, truncated to use samples only from the future. e, Gaussian smoothing in the sequential inactivation experiment with a kernel width of σ = 25 ms, as shown in Fig. 3f. Note that the activity appears to change from the constant perturbed state slightly before the end of the cortical inactivation. There is also a delay from the the start of the cortical inactivation to the arrival of the neural state at the constant value. f, Gaussian smoothing with σ = 50 ms. g, Causal smoothing with a half-Gaussian kernel, truncated to use samples only from the past. Neural activity diverges from the perturbed state only after the end of the laser. However, there is still a lag from the start of cortical inactivation to the arrival of neural activity at the constant perturbed state. h, Acausal smoothing with a half-Gaussian kernel, truncated to use samples only from the future. Neural activity again diverges from the perturbed state before the end of the cortical inactivation. At the start of the cortical inactivation, neural activity has already arrived at the perturbed state.
Extended data figure 6:
Effect of mid-reach thalamic perturbation on hand trajectory in VGAT-ChR2-EYFP mice (c.f. Fig. 3c; n = 4 animals, n = 6 sessions). a, Average difference in hand elevation between mid-reach perturbation trials and control trials for each dataset. The example dataset shown in Fig. 3c is marked with the blue arrow. b, P-values from two-sided rank sum tests at each time point comparing the upward hand position on control and mid-reach thalamic inactivation trials.
Extended data figure 7:
Sequential inactivation of cortex and thalamus (c.f. Fig. 3d–f). a, Fraction of trials with lifts in each epoch for control trials (yellow), cortical inactivation only (blue), and sequential inactivation of cortex and thalamus (green) (n = 3 animals, n = 4 sessions). The cortical inactivation ends at 2000 ms from trial start, and the thalamic inactivation ends at 4000 ms. Bars show maximum likelihood estimates of the binomial probability, with 95% confidence intervals. b, Lift-locked neural population activity from lift −100ms to lift +350 ms for control (yellow), post-cortex-inactivation (blue), and post-sequential-inactivation reaches (green), obtained using trial-averaged principal component analysis; n = 3 animals, n = 4 sessions, n = 127 neurons. Circles indicate lift −100 ms, lift, and grab times. c, Firing rates and spike rasters for an example cortical neuron on control trials (yellow), cortical inactivation (blue), and sequential inactivation of cortex and thalamus (green).
Extended data figure 8:
Effects of stimulation of thalamocortical terminals on cortical firing rates and behavior (c.f. Fig. 4). a, Firing rates and spike rasters for two example neurons at each stimulation frequency. b, Firing rates in the 2 s before stimulation vs the 2 s during stimulation at each stimulation frequency. Each point is a single neuron (n = 288 cells). c, Left: single-trial hand position and neural activity (first two principal components) for control trials in the dataset shown in Fig. 4b. Right: Hand position and neural activity in the same session under optogenetic stimulation of thalamocortical terminals at 4 Hz, 10 Hz, and 40 Hz. d, Probability that a lift is initiated within the first 500 ms of the cue on control trials and at each stimulation frequency. Each curve shows a single session (n = 6 sessions, n = 3 mice).
Extended data figure 9:
Hand kinematics and neural activity during thalamocortical stimulation for each dataset (c.f. Fig. 4; n = 3 mice, n = 6 sessions). a, Trial-averaged hand position aligned to the cue under 4 Hz, 10 Hz, and 40 Hz stimulation. The control position is shown in gray. Vertical lines indicate the times of laser pulses. Each row corresponds to a single experimental session. b, Hand trajectories for control and laser trials for each dataset in a. Time limits are cue −250 ms to cue +1000 ms, and the dot marks the end of the trajectory. c, Neural trajectories for each dataset in a.
Extended data figure 10:
Simultaneous recording in thalamus and motor cortex. a, Raw data from the thalamic Neuropixels probe aligned to motor cortex stimulation (cyan). A band of channels (red dotted line) exhibited activity locked to motor cortical stimulation, indicating projections to motor cortex. b, Histological section showing targeting of probe to motor thalamus. The bright region in the thalamus indicates ChR2 expression (EYFP) in an Ai32 mouse with an injection of AAV-2/9-Syn-Cre. The Neuropixels probe in the thalamus was coated with a green dye (DiO). The red dotted line corresponds approximately to the red dotted line in a. c, Spike rasters from cortical and thalamic neurons on a single reaching trial. d, Peri-lift firing rates for thalamic neurons (n = 3 mice, n = 3 sessions).
Supplementary Material
Acknowledgements
We thank Byron Yu and the Yu Lab, Steve Edgley, Joshua Dudman, Albert Lee, Misha Ahrens, Arseny Finkelstein, James Fitzgerald, and Kevin Shan for discussions and comments on an earlier version of the manuscript; Allen Lee for tracking software; Tim Harris, Brian Barbarits, Bill Karsh, Steve Sawtelle, Peter Polidoro, Dan Flickinger, and the Neuropixels Project for instrumentation development and support; Wade Sun for probe sharpening and PEDOT application; Adam Taylor for development of WaveSurfer; James Jun and Marius Pachitariu for spike sorting software; Sammie Chung for assistance with video labeling; Salvatore DiLiso for fiber implantation surgeries; Kim Ritola and the Janelia Virus Tools facility for providing viruses; Julia Kuhl for the mouse drawings; and the Janelia Vivarium, Histology, and Scientific Computing facilities for support.
Footnotes
Financial interest statement
The authors declare that they have no competing financial interests.
Code and data availability
Code for automatic annotation of behavior and behavioral waypoint estimation is available at https://github.com/kristinbranson/JAABA. Code for hand tracking is available at https://github.com/kristinbranson/APT. Code for spike sorting is available at https://github.com/JaneliaSciComp/JRCLUST, https://github.com/MouseLand/Kilosort2, and https://github.com/kwikteam/phy. Data and code are available from the corresponding author on reasonable request.
References
- 1.Porter R & Lemon R Corticospinal Function and Voluntary Movement. (Oxford University Press, 1995). [Google Scholar]
- 2.Churchland MM et al. Neural population dynamics during reaching. Nature 487, 51–56 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Shenoy KV, Sahani M & Churchland MM Cortical control of arm movements: a dynamical systems perspective. Annu. Rev. Neurosci 36, 337–359 (2013). [DOI] [PubMed] [Google Scholar]
- 4.Pandarinath C, Ames KC & Russo AA Latent factors and dynamics in motor cortex and their application to brain–machine interfaces. J. Neurosci (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Kaufman MT, Churchland MM, Ryu SI & Shenoy KV Cortical activity in the null space: permitting preparation without movement. Nat. Neurosci 17, 440–448 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Afshar A et al. Single-trial neural correlates of arm movement preparation. Neuron 71, 555–564 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Lawrence DG & Kuypers HG The functional organization of the motor system in the monkey. I. The effects of bilateral pyramidal lesions. Brain 91, 1–14 (1968). [DOI] [PubMed] [Google Scholar]
- 8.Whishaw IQ, Pellis SM, Gorny B, Kolb B & Tetzlaff W Proximal and distal impairments in rat forelimb use in reaching follow unilateral pyramidal tract lesions. Behav. Brain Res 56, 59–76 (1993). [DOI] [PubMed] [Google Scholar]
- 9.Whishaw IQ Loss of the innate cortical engram for action patterns used in skilled reaching and the development of behavioral compensation following motor cortex lesions in the rat. Neuropharmacology 39, 788–805 (2000). [DOI] [PubMed] [Google Scholar]
- 10.Grünbaum ASF & Sherrington CS Observations on the physiology of the cerebral cortex of some of the higher apes.(Preliminary communication.). Proc. R. Soc. Lond 69, 206–209 (1902). [Google Scholar]
- 11.Penfield W & Boldrey E Somatic motor and sensory representation in the cerebral cortex of man as studied by electrical stimulation. Brain 60, 389–443 (1937). [Google Scholar]
- 12.Graziano MSA, Taylor CSR & Moore T Complex movements evoked by microstimulation of precentral cortex. Neuron 34, 841–851 (2002). [DOI] [PubMed] [Google Scholar]
- 13.Harrison TC, Ayling OGS & Murphy TH Distinct cortical circuit mechanisms for complex forelimb movement and motor map topography. Neuron 74, 397–409 (2012). [DOI] [PubMed] [Google Scholar]
- 14.Miri A et al. Behaviorally Selective Engagement of Short-Latency Effector Pathways by Motor Cortex. Neuron 95, 683–696.e11 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Brown AR & Teskey GC Motor cortex is functionally organized as a set of spatially distinct representations for complex movements. J. Neurosci 34, 13574–13585 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Evarts EV Pyramidal tract activity associated with a conditioned hand movement in the monkey. J. Neurophysiol 29, 1011–1027 (1966). [DOI] [PubMed] [Google Scholar]
- 17.Scott SH The role of primary motor cortex in goal-directed movements: insights from neurophysiological studies on non-human primates. Curr. Opin. Neurobiol 13, 671–677 (2003). [DOI] [PubMed] [Google Scholar]
- 18.Lemke SM, Ramanathan DS, Guo L, Won SJ & Ganguly K Emergent modular neural control drives coordinated motor actions. Nat. Neurosci (2019). doi: 10.1038/s41593-019-0407-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Hyland B Neural activity related to reaching and grasping in rostral and caudal regions of rat motor cortex. Behav. Brain Res 94, 255–269 (1998). [DOI] [PubMed] [Google Scholar]
- 20.Wagner MJ et al. Shared Cortex-Cerebellum Dynamics in the Execution and Learning of a Motor Task. Cell 177, 669–682.e24 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21.Wang X et al. Deconstruction of Corticospinal Circuits for Goal-Directed Motor Skills. Cell 171, 440–455.e14 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Galiñanes GL, Bonardi C & Huber D Directional Reaching for Water as a Cortex-Dependent Behavioral Framework for Mice. Cell Rep. 22, 2767–2783 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23.Isomura Y, Harukuni R, Takekawa T, Aizawa H & Fukai T Microcircuitry coordination of cortical motor information in self-initiation of voluntary movements. Nat. Neurosci 12, 1586–1593 (2009). [DOI] [PubMed] [Google Scholar]
- 24.Georgopoulos AP, Kalaska JF, Caminiti R & Massey JT On the relations between the direction of two-dimensional arm movements and cell discharge in primate motor cortex. J. Neurosci 2, 1527–1537 (1982). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Kakei S, Hoffman DS & Strick PL Muscle and movement representations in the primary motor cortex. Science 285, 2136–2139 (1999). [DOI] [PubMed] [Google Scholar]
- 26.Guo J-Z et al. Cortex commands the performance of skilled movement. Elife 4, e10774 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Otchy TM et al. Acute off-target effects of neural circuit manipulations. Nature 528, 358–363 (2015). [DOI] [PubMed] [Google Scholar]
- 28.Bollu T, Whitehead SC, Prasad N & Walker JR Motor cortical inactivation reduces the gain of kinematic primitives in mice performing a hold-still center-out reach task. BioRxiv (2018). [Google Scholar]
- 29.Scott SH Optimal feedback control and the neural basis of volitional motor control. Nat. Rev. Neurosci 5, 532–546 (2004). [DOI] [PubMed] [Google Scholar]
- 30.Churchland MM, Yu BM, Ryu SI, Santhanam G & Shenoy KV Neural variability in premotor cortex provides a signature of motor preparation. J. Neurosci 26, 3697–3712 (2006). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 31.Guo ZV et al. Maintenance of persistent activity in a frontal thalamocortical loop. Nature 545, 181–186 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 32.Li N, Daie K, Svoboda K & Druckmann S Robust neuronal dynamics in premotor cortex during motor planning. Nature 532, 459–464 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 33.Gao Z et al. A cortico-cerebellar loop for motor planning. Nature 563, 113–116 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 34.Soteropoulos DS & Baker SN Cortico-cerebellar coherence during a precision grip task in the monkey. J. Neurophysiol 95, 1194–1206 (2006). [DOI] [PubMed] [Google Scholar]
- 35.Murthy VN & Fetz EE Coherent 25- to 35-Hz oscillations in the sensorimotor cortex of awake behaving monkeys. Proceedings of the National Academy of Sciences 89, 5670–5674 (1992). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 36.Meyer-Lohmann J, Conrad B, Matsunami K & Brooks VB Effects of dentate cooling on precentral unit activity following torque pulse injections into elbow movements. Brain Research 94, 237–251 (1975). [DOI] [PubMed] [Google Scholar]
- 37.Costa RM et al. Rapid alterations in corticostriatal ensemble coordination during acute dopamine-dependent motor dysfunction. Neuron 52, 359–369 (2006). [DOI] [PubMed] [Google Scholar]
- 38.Yuste R, MacLean JN, Smith J & Lansner A The cortex as a central pattern generator. Nat. Rev. Neurosci 6, 477–483 (2005). [DOI] [PubMed] [Google Scholar]
- 39.Bosch-Bouju C, Smither RA, Hyland BI & Parr-Brownlie LC Reduced reach-related modulation of motor thalamus neural activity in a rat model of Parkinson’s disease. J. Neurosci 34, 15836–15850 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 40.Strick PL Activity of ventrolateral thalamic neurons during arm movement. J. Neurophysiol 39, 1032–1044 (1976). [DOI] [PubMed] [Google Scholar]
- 41.Horne MK & Porter R The discharges during movement of cells in the ventrolateral thalamus of the conscious monkey. J. Physiol 304, 349–372 (1980). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 42.Gaidica M, Hurst A, Cyr C & Leventhal DK Distinct Populations of Motor Thalamic Neurons Encode Action Initiation, Action Selection, and Movement Vigor. J. Neurosci 38, 6563–6573 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 43.Van Donkelaar P, Stein JF, Passingham RE & Miall RC Neuronal activity in the primate motor thalamus during visually triggered and internally generated limb movements. J. Neurophysiol 82, 934–945 (1999). [DOI] [PubMed] [Google Scholar]
- 44.Russo AA et al. Motor Cortex Embeds Muscle-like Commands in an Untangled Population Response. Neuron 97, 953–966.e8 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 45.Jun JJ et al. Fully integrated silicon probes for high-density recording of neural activity. Nature 551, 232–236 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 46.Ames KC, Cora Ames K, Ryu SI & Shenoy KV Neural Dynamics of Reaching following Incorrect or Absent Motor Preparation. Neuron 81, 438–451 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 47.Orlovsky GN, Deliagina TG, Grillner S Neuronal control of locomotion: from mollusc to man. (Oxford University Press, 1999). [Google Scholar]
- 48.Kawai R et al. Motor cortex is required for learning but not for executing a motor skill. Neuron 86, 800–812 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 49.Schaffelhofer S & Scherberger H Object vision to hand action in macaque parietal, premotor, and motor cortices. Elife 5, (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 50.More HL & Donelan JM Scaling of sensorimotor delays in terrestrial mammals. Proc. Biol. Sci 285, (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 51.Pandarinath C et al. Inferring single-trial neural population dynamics using sequential auto-encoders. Nature Methods 15, 805–815 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 52.Dalal N & Triggs B Histograms of oriented gradients for human detection. in international Conference on computer vision & Pattern Recognition (CVPR’05) 1, 886–893 (IEEE Computer Society, 2005). [Google Scholar]
- 53.Laptev I, Marszałek M, Schmid C & Rozenfeld B Learning realistic human actions from movies. in CVPR 2008-IEEE Conference on Computer Vision & Pattern Recognition 1–8 (IEEE Computer Society, 2008). [Google Scholar]
- 54.Dollár P, Welinder P & Perona P Cascaded pose regression. in 2010 IEEE Computer Society Conference on Computer Vision and Pattern Recognition 1078–1085 (ieeexplore.ieee.org, 2010). [Google Scholar]
- 55.Mathis A et al. DeepLabCut: markerless pose estimation of user-defined body parts with deep learning. Nat. Neurosci 21, 1281–1289 (2018). [DOI] [PubMed] [Google Scholar]
- 56.Jun JJ et al. Real-time spike sorting platform for high-density extracellular probes with ground-truth validation and drift correction. doi: 10.1101/101030 [DOI] [Google Scholar]
- 57.Guo ZV et al. Flow of cortical activity underlying a tactile decision in mice. Neuron 81, 179–194 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 58.Madisen L et al. A toolbox of Cre-dependent optogenetic transgenic mice for light-induced activation and silencing. Nat. Neurosci 15, 793–802 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 59.Gerfen CR, Paletzki R & Heintz N GENSAT BAC cre-recombinase driver lines to study the functional organization of cerebral cortical and basal ganglia circuits. Neuron 80, 1368–1383 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 60.Stringer C et al. Spontaneous behaviors drive multidimensional, brainwide activity. Science 364, 255 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 61.Yu BM et al. Gaussian-Process Factor Analysis for Low-Dimensional Single-Trial Analysis of Neural Population Activity. Journal of Neurophysiology 102, 614–635 (2009). [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.















