Cortical sculpting of a rhythmic motor program
Motor cortex is the principal driver of discrete, voluntary movements like reaching. Correspondingly, current theories describe muscle activity as a function of cortical dynamics. Tasks like speech and locomotion, however, require the integration of voluntary commands with ongoing movements orchestrated by largely independent subcortical centers. In such cases, motor cortex must receive inputs representing the state of the environment and of subcortical networks, then transform these inputs into commands that modulate the rhythmic motor pattern. Here, we study this transformation in mice performing an obstacle traversal task, which combines a spinal locomotor pattern with voluntary adjustments that are impaired following cortical lesions. Cortical dynamics contain a prominent representation of motor preparation that is linked to obstacle proximity and robust to removal of somatosensory or visual input, and also maintain a representation of the state of the spinal pattern generator. These dynamics are driven by thalamic inputs through a low-dimensional communication subspace, which amplifies the preparatory transient. Cortical readout signals resembling muscle-like commands for obstacle traversal are small in amplitude, yet consistent across trials. Using computational modeling, we identify a simple algorithm that generates the appropriate commands through phase-dependent gating. Together, these results reveal a regime in which motor cortex does not fully specify muscle activity, but must sculpt an ongoing, spinally-generated program to flexibly control behavior in a complex and changing environment.