Goal directed navigation on the Tree-Maze task a. Top view of the Tree-Maze layout and segmentation (indicated by upper and lower case letters) used for analyses (height = 1.4 m, width = 1.2 m). The LED cue panel was located at the end of the maze (flattened for illustration). Colored cue cards on the side of the maze indicate the two cue types by trial (Purple = Right-Cue [RC], Green = Left-Cue [LC]). Possible reward locations denoted by capital letters (Home = H, Decision = D, Goal = G1-G4). Lower case letters correspond to the segments shown on the right side of panel c. Reward wells highlighted in blue. b. Colored lines indicate example trajectories of a rat, 5 trials per panel. L Dec indicates a trajectory towards the left branch and R Dec indicates a trajectory towards the right branch. Left column (Left/Green cue), trajectories to G3 (top) and G4 (bottom) for reward. Both of these were correct navigational decisions and were rewarded. Right column (Right/Purple cue), trajectories to G2 (top) and G3 (bottom), only the top trajectories resulted in reward at a goal. c. Binary trajectory segmentation time window. At any given time-point, the subject can only be at one location in the maze (indicated by the white bins). Bottom axis indicates trial start times (seconds). Top axis indicates the trial number (tr), colored coded by cue. Left/Right axis indicates the identity of the segment, lower case letters on the right correspond to those in panel a. Blue and red dashed vertical lines indicate the end of a trial (blue = correct; red = incorrect). d. Task performance by subject. Each dot corresponds to a session by subject. For , dots indicates the subject mean. pse = performance in a session.

Spatial remapping was associated with the visual cue and correlated with task performance. a. Example session trajectories for all LC (Left-Cue) and RC (Right-Cue) trials. b. Four example single-units. For each example unit: Top row, left and middle, outbound trajectories separated by cue (red dots = spikes). Top-right, trial median activity by cue and maze segment (left, stem, right), numbers at the top indicate the Mann-Whitney Z transformed U statistic for the difference between the RC and LC trial distributions Uz. Bottom row, mean spatial rate maps by zone and cue, color coded for minimum (firing rate [FR] = 0, blue) and maximum (yellow) values. Bottom right, re-sampled distribution of correlations between RC and LC maps in blue for that unit, and in grey the corresponding null distribution. Remapping score is the mean remapping score for each unit. c. Distributions of UZ scores for all recorded units by maze segment. Purple means higher FR for RC than LC, Green means higher FR for LC than RC. Note the higher FR for RC on the left segment (far left) and higher FR for the LC on the right segment (far right). d. Distribution of mean remapping scores by unit, note the negative shift in the distribution of scores. e. Scatter-plot between the task performance on a given session pse and the cue remapping scores for recorded units in that session. Size and color of dots scale with the x axis for illustration. Regression line in red with a CI95% band. Kendall correlation score between behavior and remapping score shown. f. Scatter-plot between pse and the mean remapping score across units recorded in a given session . Size of dots indicate number of co-recorded units, color codes correspond to different subjects. Regression line and corresponding CI95% band shown in grey. g. Like (f) but with neural population correlation, composed of the spatial rate maps for all recorded units in a session. g. Correlation between pse and by subject, with bootstrapped standard deviation. is the across subject mean.

Cue modeling revealed rate remapping and trial-wise correlations to behavior. a. Linear zone encoding model with cue Z + C, at a given sample time t, the current position of the animal and the cue identity is multiplied by learned weights to predict FR for each recorded unit . b. Example time window of Z[t], the true FR in black V [t] and the predicted FR in red . c. Model comparison between three types of zone encoding: Z ⟶ only zones, Z + C ⟶ zones + cue, Z × C ⟶ a set of zones for each cue. Each dot is a unit, blue dots were negative R2, red scales with R2 and y-axis. d. Model comparison scores. Y-axis is the Mann-Whitney Z transformed statistic for comparing the R2 on test folds. Colorbar indicates the median difference in R2 across test folds. e. Performance of linear zone decoder models V (circles) and V +C (squares). Y-axis is the error distance in cm between the predicted and true zone, X-axis is the linearized Tree-Maze zones displayed as H (Home-well) to D (Decision-well) to i (second intersection/branching) to G (Goal-well). Linearization achieved through averaging the equivalent trajectories towards the goal. The hue shade provides groupings of sessions according to number of co-recorded units (both isolated an MUA included in these analyses). f. Performance of linear decision decoder by zone, with color indicating number of units. Note the sharp decision well split in the performance. BAC=balanced accuracy. g. Correlation between the subject’s performance and the model by zone. Color groupings as in (f.). Model performance is the comparison between the output of the decision decoder and the true identity of the cue, the same computation used to assess a subject’s performance.

