Mice learn to perform a two-alternative forced choice task in a freely moving triangular arena.

A. Left: Schematic of triangular arena. Right: stimuli were frequency modulated sweeps.

B. Time schematic of task events. The two periods of movement are highlighted.

C. Video tracking extracted variables of a single trial. Note that events correspond to B.

D. Left: Psychophysical performance of an example session of an animal. Middle: Thin traces are 5 example days pre (orange) and post (black) electrode implant for an example animal. Thicker traces are averages of pre and post-performance. Right: Thin traces are individual animal averages (n=6) of the 32 recording sessions included in this study. Thicker trace is group average.

E. Average reaction time as a function of stimulus deltaFreq. Black line is the linear fit.

F. Probability of correct response as a function of reaction time. Traces are grouped per absolute deltaFreq (left and right responses are grouped). Probability of correct responses is computed in reaction time bins of 75ms.

G. Instantaneous angular speed (radial axis) of turning per stimulus condition. 90° represents the animals’ position during waiting.

H. Mean angular speed per stimulus identity for correct (colored circles) and incorrect (gray circles) trials. Trendlines were drawn following a simple linear regression. Legend shows correlation coefficient and statistical significance.

I. Instantaneous displacement speed across the length of the trajectory for left and right stimuli.

J. Mean average speed per stimulus for correct (colored circles) and incorrect (gray circles) trials. Trendlines were drawn following a simple linear regression. Legend shows correlation coefficient and statistical significance.

Electrophysiological recordings were obtained from the EPN.

A. Microwire bundles were implanted onto the entopeduncular nucleus. Right pane shows a schematic of electrode placement (n=6).

B. Left: Photomicrograph of electrode cannula track. Right: Close up of individual microwire electrodes.

C. Peak to valley duration of plotted against inter-spike interval coefficient of variation for recorded spikes. Insets: average waveform for four example units.

D. Example recorded unit aligned to events identified in Figure 1 B: return, wait, turn (0°,75°,150°), evaluation, averaged according to stimulus presented. First row is rescaled average for correct trials. Second row is average of incorrect trials. Third row is false alarm trials: trials where animals did not wait long enough for the stimulus to appear but that performed the entire movement sequence either to the right or left lick ports.

E. Same as D for another example unit.

F. Population response for correct left and right responses.

G. Upper: Average z-score segregated by left and right, for correct, incorrect, and false alarm trials. Lower: Average z-score per stimulus for correct trials.

H. Average speed (upper) and angular velocity (lower) for trials segregated as in the upper pane of G.

I. Mean population activity per epoch segregated by movement, turning, and rReward. Wilcoxon sStatistical test used was Wilcoxon.

Stimulus, difficulty, reward and temporal population dynamics during Go trajectories.

A. Instantaneous variance associated with trials segregated by left-right, correct/incorrect, and stimuli identity.

B. Principal Components and demixed Principal Components sorted by explained variance. Note that the difficulty dPCA does not appear within the 10 first components. Statistically significant PCs (n=5) were signaled by a bigger dot.

C-G. First five dPCs sorted by variance are shown: Temporal (condition-independent), reward, and side. Note that for traces in C-E there is a near perfect overlap of all conditions (n=16). Weights for each individual dPCs are shown to the right. Lettered circles on top are individual units’ weights shown on Figure 3-1. G.

H. Population self-similarity across time. Cosine similarity was calculated for population vectors on the de-meaned (temporal dynamics removed) population activity (see Methods).

I. Population vector similarity across time for two time points: t=0.2s and t=1.8, which correspond to the moments of peak side and reward variance, respectively.

Example units. a-h.

Example units are shown corresponding to lettered circles on weight plots in Figure 3.

Stimulus presence, irrespective of identity, and angular velocity best explain EPN activity around turning epoch.

A. Example unit aligned to stimulus (left) and turn (right), segregated by left and right, correct, incorrect and false alarm trials. First row is raster plots. Middle row is average firing rate. Lower row is average angular velocity. Note that left column does not contain false alarm trials since there is no stimulus to align to.

B. Similar to A for another unit.

C. Models fit to data. Four hypotheses were tested. First row is the presence of stimulus (without identity). Second row is difficulty (absolute value of deltaFreq). Third row is stimulus interpretation (incorrectly performed trials show opposite interpretation to the correctly performed counterparts). Fourth row shows angular velocity.

D. deltaR2 calculated for each of the models (see Methods and main text). Statistical differences are shown with red lines, p<0.05, Wilcoxon test.

Kinematic and spatio-temporal coding during Return and Go trajectories.

A-C show three example units. Raster plots show activity for return (left) and Go (right) trajectories sorted by trajectory duration (black circle). They were then grouped into six traces, and average firing rate is presented below. Also, the average speed of the animals locomotion is presented below. Simple linear regression for four different variables presented on the right panels, for Return (orange) and Go (green) trajectories separately.

D. Average tenfold cross-validated R2 for multiple regression models fit on data from the entire trial duration (return, wait, go, and evaluation periods) for kinematic, spatio-temporal and reward related variables, as well as full model fit on all these variables (n=118 units). Red line represents a statistically significant difference (p<0.01, Wilcoxon signed-rank test).

E. Average tenfold cross-validated R2 for models for multiple regression models fit separately on Return (orange) and Go (green) trajectory data. Red line represents a statistically significant difference (p<0.01, Wilcoxon signed-rank test).

F. Mean cvR2 for single variable models. Shading corresponds to kinematic (gray) and spatio-temporal (pink) variables. Reward related variables are unshaded. Models were fit with Return (orange), Go (green) and entire trial duration (gray) data.

G. Trained models for Return and Go periods in E were tested using Return and Go data. Individual models for kinematic, spatio-temporal and a mixed kinematic and spatio-temporal model were tested. Note all models tested on data not used for training were significantly lower than when using training data (p<0.01, Wilcoxon signed-rank test).

H. Upper: Partial correlation coefficient (r) was calculated for the distance to goal variable by fitting residuals of model on kinematic variables (excluding spatio-temporal variables). This was done separately for Return (x-axis) and Go (y-axis) data. Dashed line corresponds to the identity line (x=y). Lower: Pie chart summarizing data above. Brown: Units with statistically significant correlations with the distance to goal variable in Go and Return periods. Green: units with statistically significant correlation only during the Go period. Orange: units with statistically significant correlation only during the Return period. Outer pie summarizes the sign of the correlations where gray and salmon represent negative and positive correlations respectively, in both Return and Go periods. Black represents units that switch signs in Return and Go periods.

I. Upper: Partial correlation coefficient of residuals of a model with all spatio-temporal and kinematic variables except angular velocity, separately for Return and Go trajectories. Lower: similar to H.

J. Upper: Partial correlation coefficient of residuals of a model with all spatio-temporal and kinematic variables except body speed, separately for Return and Go trajectories. Lower: similar to H.

K. Venn diagrams of percentage of total units with a significant partial correlation coefficient for the variables distance to goal, angular velocity and body speed for Return and Go trajectories.

L. Dimensionality reduction performed on the regression coefficients on a model fitted Return and Go data using kinematic and spatiotemporal variables. Red and blue dots represent statistically significant difference between rewarded and unrewarded trials in a 250ms window after head entry into the lick port. Red dots represent reward positive units (rewarded trials with higher firing rate that unrewarded ones, auROC>0.5, p<0.01 permutation test) and blue ones represent reward negative units (rewarded triales with lower firing rate, auROC<0.5, p<0.01 permutation test).

M. Mean cross-validated R2 of models fit on kinematic, spatio-temporal and both types of variables, segregated by reward coding of units (segregated as described in L). Red lines indicate statistically significant difference (Mann-Whitney U test, p<0.01).

N. Mean cross-validated R2 of kinematic, spatio-temporal, and mixed models. Data was segregated according to trial type: correct, incorrect, and false alarm.

Variables used to fit models.

A. Single trial variables used to fit models in Figure 4.

B. Correlation coefficient calculated between pairs of variables.

Return and Go trajectories population dynamics.

A. Highly similar trajectories were found for Return and Go periods based on body speed and angular velocity (see Methods). Average body speed and angular velocity are plotted for the four conditions found.

B. Population trajectories corresponding to the four conditions shows in A projected onto three PCs.