Absence of reward leads to higher activity and spatial remapping. a. Example session RW (reward) and NRW (no-reward) trials. b. Four example units (i-iv). Top rows, inbound trials trajectories by RW/NRW (red dots = spikes). Top-right, trial median activity by RW and segment in the maze. Firing rate difference score Uz as described in the main text. Bottom rows, mean spatial rate maps by zone and RW, minimum FR=0. Bottom right, re-sampled distribution of correlations between RW and NRW maps in blue for that unit, and in grey the corresponding null distribution. Remapping score is the mean remapping score for each unit. b.i Session is the same as in panel a., other units from different sessions. c. Distributions of UZ scores for all recorded units by maze segment. Blues means higher FR for RW than NRW trials, Red higher NRN than RW. d. Distribution of mean remapping scores by unit, note the negative shift in the distribution of scores. e. Scatter-plot between a session’s task performance pse and the remapping scores for recorded units. Size and color of dots scale with the x axis for illustration. Regression line in red with a CI95% band. Kendall correlation score between behavior and remapping score shown. f. Scatter-plot between pse and the mean remapping score across a sessions units . Size of dots indicate number of co-recorded units, color codes correspond to different subjects. Regression line and corresponding CI95% band shown in grey. g. Like (f) but with neural population correlation, composed of the spatial rate maps for all recorded units in a session. h. Correlation between pse and by subject, with bootstrapped standard deviation. is the across subject mean.

Encoding model of reward remapping. a. Linear zone encoding model with reward Zi + R, at a given sample time t, the current position of the animal and the reward identity is multiplied by learned weights to predict FR for each recorded unit . b. Example time window of Z[t], the true FR in black V [t] and the predicted FR in red . c. Model comparison between three types of zone Encoding during inbound trajectories: Zi, Zi + R, Zi × R. Each dot is a unit, blue dots were negative R2, red scales with R2 and y-axis. d. Model comparison scores. Y-axis is the Mann-Whitney Z transformed statistic for comparing the R2 on test folds. Color-bar indicates the median difference in R2 across test folds.

Modeling navigational/spatial variables in neural coding during open-field foraging. a. Neural responses of four example units for subjects foraging an open-field (OF) arena [1.3m x 1.5m]. For each unit sub-panel (c0-c3): top-left, firing-rate map (number is the peak FR); top-right, head-direction tuning curve, color indicates FR magnitude by angle; bottom-left, speed tuning curve (s=speed); bottom-right, model-based variance explained on test data (R2) by variable (h=heading-direction, p=position, a=aggregate model). b. Model-based responses by variable for a selected test time-window for units c0-c3. Each row corresponds to a different model prediction , the true firing-rate (fr) for that unit, or at the top the color-coded time-window (t). Top-right, the data on which the model was trained is in grey and super-imposed is the test-window color-coded by time and with firing rate magnitude in increasing dot-size. Other heat-maps are the resulting firing-rate maps generated for the test trajectory. Model predicted rates are shown with colors matching a., with the background dotted line being the true (fr) a.. c. Population level (R2) for train (tr) and test (te) sets. d. Population level firing-rate map Pearson correlation rp between true m and predicted maps . Note that for both metrics, the aggregate model and the position model produced the best results. e. Relationship between coefficients on the aggregate model by unit. The color corresponds to the model’s training set R2.

Matched units across tasks reveal that head-direction coding units remap the strongest. a. Procedure for matching units across tasks (OF-open field, TM-tree maze). Top, 6 tetrode waveforms color-coded by matched units; bottom-left, fitted Gaussians to the dimensionally reduced unit waveforms for that tetrode across matched depth sessions (grey, unmatched units); bottom-right, symmetric confusion error matrix across units, threshold for matching PE <= 0.5. b. Venn diagram of matched units across tasks. c. UMAP clustering of the aggregate model coefficients for matched units. d. Head-direction (h) vs speed (s) coefficients formed a clustering subspace. e. Model coefficients of aggregate model used for finding clusters (p=position). Horizontal lines are the population mean, and error bars are the mean’s 95% CI. Statistics not performed, as the clusters were fitted from these parameters. f. Tuning metric scores (p=split-half rate-map correlation; s=speed-score; h=resultant-vector length score). Paired statistics through Mann-Whitney U tests (*=p < 0.05, **=p < 0.01, ***=p < 0.001, ****=p < 1e4) h. Remap scores by OF cluster. g. TM model scores by OF cluster.