C. Cosine similarity of the four conditions based on kinematic parameters (body speed and angular velocity) and population activity.

D. Context dPC with most explained variance. Histogram of weights is presented on the right.

E. Correlation coefficient between the extracted population dynamics in D and several variables calculated for the same periods.

F. Distance from Waiting corner calculated for the four conditions.

G. Context dPC with second most explained variance. Histogram of weights is presented on the right.

H. Correlation coefficient between the extracted population dynamics in G and several variables calculated for the same periods.

I. Velocity from Waiting corner calculated for the four conditions.

demixed Principal components for Return and Go trajectories, continued

Projections of population activity onto the first three PCs with most explained variance for the four conditions in 5A, and separately for right trajectories in A and left trajectories in B.

C. Principal Components and demixed Principal Components sorted by explained variance. Statistical significance of PCs (n=6) is indicated by bigger dots.

D-G. temporal (condition-independent) dPCs and Side in D. are presented with their weight histogram and the correlation of these components with individual kinematic and spatio-temporal variables.

Gait cycle modulation of units.

A. Longitudinal position of four paws of a mouse during a return, wait and go periods. Inset shows body position in time. Colored triangles show identified events for unit alignment.

B. Activity of two simultaneously recorded example units in the eight strides studied. Lower row shows average paw position corresponding to the trials shown above.

C. Population activity during the four strides.

D. Spike gait-phase average vector for all significantly modulated units during eight strides.

E. Upper: Fraction of modulated units (with a significant directionality Rayleigh test p<0.001). Middle: Mean phase of population vector. Lower: Mean population vector magnitude.

F. Variance explained by PCA decomposition of data shown in C. Inset shows first four PCs’ weight distribution.

G. Upper: mean absolute correlation coefficient for kinematic and spatio-termporal variables for the first four PCs.

H. Population projection of data in C onto PC1, PC2 and PC4 for the four Return strides (in orange tones) and the Go strides (in green tones).

I. Left: PC4 population projection for the eight strides studied plotted on top of contralateral hindpaw velocity. Right: correlation coefficient with individual kinematic and spatio-temporal variables. Filled circles represent a statistically significant correlation (permutation testing).

J. Population Support Vector Classifiers were trained for different variables (x-axis). Accuracy was assessed for the classifier trained on the original labeled population vectors (in blue) and for vectors trained on shuffled labels (in orange). *=p<0.001, permutation testing. Note that paw velocity could not be decoded from the original matrix but could be decoded from the PC4 weighted matrix.

Licking behavior modulation of units.

A. Infrared sensor based lickometer.

B. Licks of aligned to port entry for left (red) and right (blue) correct trials.

C. Example unit activity aligned to the same port entries as in B.

D. Upper: Three simultaneously recorded example units’ (blue, orange and green) activity rescaled to average lick bout duration. Lick rate is shown in gray. Lower: Histogram of Pearson correlation coefficient between firing rate and lick rate for all units. Black bars represent significantly correlated units (p<0.001, permutation test).

E. Example unit shown in C aligned to single left (red) and right (blue) licks. Upper inset shows the probability occurrence as well as the lick cycle phase derived from the lick probability. Right inset shows the spike lick-phase polar histogram for same unit. Black line represents resulting vector with statistically significant directionality (Rayleigh test, p<0.001).

F. Polar histogram (bin= 30°) of average vector phase direction. Polar axis is percentage of units.

G. Average single lick activity for all recorded units sorted by peak activity. Upper inset: average lick probability.

H. Venn diagram showing percentage of units of the total population (n=118) of units with statistically significant correlation with lick rate (Pearson correlation coefficient, p<0.001, permutation test) and/or with single licks (Rayleigh directionality test, p<0.001).

I. Single lick average activity segregated by first and last lick, 5 interspersed licks, and incorrect lick for left and right licks for the same unit shown in C and E.

J. Population activity for n=118 units for 7 right licks sorted by lick with most activity. Lower: fraction of variance explained by PCA decomposition PCA weight for first 3 components.

K. Projection of lick population activity for the 16 licks considered onto first 3 PCs.

L. Population vector decoders for different variables with original labels (blue) compared to population vector decoders with shuffled labels (n=1000). *p<0.001, permutation test