Skip to main content
eLife logoLink to eLife
. 2024 Mar 28;12:RP89356. doi: 10.7554/eLife.89356

Task-anchored grid cell firing is selectively associated with successful path integration-dependent behaviour

Harry Clark 1, Matthew F Nolan 1,
Editors: Lisa M Giocomo2, Laura L Colgin3
PMCID: PMC10977970  PMID: 38546203

Abstract

Grid firing fields have been proposed as a neural substrate for spatial localisation in general or for path integration in particular. To distinguish these possibilities, we investigate firing of grid and non-grid cells in the mouse medial entorhinal cortex during a location memory task. We find that grid firing can either be anchored to the task environment, or can encode distance travelled independently of the task reference frame. Anchoring varied between and within sessions, while spatial firing of non-grid cells was either coherent with the grid population, or was stably anchored to the task environment. We took advantage of the variability in task-anchoring to evaluate whether and when encoding of location by grid cells might contribute to behaviour. We find that when reward location is indicated by a visual cue, performance is similar regardless of whether grid cells are task-anchored or not, arguing against a role for grid representations when location cues are available. By contrast, in the absence of the visual cue, performance was enhanced when grid cells were anchored to the task environment. Our results suggest that anchoring of grid cells to task reference frames selectively enhances performance when path integration is required.

Research organism: Mouse

Introduction

The ability to generate and manipulate internal representations of the sensory world is fundamental to cognitive functions of the brain. Grid representations generated by neurons in the medial entorhinal cortex (MEC) are thought to be critical for spatial behaviours and other cognitive functions that require structured representations (Moser et al., 2008; Whittington et al., 2022). However, the range of behaviours to which grid cells contribute is unclear (Ginosar et al., 2023). On the one hand, theoretical arguments that grid cell populations can generate high capacity codes imply that they could in principle contribute to all spatial behaviours (Fiete et al., 2008; Mathis et al., 2012; Sreenivasan and Fiete, 2011). On the other hand, if the behavioural importance of grid cells follows from their hypothesised ability to generate position representations by integrating self-motion signals (McNaughton et al., 2006), then their behavioural roles may be restricted to tasks that involve path integration strategies.

Experiments that have manipulated circuits containing grid cells support the idea that they contribute to spatial behaviours. Lesions of the MEC disrupt place representations in the hippocampus and impair performance in spatial memory tasks (Brun et al., 2008; Hales et al., 2021; Hales et al., 2018; Hales et al., 2014; Miao et al., 2015; Schlesiger et al., 2015; Steffenach et al., 2005). These impairments are often incomplete in that hippocampal place representations remain, although they are less stable, and some spatial tasks can still be solved. More selective genetic manipulations support similar conclusions. Deletion during postnatal development of NMDA receptors from neurons in the MEC and nearby structures reduces the number of detected grid cells in these areas while having less effect on other spatial cell types (Gil et al., 2018). This manipulation impairs path integration without affecting other spatial behaviours (Gil et al., 2018). In contrast, targeted inactivation of stellate cells in layer 2 of the MEC, which are thought to be a major grid cell population (Gu et al., 2018; Rowland et al., 2018), impairs learning of both path integration-dependent behaviours and cue-based navigation more generally (Qin et al., 2018; Tennant et al., 2018). However, for all of these manipulations it is difficult to establish whether impairments result from deficits in grid firing per se, or from other alterations in the circuit and its potential for plasticity. It is also unclear whether functions that in these experiments appear resistant to perturbations of the MEC could have been restored by adaptive compensatory changes.

These challenges are common to efforts to test hypothesised functional roles for neural codes using perturbation strategies. A complementary approach is to take advantage of variability in the expression of behaviours and candidate neural representations. Thus, hypothesised functions for neural codes can be corroborated by correlations with behavioural outcomes, while dissociations between representations and behaviour may rule out hypothesised roles for a given code. In the case of grid codes, the idea that they provide a general-purpose spatial code predicts that they are always available and are stably anchored to the external environment (Figure 1A). This notion is challenged by observations that in circular track environments, grid firing patterns are maintained but are no longer anchored to the environment (Jacob et al., 2019). In this case, the grid representations are informative about distance travelled but not about absolute position (Figure 1B). Spatial representations within populations of MEC neurons that include grid cells can also be unstable with the network spontaneously remapping between different representations of location (Low et al., 2021). Thus, it appears that grid representations are not necessarily stably anchored to the external world, but it is unclear whether this instability impacts performance of spatial tasks. Here, we asked whether similar instability of grid activity manifests in a goal-directed task, and if so whether it can dissociate proposed behavioural roles for grid firing patterns.

Figure 1. Models for grid representation and experiment design.

(A–B) Predicted task-anchored (A) and task-independent (B) firing of grid cells in a 1D environment (right) given firing patterns of grid cells previously observed in square (A) and circular (B) 2D arenas (left). T1-T4 indicate consecutive trials in the 1D environment, AVG indicates expected average across many trials. (C) Neurons were recorded in an open arena and then in a location memory task. Trials were configured with a reward for stopping in a visually cued zone (beaconed), or a reward for stopping in the same zone but with the cue absent (non-beaconed), or without the visual cue or the reward (probe). Trial percentages indicate the proportion of trial types experienced in a single session; in any given session this proportion was fixed and trials were interleaved in a fixed repeating pattern (see Materials and methods). (D) In the task-anchored coding scheme, a grid cell fires with field spacing λ and resets its firing every trial by anchoring its fields to the same track location, with a realignment lag R observed in the spatial autocorrelogram. Fields locations remain constant on each trial and thus peaks in the periodogram occur at integer spatial frequencies relative to the track repetition (see Figure 1—figure supplement 3). (E) In a task-independent coding scheme, a grid cell fires with field spacing λ and continues to fire at regular intervals without anchoring to the track. Unless field spacing and the track length are integer divisible, the location of fields varies across trials, and thus the peak of the periodogram is not constrained to an integer spatial frequency (see Figure 1—figure supplement 3).

Figure 1.

Figure 1—figure supplement 1. Procedure for extracting a session-level periodogram from a set of spike timestamps.

Figure 1—figure supplement 1.

A single cell’s spikes were binned in space (1 cm bin size), divided by the time spent in each bin then smoothed using a Gaussian kernel (SD = 2 cm). Least squares spectral analysis (LSSA) was computed on a signal equivalent to three track lengths using the Lomb-Scargle implementation in the Astropy Python module (Δx=distance elapsed in trials, Δy=firing rate)(Price-Whelan et al., 2022). The signal was advanced 10 cm and repeated for the whole session. All individual periodograms generated were then used to generate the average periodogram.

Figure 1—figure supplement 2. Procedure for estimating a false alarm threshold for a given cell.

Figure 1—figure supplement 2.

To generate shuffled datasets a cell’s spikes were first binned in space (1 cm bin size), divided by the time spent in each bin then smoothed using a Gaussian kernel (SD = 4 cm). Firing fields were detected and the original field bins reallocated to random locations on a new unsmoothed rate map. Bins not attributed to a field were allocated to the remaining gaps in the new map. The unsmoothed shuffled rate map was then smoothed with a Gaussian kernel (SD = 2 cm). An average periodogram was calculated and peak power detected. This was repeated 1000 times. The false alarm threshold was set equal to the 99th percentile of the peak power of periodograms generated from the shuffled dataset.

Figure 1—figure supplement 3. Identification of task-anchored and task-independent periodic firing.

Figure 1—figure supplement 3.

Examples of least squares spectral analysis (LSSA) used to estimate the sinusoidal components that best describe the firing rate profile of a task-anchored grid code (upper) and a task-independent code (lower). In each plot the schematised firing fields (solid colours) are shown as a function of track position. Each row shows examples of different sinusoidal components (f=frequency, p=period) at different phases. LSSA minimises the chi-squared error by searching over all phases (three example phases are shown in red, green, and blue per row) and amplitudes (amplitude is ignored here for simplicity) for each spatial frequency. For task-anchored grid representations, the chi-squared error (min χ2) is minimal at positive-integer spatial frequencies that correspond to sinusoidal waves with periods that are integer divisible by the track length. For task-independent grid representations the chi-squared error is minimal at a spatial frequency that corresponds to the underlying periodic firing rate profile. The standard normalised periodogram is created by normalising the chi-squared errors of the periodic model around a non-varying reference model. The resulting power is a dimensionless quantity that lies within the range 0–1.

Figure 1—figure supplement 4. Expected spatial periodicity for different functional cell types.

Figure 1—figure supplement 4.

Plots show simulations of track firing for (i) a task-anchored grid cell, (ii) a task-independent grid cell, (iii) a task-anchored grid cell with field jitter, (iv) a task-independent grid cell with field jitter, (v) a place cell, (vi) a ramp-like cell, (vii) a cell with randomly positioned fields, and (viii) a cell with Gaussian noise-like activity. Each group of panels shows firing rate heat map by trial (upper left) and corresponding average firing rate (lower left), rolling periodogram (upper centre) and corresponding average periodogram (lower centre), the true and predicted trial classification (upper right). The predicted trial classification is established using analyses described in Figure 1—figure supplements 1–3.

Figure 1—figure supplement 5. Validation of accuracy and bias for classification of task-anchored and task-independent modes.

Figure 1—figure supplement 5.

500 task-anchored grid cells and 500 task-independent grid cells with grid spacings uniformly distributed between 40 and 400 cm were simulated to identify the optimal threshold to classify based on spatial frequency. Simulations were repeated using different spike rate probabilities and different field jitters (defined by the standard deviation of the field locations from their preassigned locations). Roughly, Pmax(spike) values of 0.01, 0.1, and 1 covered average firing rates on the order of magnitudes of 10–1, 100, 101 Hz respectively whereas jitter SD values of 0, 10, 20, and 30 cm covered progressively greater deviations from perfect periodic firing. Classifications were made on each set of simulations in the same way as for analysis of experimental data (see Figure 1—figure supplements 1–4). Prediction accuracy (left) and bias (right) are shown as a function of the spatial frequency from the nearest positive-integer used as a threshold to distinguish task-anchored and task-independent modes. Chance level accuracy is denoted with a red dashed line.

We address this question by investigating grid and non-grid firing during a task in which mice learn the location of a reward on a virtual track (Figure 1C, Tennant et al., 2022; Tennant et al., 2018). On cued trials, the mice received rewards for stopping within a ‘reward zone’ that was marked by a distinct visual cue. In contrast to cue-rich virtual environments often used to study grid cells (e.g. Campbell et al., 2018; Domnisoru et al., 2013), this is the only spatially localised cue available after initiation of a trial. Removal of this cue enables testing of whether the mice are able to use a path integration strategy, in which case they should continue to selectively stop in the reward zone, or a cue-based strategy in which case they should no longer stop selectively at the reward zone location (Figure 1C; see also Tennant et al., 2022; Tennant et al., 2018). We find that during the task, grid cells can either be anchored to the track reference frame (‘task-anchored’), or can maintain a periodic firing pattern independent of the track reference frame (‘task-independent’). Adoption of these anchoring modes varied both between and within recording sessions. On trials when the reward zone cue was visible, adoption of the task-anchored representation did not predict task performance. By contrast, when the reward zone cue was absent, task-anchored grid firing was associated with successful localisation of the reward zone. Thus, our results suggest that task-anchoring of the grid cell network selectively enhances performance of behaviours that require path integration.

Results

We recorded from neurons in the MEC of nine wild-type mice exploring an open arena and then performing a location memory task in a virtual linear track environment. By comparing the hexagonal symmetry of spatial autocorrelograms of neural activity in the open arena with corresponding shuffled data, we identified 103/1881 neurons as grid cells (11.4±17.4 grid cells/mouse, range 0.4–9.5%, Supplementary file 1) (see Materials and methods for classification procedures). These grid cells had field sizes of 7.5±3.3 cm and grid spacing of 72.5±13.7 cm and were found in dorsomedial parts of the MEC. Until indicated otherwise, we report analyses of neurons across all trials of the location memory task regardless of whether the reward zone is indicated by the cue or whether mice stop at the rewarded location.

Grid cells exhibit either task-anchored or task-independent firing

A priori, we envisaged two scenarios for activity of grid cells during the location memory task. Given well-established spatial firing of grid cells in open arenas, we might expect that grid cell activity is anchored to the task reference frame (Figure 1A and D). Alternatively, given distance encoding but location-independent firing of grid cells in circular tracks (Jacob et al., 2019), we might expect the activity of grid cells to be periodic but independent from the task reference frame (Figure 1B and E).

To distinguish these scenarios we estimated the periodicity of each neuron’s activity as a function of distance moved by the mouse using the Lomb-Scargle method (Lomb, 1976; Scargle, 1982; VanderPlas, 2018, Figure 1—figure supplements 1–3). This approach yields periodograms indicating power as a function of oscillation frequency and an associated estimate of the false alarm probability. We validated these estimates for detection of periodicity associated with grid firing using synthetic and shuffled data (Figure 1—figure supplements 4 and 5). According to the task-anchored firing scheme, firing fields should occur at the same positions on each trial (Figure 1A). In this case, because the virtual track repeated every 200 cm, significant peaks in the periodogram should occur at integer multiples of the spatial frequency of the repeating track (Figure 1D, Figure 1—figure supplement 3). By contrast, in the task-independent firing scheme, grid representations do not anchor to the track, but maintain firing fields that are periodic with respect to distance run (Figure 1B). In this case, significant peaks in the periodogram would reflect the distance between firing fields repeating independently of the task reference frame (Figure 1E, Figure 1—figure supplement 3). A further possibility is that in the location memory task the activity of grid cells is no longer periodic. In this case, peaks in the periodogram above the false alarm threshold should be absent.

We initially tested these predictions for neural activity across a complete behavioural session (n=103 grid cells, N=61 sessions, 233±135 trials/session)(Figure 2). We found that 68 of 103 grid cells had peaks in their periodograms within 5% of an integer multiple of the spatial frequency of the track repetition, consistent with their activity being anchored to the reference frame provided by the virtual track (Figure 2A and D–E). We refer to these neurons as showing ‘session-level task-anchored’ grid firing. By contrast, 32 of 103 grid cells had periodograms with peaks at frequencies outside 5% of an integer multiple of the track length, indicating that their activity was not coupled to the task reference frame (Figure 2B and D–E). We refer to these neurons as showing ‘session-level task-independent’ grid firing. Grid cells with periodograms lacking peaks above the false alarm threshold, which we will refer to as aperiodic grid cells, were rare (3/103) (Figure 2C–E). When we carried out similar analyses for non-grid cells, we found that the proportion of neurons with task-anchored firing was similar, but task-independent periodic firing was rarer, while aperiodic firing neurons were more common (Figure 2E).

Figure 2. Grid cells operate in task-anchored or task-independent firing modes.

Figure 2.

(A–C) Examples of grid cells with activity during the location memory task classified as task-anchored (A), task-independent (B), or aperiodic (C) at the session level. Examples are ordered in their respective groups by their spatial information on the track. From top to bottom plots show: heap map of firing rate as a function of track position, spatial autocorrelation of the track firing rate, periodogram of the track firing, open field firing rate map, and open field spatial autocorrelogram. The red line indicates the false alarm threshold estimated from shuffled data and significant peaks are labelled with a triangle. X-axis scales are adjusted on the virtual reality spatial autocorrelation to better illustrate the long-range periodic signal. (D) Peak power as a function of the spatial frequency at which the peak occurs for all recorded cells. The red dashed line indicates the false alarm threshold generated from shuffled data. (E) Percentage of grid (G) and non-grid (NG) cells classified to task-anchored, task-independent, and aperiodic groups. (F) Comparison between task-anchored (TAG), task-independent (TIG), and aperiodic (AG) grid cells of mean firing rate (ANOVA: DF=2, p=0.006, Χ2=10.215; pairwise comparisons: TAG vs TIG, DF=4.12, p=0.8, T=0.562; TAG vs AG, DF=42.07, p=0.02, T=2.906; TIG vs AG, DF=67.29, p=0.03, T=2.588), spatial information scores (ANOVA: DF=2, p=0.008, Χ2=9.54; pairwise comparisons: TAG vs TIG, DF=73.6, p=0.02, T=2.815; TAG vs AG, DF=95.5, p=0.11, T=2.036; TIG vs AG, DF=96.6, p=0.7, T=0.783), peak power (ANOVA: DF=2, p=0.001, Χ2=13.792; pairwise comparisons: TAG vs TIG, DF=19.0, p=0.13, T=2.033; TA vs A, p=0.006, T=3.239, DF=54.9; TI vs A, p=0.07, T=2.274, DF=80.4), and peak width (ANOVA: DF=2, p=0.15, Χ2=3.7963; pairwise comparisons: TAG vs TIG, p=0.61, T=–1.029, DF=3.27; TA vs A, p=0.88, T=0.472, DF=45.76; TI vs A, p=0.55, T=1.053, DF=71.22).

To validate the periodogram-based classification we calculated the mean firing of grid cells as a function of track position. Consistent with their classification, task-anchored grid cells showed clear firing rate peaks associated with specific track locations (Figure 2A). By contrast, task-independent and aperiodic grid cells lacked clear firing rate peaks (Figure 2B and C). These differences manifest as substantially higher spatial information scores, but similar average firing rates, for grid cells with session-level task-anchored firing compared with task-independent firing (Figure 2F). Features of the periodogram such as peak power and peak width did not differ between task-anchored grid cells and task-independent grid cells (Figure 2F). The aperiodic grid cells had much lower mean firing rates than the task-anchored grid or task-independent grid cells suggesting that their apparent lack of periodicity reflects inactivity (Figure 2F).

These data suggest that during the location memory task we consider here, grid firing can either be anchored to the track and therefore be directly informative about position relative to the task reference frame, or be independent of the track and therefore may only be directly informative about distance travelled within the behavioural reference frame. Anchoring is consistent with previous reports of grid cell activity on virtual and real-world linear tracks (Domnisoru et al., 2013), while task independence is consistent with encoding of distance but not position by grid cells in real-world circular tracks (Jacob et al., 2019).

Grid cells switch between task-anchored and task-independent firing

We next asked if the mode adopted by the grid cells at the level of a whole session, either task-anchored or task-independent, was stable across individual trials within the session (Figure 3A, left), or if cells could switch mode (Figure 3A, right). Visual inspection of firing rate heat maps indicated that for some grid cells their firing pattern was stable across most trials within a session (Figure 3B and C). However, for many grid cells there appeared to be clear changes in anchoring within a session (Figure 3D and E). These switches could not be explained by variation between trials in the availability of cues or rewards, as these were interleaved in blocks that repeated throughout a session (see Materials and methods), whereas periods in which grid cell activity was in a given mode extended across the repeating blocks (e.g. Figures 3D, E5E, F).

Figure 3. Coding schemes switch within behavioural sessions.

(A) In a ‘stable coding’ scenario grid cells remain either task-anchored or task-independent throughout the recording session (left), whereas with ‘unstable coding’ the grid activity switches between task-anchored and task-independent modes (right). (B–E) Example trial-by-trial firing rate heat maps (upper left), corresponding rolling periodogram heat maps (upper right), mean rate maps (lower left), and mean periodograms (lower right) for neurons exhibiting stable task-anchored coding (B), stable task-independent coding (C), and unstable coding in which representations switch between task-anchored and task-independent (D–E). (F) Distribution across all recorded grid cells of task-anchored trials (left), task-independent trials (centre), and aperiodic trials (right). Session-level task-anchored grid (TAG), task-independent grid (TIG), and aperiodic grid (AG) cell classifications are differently coloured. (G) Spatial information was higher for trials when grid cells were task-anchored compared to when they were task-independent (left) (ANOVA: p<1e-7, Χ2=30.98, DF=1), whereas the average firing rate was similar between task-anchored and task-independent trials (right) (ANOVA: p=0.88, Χ2=0.022, DF=1).

Figure 3.

Figure 3—figure supplement 1. Procedure for classifying periodicity on a rolling basis.

Figure 3—figure supplement 1.

Periodograms were generated as in Figure 1—figure supplement 1. Sliding windows containing 200 consecutive periodograms were then extracted and averaged. A classification was made on the averaged periodogram using the peak power, spatial frequency, and an adjusted false alarm threshold (see Materials and methods). The classification and midpoint location of the window were stored and the procedure repeated for the full session. Windows were assigned to trials based on the location of their middle points and then the classification occurring most often was assigned to that trial.
Figure 3—figure supplement 2. Evaluation of classification accuracy and bias as a function of the number of periodograms used for rolling classification.

Figure 3—figure supplement 2.

(A) Examples of the activity of simulated grid cells that switch between task-anchored and task-independent encoding modes of operation, either infrequently (i, iii) or relatively frequently (ii, iv), and with (iii, iv) and without (i, ii) jitter. Each example shows the firing rate heat map by trials (upper left), the average firing rate map (lower left), the rolling periodogram (upper right), the average periodogram (lower right), and the classification labels (true and predicted; far right). (B) To assess classification accuracy under different rolling windows, we calculated the prediction accuracy and bias (see Materials and methods). Chance level is denoted with a red dashed line. Plots on the left show the prediction accuracy (top) and the prediction bias (bottom) when grid cells alternate between task-anchored and task-independent firing fields in blocks of trials (as in i, iii above), whereas the right plots show the same information for a higher switching frequency (as in ii, iv above).
Figure 3—figure supplement 3. Classification accuracy and bias on the level of trial as a function of rolling window size.

Figure 3—figure supplement 3.

The false alarm threshold was defined by the 99th percentile of the distribution of the peak power of the average periodogram for 1000 shuffled instances of a cell’s firing rate profile across the full experimental session. The false alarm threshold decreases asymptotically as the number of periodograms used for the rolling window classification is increased. Each red line represents a single cell within a representative session. The blue line represents the maximum number of periodograms in this session.
Figure 3—figure supplement 4. Spatial firing properties of stable task-anchored and task-independent grid cells.

Figure 3—figure supplement 4.

This is a repeat of the analysis shown in Figure 2F, but categorising cells according to the proportion of trials on which their firing is a given mode. Thus, whereas in Figure 2 task-anchored, task-independent, and periodic firing classifications are assigned on the basis of average periodograms across the behavioural session, here we group cells according to whether they show stable (>85% of trials) task-anchored, task-independent, or periodic firing. Conclusions from this analysis are similar to those of Figure 2F. (A) Comparison of mean firing rate (ANOVA: p=0.49, Χ2=1.42, DF=2; pairwise comparisons: TA vs TI, p=0.86, T=–0.532, DF=21.4; TA vs A, p=0.95, T=–0.292, DF=96.7; TI vs A, p=0.62, T=–0.937, DF=23.1). (B) Comparison of spatial information scores (ANOVA: p<1e-4, Χ2=21.47, DF=2; pairwise comparisons: TA vs TI, p=0.0002, T=4.229, DF=89.9; TA vs A, p=0.0001, T=–4.412, DF=94.2; TI vs A, p=0.21, T=1.703, DF=85.2). (C) Comparison of peak power (ANOVA: p=0.0007, Χ2=14.42, DF=2; pairwise comparisons: TA vs TI, p=0.05, T=2.383, DF=88.4; TA vs A, p=0.0008, T=–3.781, DF=98.9; TI vs A, p=0.996, T=–0.080, DF=86.5). (D) Comparison of peak width (ANOVA: p=0.002, Χ2=12.78, DF=2; pairwise comparisons: TA vs TI, p=0.03, T=–2.840, DF=16.2; TA vs A, p=0.13, T=1.949, DF=95.3; TI vs A, p=0.11, T=–2.162, DF=16.0).
Figure 3—figure supplement 5. Grid cells exhibit task-independent periodic codes more frequently than non-grid cells.

Figure 3—figure supplement 5.

Extension of Figure 3F. (A) Distribution of all recorded grid cells (top) and non-grid cells (bottom) encoding task-anchored (left), task-independent (centre), and aperiodic (right) epochs within a session. Session-level cell classifications are represented by the colour of the corresponding coding group. (B) Cumulative density for grid and non-grid cells encoding task-anchored, task-independent, and aperiodic epochs within a recording session (task-anchored: p=0.035, KS=0.14; task-independent: p<1e-15, KS=0.42; aperiodic: p<1e-12, KS=0.38, Ngrid cells = 103, Nnon-grid cells = 1778, Kolmogorov-Smirnov test).
Figure 3—figure supplement 6. Assessment of the length of periodic coding blocks.

Figure 3—figure supplement 6.

(A) We compared the length of coding blocks - sequences of trials in which grid cells operate in the same mode - in the observed data with the length in datasets shuffled at the level of trials. To generate shuffled data spike locations were reallocated to a new position in the firing profile by randomly shuffling the trials (see Materials and methods). The rolling classification was then recomputed and length of coding blocks measured. (B) Cumulative histogram of block lengths for the observed grid cell population (red) and the same grid cell population with the trial order shuffled and blocks recalculated (grey) (p=0.0003; KS=0.066; Nblocks(data)=1765 Nblocks(shuffled)=2359; Kolmogorov-Smirnov test).
Figure 3—figure supplement 7. Differences in order and ratio of trial types do not explain the variability in task-anchoring.

Figure 3—figure supplement 7.

(A) Example trial structure with repeating beaconed and non-beaconed trials in a ratio of two beaconed trials to one non-beaconed trial. The rolling window over which the rolling classification of periodicity is calculated is larger than the repeating trial block. Therefore, attribution of a periodic classification to a single trial cannot be explained by the trial type or order. (B) The percentage of trials in which each grid cell showed task-anchored coding as a function of the percentage of beaconed trials experienced during the session. The percentage of beaconed trials did not have a significant effect on the occurrence of task-anchored coding (p=0.95, Χ2=0.032, DF=1, ANOVA comparison of binomial family GLMMs with and without % beaconed trials as a fixed effect, with mouse ID, session ID, and neuronal ID as random effects and a logit linker function).

Figure 5. Spatial behaviour during task-anchored and task-independent grid modes.

(A) Averages across each behavioural session of running speeds as a function of track position for all sessions. (B) Running speed as a function of track position for trial outcomes classified as hit, try, or run for an example session. (C–F) Examples of variation in the behaviour-related activity of grid and non-grid cells recorded on the location memory task, illustrating firing patterns that are stable and task-anchored (C) or task-independent (D) firing, and unstable firing where cells switch between task-anchored and task-independent modes (E–F). Plots show all simultaneously recorded cells’ firing rate maps in each session (left), stop rasters (lower centre), stop density on beaconed (B) and non-beaconed (NB) trials coloured according to whether grid cells were task-anchored or task-independent (upper centre) and a summary of raster of behaviour and cell classifications (right). Shaded regions in stop density plots represent standard error of the mean measured across epochs. The number of trials classified in a particular coding scheme is also provided with the stop density plot. Grid cells and non-grid cells are colour-coded by bounding boxes around the firing rate map.

Figure 5.

Figure 5—figure supplement 1. Classification of trial outcomes.

Figure 5—figure supplement 1.

Trials were classified into hits, tries, and runs, based on stopping locations and the speed profile on a given trial. First, trials were classified into hits and misses based on whether a stop was registered in the reward zone or not. Next, a distribution of the average speeds in the reward zone is drawn for hit and miss trials, the 95th percentile of the hit average speeds in the reward zone was used to split the miss trials into near hits (tries) and run-throughs (runs). Finally, trials in which the mouse’s average speed outside of the reward zone was <10 cm/s were removed to better discriminate trial outcomes based on the mouse’s engagement.
Figure 5—figure supplement 2. Speed profiles across behavioural sessions for each mouse.

Figure 5—figure supplement 2.

Figure 5—figure supplement 3. Further examples of spatial behaviour during task-anchored and task-independent grid modes.

Figure 5—figure supplement 3.

(A–F) Examples of variation in the behaviour-related activity of grid and non-grid cells recorded on the location memory task. Plots show all simultaneously recorded cells’ firing rate maps in each session (left), stop rasters (lower centre), stop density on beaconed (B) and non-beaconed (NB) trials coloured according to whether grid cells were task-anchored or task-independent (upper centre) and a summary of raster of behaviour and cell classifications (right). Shaded regions in stop density plots represent standard error of the mean measured across epochs. The number of trials classified in a particular coding scheme is also provided with the stop density plot. Grid cells and non-grid cells are colour-coded by bounding boxes around the firing rate map.

To quantify switching between firing modes we evaluated rolling periodograms across each session. We classified each periodogram window as task-anchored, if the periodogram peaks occurred at integer multiples of the spatial frequency at which the track repeats, as task-independent if there were periodogram peaks at other spatial frequencies, or as aperiodic if there were no peaks above the false alarm threshold (see Materials and methods and Figure 3—figure supplements 1–3). For 26.2% of grid cells (27/103) the classification was consistently (>85% of trials) task-anchored or task-independent (Figure 3F), whereas for 73.8% of grid cells (76/103) no single coding scheme accounted for more than 85% of trials (Figure 3F). Grid cells identified as having task-anchored firing in our initial session-level analysis (Figure 2) were biassed towards high proportions of task-anchored trials (Figure 3B and F), whereas grid cells identified as task-independent at the session-level showed a bias towards high proportions of task-independent trials (Figure 3C and F), although in both groups many neurons showed variation between trials indicating that session-level analyses may obscure dynamic changes in task-anchoring. Differences in spatial information and periodogram properties between grid cells classified as task-anchored or task-independent based on their session-level firing patterns (Figure 2F) were nevertheless maintained when we instead compared neurons with firing mode that was consistent across trials within a session (Figure 3—figure supplement 4). For non-grid cells, consistent with session-level analyses, we again found that a sub-population showed task-anchored firing at a trial level, while task-independent periodic firing was substantially less common than in the grid cell population (Figure 3—figure supplement 5).

To validate the window-based analyses we compared mean firing rate as a function of track position between trials classified as task-anchored and those classified as task-independent. Consistent with the classification scheme correctly separating task-anchored from task-independent activity, spatially localised firing rate fields were present during task-anchored firing but were reduced or abolished when firing was task-independent (e.g. see rate maps, Figure 3D and E). This difference was associated with substantially lower spatial information scores for trials with task-independent firing, while mean firing rates were similar (Figure 3G). As a further test, we compared the durations of periods of activity in a given state to durations generated from shuffled datasets. If classification was by chance then the distributions of durations should be similar. By contrast, among all grid cells periods of task-anchored or task-independent firing extended in blocks across multiple trials, with the distribution of block lengths substantially different to that generated by shuffled data (Figure 3—figure supplement 6)(p=0.0003, KS=0.066; DF=1765, 2359; Kolmogorov-Smirnov test). Variation between grid cells in their firing mode also could not be explained by the relative proportion of cued trials in a session (Figure 3—figure supplement 7).

Given that populations of grid cells show coordinated dynamics that are consistent with their forming networks with continuous attractor dynamics (Barry et al., 2007; Waaga et al., 2021; Yoon et al., 2013), changes in anchoring should be coherent across grid cells and any non-grid cells that coordinate with the grid network. To test this, we compared activity patterns of simultaneously recorded grid and non-grid cells (Figure 4). Grid cells typically transitioned between task-anchored and task-independent firing modes at the same time (e.g. see Figure 4A–C and Figure 5E and F). This manifested as strong agreement between grid cells in their session-long order of task-anchored and task-independent epochs (Figure 4D and E). By contrast, the activity of non-grid cells was more diverse. Some non-grid cells transitioned between task-anchored and task-independent modes at the same time as simultaneously recorded grid cells, whereas others remained stably anchored throughout the recording session (Figure 4A–C and Figure 5E and F). As a result, session-long agreement scores for pairs of grid and non-grid cells were more variable and on average lower than for pairs of grid cells (Figure 4D and E). Non-grid cells also differed from the grid cell population in that their activity maintained similar spatial information between trials when grid cells were task-anchored versus when they were task-independent, whereas for grid cells task independence was associated with reduced spatial information (Figure 4F).

Figure 4. Grid cells and non-grid cells switch between coding schemes coherently.

Figure 4.

(A) Joint activity of 6 simultaneously recorded grid cells (orange frames) and 18 non-grid cells (blue frames) from a single session. For each cell, the firing rate map across trials (left) is shown next to the trial classification (right). (B) Classifications for all grid cells (GC) and non-grid cells (NG) as shown in (A), ordered by their agreement to the most common classification within the recorded network at any particular trial. The common classification for recorded grid cells is shown as G¯ . (C) Mean firing rate as a function of position for exemplar units from (A) when G¯ was task-anchored (left) and task-independent (right). (D) Strategy for assessing agreement between cells in their firing mode (i) and for generating shuffled datasets (ii). (E) Agreement in the firing mode between each combination of grid (G) and non-grid (NG) cells and corresponding scores for the shuffled data (lower), and the difference between the shuffled and actual scores (upper). Agreement was greater between grid cell pairs than between pairs involving non-grid cells (ANOVA: G-G, p<1e-13, Χ2=58.89, DF =1, NG-NG, p<1e-5, Χ2=20.42, DF =1, G-NG, p<1e-7, Χ2=30.37, DF =1; pairwise comparisons: G-G vs NG-NG, p<1e-4, T=–10.455, DF =10,720, G-G vs G-NG, p<1e-4, T=–8.415, DF =10,710, NG-NG vs G-NG, p<1e-4, T=–6.853, DF =10,352). (F) Spatial information of individual cells during trials in which G¯ is task-independent as a function of spatial information during trials in which G¯ is task-anchored (left). The difference in spatial information between sessions classed as task-anchored or task-independent on the basis of grid cell activity was greater for grid than non-grid cells (right, ANOVA: p<1e-5, Χ2=21.1, DF =1; G vs zero, p=0.018, T=2.723, DF =11.87; NG vs zero, p=0.3, T=–1.278, DF =2.58). The percentage change in spatial information was calculated as 100(SIG¯=TASIG¯=TI)/SIG¯=TA .

Together, these data indicate that grid cells can switch between task-anchored and task-independent firing modes within a behavioural session. This switching happens coherently across grid cell populations, which is consistent with grid cells forming networks with continuous attractor dynamics (Barry et al., 2007; Gardner et al., 2022; Waaga et al., 2021; Yoon et al., 2013). Our data also suggest that non-grid cells within the MEC form multiple populations, with some having activity that is coherent with the grid cell network, whereas others do not show task-independent periodic firing but instead maintain stable spatial representations independently from grid cells.

Task-anchored coding by grid cells is selectively associated with successful path integration-dependent reward localisation

Our analyses indicate that grid cells exhibit either task-anchored or task-independent firing, and that their activity can switch between these modes within a recording session. Since task-anchored firing fields could be read out directly to estimate track location, but location may only be inferred indirectly from task-independent activity, we reasoned that the presence or absence of task-anchoring could be used to assess whether grid firing contributes to the ongoing behaviour. Because in grid networks the activity of an individual neuron is informative about the network state as a whole (Fiete et al., 2008; Gardner et al., 2022; Waaga et al., 2021), then in principle activity of any grid cell is indicative of whether the grid network as a whole is in a task-anchored or task-independent mode (see also Figure 4). Thus, if anchoring of grid representations to the task environment is critical for localisation of the reward, then task-anchored coding of individual neurons should predict successful trials. On the other hand, if behavioural performance is maintained when the grid representation is task-independent, then it is unlikely that anchored grid representations are necessary for reward localisation.

To distinguish these possibilities we took advantage of variation in behavioural outcomes, which were such that mice either stopped correctly in the reward zone (‘hit’ trials), slowed down on approach to the reward zone but did not stop (‘try’ trials), or maintained a high running speed across the reward zone (‘run’ trials)(Figure 5A and B and Figure 5—figure supplements 1 and 2). We separately evaluated outcomes from trials in which the reward zone cue was visible and a reward available (‘beaconed trials’), trials in which the reward zone cue was omitted and a reward was available (‘non-beaconed trials’), and trials in which the cue and the reward were both omitted (‘probe trials’). Because trials of each type were interleaved into blocks that were repeated across a session (see Materials and methods), while periods of task-anchored and task-independent activity were typically maintained for blocks of many trials, differences in behavioural outcomes could not be explained by association of the grid-anchoring mode with particular trials types.

We first compared stopping behaviour when grid cells showed task-anchored firing that was stable within a session to when they showed task-independent firing that was stable within a session. On cued trials the spatial organisation of stopping behaviour (Figures 5C vs D and 6A) and the proportion of hit trials (Figure 6B) was similar for both groups. By contrast, on non-beaconed and probe trials stopping behaviour was clearly spatial when grid activity was task-anchored, but spatial organisation was largely absent when grid activity was task-independent (Figures 5C vs D and 6A), while the proportion of hit trials was substantially reduced (Figure 6B). These observations are consistent with grid representations being required for path integration-dependent but not cued localisation of the reward zone. This session-level analysis has the advantage that it focuses on large blocks of time (sessions) during which the mode of grid firing was stable, but the disadvantage that it excludes many sessions in which the mode of grid firing switches between task-anchored and task-independent.

Figure 6. Anchoring of grid firing to the task reference frame promotes localisation by path integration but is not required for cued localisation.

(A, C) Stopping probability relative to baseline as a function of position for sessions with stable grid codes (A) and for epochs within sessions containing both stable and unstable codes (C). Shaded regions in A and C represent standard error of the mean measured across sessions and epochs respectively. N represents the number of sessions with stable codes (A) and the number of grid cells with coding epochs (C). Stable sessions were defined as a session with at least one grid cell for which >85% of trials were in a single coding mode. (B, D) Percentage of hits on beaconed, non-beaconed, and probe trials when the code is task-anchored or task-independent for (B) sessions with stable codes (ANOVA: beaconed, p=0.1, Χ2=2.70, DF=1; non-beaconed, p=0.022, Χ2=5.24, DF=1; probe, p=0.033, Χ2=4.55, DF=1) and when epochs within sessions are task-anchored or task-independent (D) (ANOVA: beaconed, p=0.09, Χ2=2.84, DF=1; non-beaconed, p=0.001, Χ2=10.14, DF=1; probe, p=0.19, Χ2=1.70, DF=1, see Materials and methods). (E) Percentage of trials with hit, try, and run outcomes in which grid cell firing is task-anchored (TA) or task-independent (TI) (ANOVA: beaconed, p=0.11, Χ2=4.49, DF=2; non-beaconed, p=0.02, Χ2=7.75, DF=2; probe, p=0.07, Χ2=5.40, DF=2). Error bars denote standard error of the mean measured across the mean values for each animal. Faded lines show percentage values for individual mice that contained hit, try, and run trials for a given trial type. (F) Odds ratio between receipt of reward for trials on which epochs contain task-anchored firing relative to trials on which epochs contain task-independent firing (beaconed-G, p=0.23; non-beaconed-G, p=0.001; probe-G, p=0.27).

Figure 6.

Figure 6—figure supplement 1. Speed profiles across different trial outcomes.

Figure 6—figure supplement 1.

(A) Running speed as a function of track location for all combinations of trial types and trial outcomes. Shaded regions represent standard deviations measured across trials. (B) Same as in A, however trials were subdivided further based on the coding scheme of grid cells. In cases where multiple grid cells were recorded simultaneously, the same trial was used multiple times to calculate the average speed profile.
Figure 6—figure supplement 2. High correlation to the task-anchoring template of grid firing promotes localisation by path integration but is not required for cued localisation.

Figure 6—figure supplement 2.

(A) Procedure for classifying trials using an ensemble method (Lomb-Scargle+template correlation). (B) Trial density of all trial template correlations for trials classified as task-anchored (upper) or task-independent (bottom) using the Lomb-Scargle method. The same trial may be represented multiple times based on the number of simultaneously recorded cells. (C) To assess classification accuracy using the ensemble method, we calculated the prediction accuracy and bias of simulated grid cells (see Materials and methods). Chance level is denoted with a red dashed line. Plots on the left show the prediction accuracy (top) and the prediction bias (bottom) when grid cells alternate between task-anchored and task-independent firing fields in blocks of trials (as in i, iii above), whereas the right plots show the same information for a higher switching frequency (as in ii, iv above). (D) Summary table detailing the pros and cons of each method. (E) Stopping probability relative to baseline as a function of position for epochs within sessions containing both stable and unstable codes. Shaded regions represent standard error of the mean measured across epochs. N represents the number of grid cells with coding epochs. (F) Percentage of hits on beaconed, non-beaconed, and probe trials when the code is task-anchored or task-independent for epochs within sessions are task-anchored or task-independent (ANOVA: beaconed, p=0.43, Χ2=0.62, DF=1; non-beaconed, p=0.01, Χ2=6.43, DF=1; probe, p=0.06, Χ2=3.52, DF=1). (G) Percentage of trials with hit, try, and run outcomes in which grid cell firing is highly correlated with task-anchored firing (ANOVA: beaconed, p=0.51, Χ2=1.35, DF=2; non-beaconed, p=0.08, Χ2=5.14, DF=2; probe, p=0.04, Χ2=6.67, DF=2). Error bars denote standard error of the mean measured across the mean values for each animal. Faded lines show percentage values for individual mice that contained hit, try, and run trials for a given trial type. (H) Odds ratio between receipt of reward for trials on which epochs contain task-anchored firing relative to trials on which epochs contain task-independent firing (beaconed, p=0.4; non-beaconed, p=0.002; probe, p=0.04).

We addressed this by using additional trial-level comparisons to evaluate all behavioural sessions, including those when the grid mode was unstable. On cued trials the spatial organisation of stopping behaviour (Figures 5E–F6C), and the proportion of hit trials (Figure 6D), was similar irrespective of whether grid cell fields were task-anchored or task-independent. On trials in which the reward zone cue was hidden, the relationship between firing and behavioural outcome was more complex. In many sessions, localisation of the reward occurred almost exclusively when cell firing was task-anchored and not when it was task-independent (Figure 5E and F). In a few sessions, we observed spatial stopping behaviour comparable to cued trials, even when grid firing was predominantly task-independent (Figure 5—figure supplement 3). In one session, we also observed grid cells shifting phase between task-anchored epochs (Figure 5E) similar to findings in Low et al., 2021, although this did not appear to alter task performance. On average, spatial stopping behaviour was reduced on non-beaconed and probe trials during which grid firing was task-independent (Figure 6C), and the proportion of successful trials was reduced compared with when grid firing was task-anchored (Figure 6D). The differences in outcomes between task-anchored versus task-independent trials were not associated with differences in running speed profiles (Figure 6—figure supplement 1) indicating they were not a consequence of a difference in motor behaviour.

Additional analyses of relationships between firing mode and trial outcomes were consistent with these observations. Thus, task-anchored firing occurred on a greater proportion of non-beaconed and probe trials that were hits compared with task-independent firing, but on a smaller proportion of run trials, in which mice ran through the reward zone without slowing down (Figure 6E). In addition, the odds ratio for receipt of reward on task-anchored versus task-independent trials was close to 1 when cues were available, but was much larger in the absence of cues (Figure 6F). Analyses using an alternative classification method, based on template matching of the task-anchored firing rate profile (Figure 6—figure supplement 2A-B), also indicated a similar behavioural performance on cued trials, but impaired performance on uncued trials when grid cells were in a task-independent mode (Figure 6—figure supplement 2C-F).

Together, these analyses demonstrate that anchoring of grid codes to track position is not necessary to successfully obtain rewards when visible cues are present. By contrast, when visual cues that indicate the reward zone are absent, task-anchored coding appears to promote successful localisation.

Discussion

Our results support specific roles for task-anchored grid representations in path integration-dependent behaviours while arguing against the idea that grid codes provide a representation of location that is used more generally. Thus, we find that grid representations can either be anchored to position in a task environment, or can provide an environment-independent distance metric (Figure 2), that grid cells can switch between these operating modes within a behavioural session (Figures 34), and that anchoring of grid firing fields to location is not required for cued reward localisation, but appears to promote path integration-dependent reward localisation (Figures 56). By contrast, while some non-grid cells had activity that switched modes coherently with grid cells, many non-grid cells did not show task-independent periodic activity (Figure 3—figure supplement 5, Figures 45, Figure 5—figure supplement 2), suggesting that the MEC may implement multiple, parallel spatial computations.

Task-anchoring of grid cells varies within and between behavioural sessions

A standard view of grid firing is that it provides an ‘always on’ high capacity representation of current location. In contrast, our results demonstrate that grid representations are not necessarily anchored to the behaviourally relevant environmental reference frame. This extends previous observations that on circular tracks grid cells read out path integrated distance rather than absolute position (Jacob et al., 2019). Our results show that both modes of grid representation can be observed during the same behavioural task, and that the grid network can switch between these operating modes within a session. Consistent with the reported continuous attractor dynamics of grid networks, we find that simultaneously recorded grid cells switch modes coherently (Figures 4 and 5), although without recording from all grid cells simultaneously we cannot rule out the possibility that switching reflects a subset of grid cells that become disconnected from the wider network. The mode switching we observe here appears to differ from previously reported spontaneous remapping of MEC network states (Low et al., 2021) as the previously reported phenomenon was independent of any task contingencies and involved remapping between different task-anchored representations. By contrast, we show here switching between task-anchored representations that may be directly useful for solving the task at hand, and task-independent representations that appear unlikely to contribute to solving the task.

Grid cells are a relatively small proportion of the neurons in the MEC and an important question is the extent to which switches between task-anchored and task-independent modes extend to other cell types. Among non-grid cells, a sub-population appeared to switch between task-anchored and task-independent modes coherently with grid cells. However, task-independent periodic activity was relatively rare among non-grid cells (Figure 3—figure supplement 5). A possible explanation for this dissociation is that the MEC might contain multiple sub-networks, with populations of grid cells and coherent non-grid cells sharing continuous attractor dynamics, while other populations of non-grid cells operate independently from the grid network. For example, non-grid cells may be differentially influenced by visual cues (Casali et al., 2018; Kinkhabwala et al., 2020) or could generate location representations through ramping profiles rather than discrete firing fields (Tennant et al., 2022). The presence in the MEC of functionally distinct grid and non-grid networks might also account for why manipulations that perturb grid cells selectively disrupt path integration-dependent behaviours (Gil et al., 2018), whereas manipulations that target layer 2 stellate cells, which include grid and non-grid cells, impair path integration-dependent and cued behaviours (Qin et al., 2018; Tennant et al., 2018).

The causes of switching between task-anchored and task-independent representations may be an important focus for future investigation. It appears unlikely that task-independent coding by grid cells result from failure of upstream circuits to generate appropriate visual representations, e.g. through a shift in visual attention, as mice performed well on the visually cued version of the location memory task when grid cells were task-independent. A perhaps more promising hypothesis for future investigation is that switching reflects modulatory pathways reducing the impact of visual inputs to the grid system, possibly reflecting top-down control mechanisms, shifts in brain state, or uncertainty about whether visual or motor signals indicate the correct environment.

Spatial roles of grid cells may be specific to path integration-dependent behaviours

Our finding that cued identification of a reward location is similar when grid cells are task-anchored or task-independent suggests that grid representations are not required for cued recall of locations. Thus, when both visual and grid inputs are available to downstream decision-making circuits, the grid input appears not to be used. If it was, then the inconsistent positional signals from the task-independent grid codes would impair performance. An implication of this result is that cue-rich tracks often used to investigate grid activity patterns may not engage behaviours that require anchored grid firing. Several observations suggest that the MEC could nevertheless be required for recall of cued locations. First, inactivation of stellate cells in layer 2 of the MEC causes deficits in the task we use here and in other visually cued tasks (Qin et al., 2018; Tennant et al., 2018). Second, other spatial tasks that involve selections between cued locations appear to require the MEC (e.g. Gaskin and White, 2013; Gaskin and White, 2010). In this case, spatial representations used for the task could be encoded by other functional cell types, e.g. neurons that encode location through border (Solstad et al., 2008) or ramping firing fields (Tennant et al., 2022), or through cue-responsive cells (Casali et al., 2018; Keene et al., 2016; Kinkhabwala et al., 2020).

On trials in which the reward zone cue is absent, efficient reward localisation relies on path integration from the start of the track (Tennant et al., 2018). We found that on these trials, task-anchored grid firing was associated with a spatially localised stopping strategy and a higher proportion of successful trials compared with when grid firing was task-independent. This corroborates key predictions of hypothesised roles for grid cells in path integration (McNaughton et al., 2006). It is conceivable that behaviourally relevant computations are implemented elsewhere in the brain with grid anchoring to the track an indirect consequence, but explanations of this kind are hard to reconcile with evidence that stellate cells in the MEC are required for the task we used here (Tennant et al., 2018), or with evidence for specific roles of grid firing in path integration based on genetic manipulations that abolish grid firing without affecting other functional cell types (Gil et al., 2018). Nevertheless, our finding of residual localisation performance on task-independent trials suggests that additional neural mechanisms may also support path integration-dependent behaviour. This could reflect additional mechanisms for the implementation of path integration, e.g. through ramping activity (cf. Tennant et al., 2022). Alternatively, mice could in principle estimate track location with a system that utilises information about distance travelled obtained from task-independent grid representations. If multiple mechanisms support path integration then it will be important to establish when each contributes. For example, because grid representations are available on the first entry to an environment they may be important for behaviour in newly experienced locations, whereas for familiar locations complementary representational strategies that emerge with learning may be sufficient.

Ideas and speculation

Our results point to a specific role for grid firing in path integration-dependent behaviour, and demonstrate the importance of anchoring of grid representations to task environments. One implication of our results is that rather than being an ‘always on’ tracking system, grid cell networks vary in their engagement with the environment. This may reflect control of the grid network by attentional or other top-down mechanisms. Alternatively, as the CA1 region of the hippocampus provides a major input to the MEC, instability of grid anchoring could be an indirect consequence of mechanisms that control the structure and stability of place cell maps (Krishnan et al., 2022; Pettit et al., 2022). In either case, our results motivate a focus on grid cell activity in tasks that require path integration, while an implication of our finding for investigations of grid cell activity using cue-rich environments is that in these experimental settings grid cells may not be influencing behavioural outcomes. Our results also offer a new perspective on interindividual differences in path integration by humans (e.g. Chrastil et al., 2017; Lakshminarasimhan et al., 2018; Petzschner and Glasauer, 2011). Thus, rather than resulting from variation in path integration per se, differences between individuals could instead result from variation in the anchoring of grid representations underlying path integration. This could be important as a potential mechanism for deficits in spatial localisation associated with neurological and neurodevelopmental disorders (Kunz et al., 2015; Newton et al., 2023; Noel et al., 2020).

Materials and methods

Key resources table.

Reagent type (species) or resource Designation Source or reference Identifiers Additional information
Strain, strain background (mouse) C57BL/6 In-house breeding NA NA
Software, algorithm R NA 4.2.3 https://www.r-project.org/
Software, algorithm Python NA 3.8.1 https://www.python.org/
Software, algorithm ImageJ Fiji NA https://fiji.sc
Software, algorithm Blender NA 2.7 https://www.blender.org/
Software, algorithm Open Ephys NA 0.4.4 https://open-ephys.org/
Software, algorithm CTAn NA 1.13.5.1 NA
Other EIB-16 NeuralLynx Cat# 31-0603-0106 NA
Other Platinum/Iridium wire NeuralLynx NA NA
Other Gold Plating Solution 20 ml Gold Plating Solution NA
Other Headpost RIVETS NA https://dudmanlab.org/html/rivets.html
Other UV curing dental cement RelyX Cat# 56874 https://www.3m.co.uk/3M/en_GB/p/d/b00007450/
Other Simplex Rapid Kemdent Cat# ACR803 https://www.kemdent.co.uk/simplex-rapid-powder-clear-225g?osCsid=j0b5160aallnl2kcdtjpas4oj1
Other Omnetics to Mill-Max adaptor Axona HSADPT-NN1 NA
Other RHD 6 ft ultrathin SPI cable Intan Cat# C3206 https://open-ephys.org/
Other RHD 6 ft standard SPI cable Intan Cat# C3218 https://intantech.com/
Other Acquisition board Open Ephys NA https://open-ephys.org/

­All experiments were carried out under a UK Home Office project licence, were approved by the Animal Welfare and Ethical Review Board of the University of Edinburgh College of Medicine and Veterinary Medicine, and conformed with the UK Animals (Scientific Procedures) Act 1986 and the European Directive 86/609/EEC. Nine male C57BL/6J mice were used in this study. Three of the nine mice used here were also part of a previous study (Tennant et al., 2022).

Microdrive fabrication and surgical procedures

Microdrive fabrication and surgical procedures were similar to our previous work (Gerlei et al., 2020; Tennant et al., 2022). Microdrives containing four tetrodes were built by threading 90% platinum, 10% iridium tetrode wires (18 µm HML-coated, Neuralynx) to an EIB-16 board (Neuralynx) via an inner cannula (21 gauge 9 mm long). The board was covered in epoxy and a poor lady frame (Axona) cemented to the side. An outer cannula (17 gauge 7 mm), placed around the inner cannula, was secured temporarily using vaseline, allowing it to be lowered during the surgery. Tetrodes were trimmed to ~3 mm using ceramic scissors (Science Tools, Germany) and gold-plated (Non-cyanide Gold Plating Solution, Neuralynx) to give an impedance between 150 and 200 kΩ at 1 kHz.

Before surgery, tips of the tetrodes were washed with ethanol and then sterile saline. Anaesthesia was induced using 5% isoflurane/95% oxygen, and sustained at 1–2% isoflurane/98–99% oxygen. After exposing the surface of the skull a RIVETS headpost (Osborne and Dudman, 2014) was attached to the skull with UV curing resin cement (RelyX Unicem, 3M). For electrical grounding, two M1 ×4 mm screws (AccuGroup SFE-M1-4-A2) were implanted through small craniotomies drilled on the left hemisphere ~3.4 mm lateral, and ~1 mm rostral relative to Bregma and the centre of the intraparietal plate, respectively. The microdrive was attached to a stereotaxic frame via an Omnetics to Mill-Max adaptor (Axona, HSADPT-NN1) and the tetrodes lowered 1.2–1.4 mm into the right hemisphere of the brain, beginning at 3.4 mm lateral from Bregma and along the lambdoid suture, and at an angle of –15 degrees in the posterior direction. The outer cannula was lowered and sealed with sterile vaseline, and the implant fixed to the skull with UV curing resin. After the resin hardened, the grounding wires were wrapped around the grounding screws and fixed with silver paint (RS components 101-5621). The grounding screws were covered with resin and any holes filled with dental cement (Simplex Rapid). After the surgery, mice recovered for ~20 min on a heat mat, had unlimited access to Vetergesic jelly (0.5 mg/kg of body weight buprenorphine in raspberry jelly) for 12 hr, and before proceeding were given a minimum of 2 days postoperative recovery.

Behavioural and electrophysiological recording

The behavioural setup, training procedures, and recording approaches were similar to those described previously (Tennant et al., 2022; Tennant et al., 2018). Mice were handled twice a day for 7 days following surgery. They were then habituated to the virtual reality setup for 10–20 min per day over 2 consecutive days. After each habituation session the mice were given access to soy milk to familiarise them with the reward and were given access to an open arena for 5–10 min of free exploration. From 4 to 5 days before starting training their access to food was restricted so that their body weight was ~85% of its baseline value, calculated from its weight prior to restriction and normalised to the expected daily growth for the animal’s age.

Experimental days involved recording from mice in the open arena and then in the virtual location memory task. On a few days this order was reversed without apparent effects on the results obtained. Mice were collected from the holding room 30–60 min before recording, were handled for 5–10 min, weighed and placed for 10–20 min in a cage containing objects and a running wheel. Between recording sessions mice were placed back in the object-filled playground for 30 min. Tetrodes were typically lowered by 50–100 µm after each session. The open arena consisted of a metal box with a square floor area, removable metal walls, metal frame (Frame parts from Kanya UK, C01-1, C20-10, A33-12, B49-75, B48-75, A39-31, ALU3), and an A4-sized cue card in the middle of one of the metal walls. For the open-field exploration session, mice were placed in the open arena while tethered via an ultrathin SPI cable and custom-build commutator and left unprompted for 30 min to freely move around. For the location memory task mice were trained to obtain rewards at a location on the virtual linear track. Mice were head-fixed using a RIVETS clamp (Ronal Tool Company, Inc) and ran on a cylindrical treadmill fitted with a rotary encoder (Pewatron). Virtual tracks, generated using Blender3D (blender.com) had length 200 cm, with a 60 cm track zone, a 20 cm reward zone, a second 60 cm track zone, and a 60 cm black box to separate successive trials. The distance visible ahead of the mouse was 50 cm. The reward zone was either marked by distinct vertical green and black bars on ‘beaconed’ trials, or was not marked by a visual cue at all on ‘non-beaconed’ or ‘probe’ trials. A feeding tube placed in front of the animal dispensed soy milk rewards (5–10 µl per reward) if the mouse stopped in the reward zone, however was not dispensed on probe trials. A stop was registered in Blender3D if the speed of the mouse dropped below 4.7 cm/s. Speed was calculated on a rolling basis from the previous 100 ms at a rate of 60 Hz.

Trials were delivered in repeating blocks throughout a recording session. For example, three beaconed trials (B) followed by two non-beaconed trials (N) with the order repeating until the end of the session. To encourage learning and engagement in both beaconed and non-beaconed trials, the first day of training typically used a trial type ratio of three beaconed trials to one non-beaconed trials. As training progressed we then increased the proportion of non-beaconed trials up to a ratio of one beaconed trial to four non-beaconed trials. Examples of trial blocks include BBBBN, BBBN, BBN, BN, BNN, BNNN, BBNNN, and BBNNNNNNN where each character indicates the trial type of each trial within a block. In some sessions we replaced single non-beaconed trials in trial blocks with a probe trial (P). Examples of trial blocks with probe trials include BBBBNBBBBP, BBBNBBBP, BBNBBP, and BBNNNNNNNP. The ratio and order of trial type delivery was not found to affect the results obtained (Figure 3—figure supplement 7).

Electrophysiological signals were acquired using an Intan headstage connected via an SPI cable (Intan Technologies, RHD2000 6 ft [1.8 m] standard SPI interface cable) attached to an Open Ephys acquisition board. Signals were filtered (2.5–7603.8 Hz). For the location memory task, behavioural variables including position, trial number, and trial type were calculated in Blender3D at 60 Hz and sent via a data acquisition (DAQ) microcontroller (Arduino Due) to the OpenEphys acquisition board. In the open arena, motion and head-direction tracking used a camera (Logitech B525, 1280×720 pixels Webcam, RS components 795-0876) attached to the frame. Red and green polystyrene balls were attached to the sides of the headstage and were tracked using a custom script written in Bonsai (Lopes and Monteiro, 2021). Synchronisation of position and electrophysiology data used an LED attached to the side of the open arena in the field of view of the camera, with randomly timed trigger pulses sent to the LED via an Arduino board (Arduino Uno) and to the Open Ephys acquisition board via the I/O board.

Following experiments, tetrodes were localised using a microCT scanner (Source data 1 and 2). Mice were anaesthetised with isoflurane and then a lethal dose of sodium pentobarbital (Euthatal, Meridal Animal Health, UK) were perfused with a mixture of PFA and glutaraldehyde, and the head with the microdrive still intact on the skull left in the same solution for two nights. All tissue and bone except that attached to the microdrive was removed before washing the brains in ddH2O and incubating at 4°C for 2 weeks in 2% osmium tetroxide (2% OsO4). Brains were then washed in ddH2O, dehydrated in ethanol and then embedded in resin. After the resin had cured the brains were imaged in a microCT scanner (Skyscan 1172, Bruker, Kontich, Belgium). Scanning parameters were: source voltage 54 kV, current 185 μA, exposure 885 ms with a 0.5 mm aluminium filter between the X-ray source and the sample. The scan dataset was reconstructed (CTAn software, v1.13.5.1) and viewed with DataViewer (Bruker). Tetrodes were localised relative to landmarks in version 2 of the Allen Reference Atlas for the mouse brain (https://mouse.brain-map.org/static/atlas) (see Source data 1 and 2).

Spike sorting

Spikes were isolated from electrophysiological data using an automated pipeline based on MountainSort (v0.11.5 and dependencies) (Chung et al., 2017; Gerlei et al., 2020). Recordings from the open-field and virtual reality tasks were concatenated for spike sorting. Pre-processing steps converted Open Ephys files to mda format, filtered signals between 600 and 6000 Hz, and performed spatial whitening over all channels. Events were detected from peaks >3 standard deviations (SD) above baseline and separated by at least 0.33 ms from other events on the same channel. The first 10 principal components of the detected waveforms were used as inputs to the ISOSPLIT algorithm. Cluster quality was evaluated using isolation, noise overlap, and peak signal-to-noise ratio metrics (Chung et al., 2017). Units with firing rate >0.2 Hz, isolation >0.9, noise overlap <0.05, and peak signal-to-noise ratio >1 were used for further analysis. Downstream analyses were carried out using Python (v3.8.1) and R (v4.2.3).

Analysis of neural activity in the open arena

For analysis of neural activity in the open arena, firing rate maps were calculated by binning spikes into 2.5 cm bins, dividing by the total time occupied in each bin and then smoothed with a Gaussian kernel. Autocorrelograms were calculated by sliding the rate map over all x and y bins and calculating a correlation score. Grid scores were defined as the difference between the minimum correlation coefficient for rate map autocorrelogram rotations of 60 and 120 degrees and the maximum correlation coefficient for autocorrelogram rotations of 30, 90, and 150 degrees (see Sargolini et al., 2006). Fields were detected in the autocorrelogram by converting it into a binary array using 20% of the maximal correlations as a threshold. If the binary array had more than seven local maxima, a grid score was calculated. Correlations between the rotated autocorrelograms were then calculated using a ring containing the six local maxima closest to the centre of the binary array and excluding the maximum at the centre. The ring was detected based on the average distance of the six fields near the centre of the autocorrelogram (middle border=1.25 * average distance, outer border=0.25 * average distance). To compute the spatial stability of cells in the open arena, the within-session spatial correlation was calculated by computing the Pearson correlation between the firing rate map from the first half session and the second half session. Bins that were not visited in both halves were excluded from the calculation. Neurons were classified as grid cells when their grid score and spatial stability score was in the 99th percentile of the same scores from 1000 shuffled datasets. Shuffled spike data was generated by drawing a single value from a uniform distribution between 20 and 580 s and adding this to the timestamp of each spike. Spike times that exceeded the recording duration were wrapped to the start of the session. Spike locations were recomputed from the shuffled spike times and spatial scores recalculated.

Analysis of behaviour during the location memory task

Plots of running speed as a function of location on the virtual track were generated by first binning speed into 1 cm location bins for each trial and then smoothing by convolution with a Gaussian filter (SD=2 cm, SciPy Python package).

Trials were classified into hits and misses based on whether the mouse stopped (speed <4.7 cm/s) within the reward zone. Miss trials were further split by comparing their average speeds in the reward zone to hit trials; the 95th percentile of speeds in the reward zone for hit trials was used to discriminate between try trials (<95th percentile speed) and run trials (>95th percentile speed; Figure 5—figure supplement 1). Trials in which the mouse’s average speed outside of the reward zone was <10 cm/s were left unclassified.

To compute stop density profiles (e.g. Figure 5C–F), stops were counted within 1 cm location bins and the counts were divided by the number of trials to obtain the number of stops per cm per trial. This was smoothed by convolution with a Gaussian filter (SD=1 cm). To evaluate the stop density when aggregating sessions or for epochs of trials within a session (e.g. Figure 6A and C), the same procedure was applied to first generate a stop density profile for the trials of interest within a session. We then subtracted an average of density profiles calculated in the same way for shuffled data from the same trials but in which stop locations were randomly drawn from a uniform distribution of track locations. In this way, stop densities below zero in the subtracted profiles can be interpreted as below chance relative to their average shuffled distributions, and stop densities greater than zero can be interpreted as greater than chance. Aggregate stop density profiles were then generated by averaging the individual subtracted profiles. Where average stop density plots were shown for coding epochs (e.g. Figure 6C, Figure 6—figure supplement 2E), these were weighted both on the proportion of trials classified in a particular coding scheme (e.g. a code weight of 0.05 when 5% of trials were classified as task-anchored for a single grid cell) and the number of simultaneously recorded grid cells such that single sessions were weighted equally (e.g. a session weight of 0.2 [1/5] when five grid cells are simultaneously recorded in a session). Similar weighted averages were also applied to plots where the proportion of hit, try, and run trials differed within a session in a similar vein (Figure 6E, Figure 6—figure supplement 2G).

Analysis of neural activity during the location memory task

Firing rate maps for each trial were generated by dividing the track into 1 cm bins, summing the number of spikes in each bin, and dividing by the time the animal spent there. Firing rates were smoothed with a Gaussian filter (SD =2 cm). Spatial information was calculated in bits per second as

i=1NPiλilog2(λiλ)

where i indexes a position bin in the firing rate map, N is the number of bins, Pi is the occupancy probability, λi is the firing rate in the bin, and λ is the mean firing rate (Skaggs and McNaughton, 1996). When spatial information scores were generated for epochs within a session, we took the same number of trials for each epoch (e.g. when comparing task-anchored and task-independent epochs). This was done by randomly subsetting the epoch with the greater number of trials to match the number of trials of the epoch with the smaller number of trials.

To quantify the spatial periodicity of neural firing, the Lomb-Scargle method of least squares spectral analysis (LSSA) as implemented by the Astropy Python module (Price-Whelan et al., 2022) was used to generate a frequency spectrum in the spatial domain (Lomb, 1976; Scargle, 1982). A periodogram was computed every 10 cm with a sample length equal to three track lengths (600 cm). Track locations were normalised between 0 and 1 so that spatial frequencies corresponded to the number of oscillations per trial. Spatial frequencies >5 were discarded from further analysis as no grid cells were found with grid spacings <40 cm. Individual periodograms were combined to create an average periodogram across the session (Figure 1—figure supplement 1 for an illustrative example).

To distinguish spatially periodic firing from aperiodic firing (Figure 2), we compared the spectral peaks from a cell’s averaged periodogram to a false alarm threshold. The threshold was calculated with a bootstrapping method that used 1000 shuffled instances of the cell’s firing, with the aim of disrupting spatial periodicity while preserving any local temporal firing. This was inspired by the field shuffle procedure used for grid cells in two-dimensional environments (Barry and Burgess, 2017). First, firing fields were identified by detecting the peaks and troughs in a smoothed version of the cell’s firing rate map (convolution with a Gaussian filter, SD=4 cm) with a minimum peak distance of 20 cm, smaller peaks were removed until all conditions of the detection were satisfied using the SciPy function scipy.signal.find_peaks. Fields were defined as the region between adjacent troughs. The field positions were reallocated in an unsmoothed rate map to random positions, preserving the spatial organisation of the field, while bins not attributed to a firing field filled the remaining gaps. The shuffled unsmoothed rate map was then smoothed by convolution with a Gaussian filter (SD=2 cm) and the periodogram calculated. This was repeated 1000 times and the 99th percentile calculated from the distribution of shuffled peak powers used to create the false alarm threshold. Cells with a measured peak power below this threshold were classified as aperiodic (Figure 1—figure supplement 2 for an illustrative example).

To establish whether periodic cells had activity anchored to the track we calculated the difference between the peak spatial frequency of their periodogram and the nearest positive-integer value. We identified task-anchored periodic cells as those for which the difference was ≤0.05, and task-independent period cells as those for which the difference was >0.05. Using this metric yielded high prediction accuracies when comparing our classification to true labels when we simulated task-anchored or task-independent grid cells (Figure 1—figure supplement 5).

To classify activity within a recording session, we calculated average periodograms across a rolling window with a size of 200 individual periodograms, which equated to 10 trials (considering 20 samples per 200 cm track with 10 cm steps between periodogram increments). The peak of the average periodogram from a single window was identified, and the peak power and the spatial frequency at which this occurred extracted. To determine if the peak reflected a periodic signal, it was compared with an adjusted false alarm threshold (see below). Windows with periodograms containing peaks above the threshold were then classified as task-anchored or task-independent as for session-level periodograms, while other windows were classified as aperiodic. To classify at the level of individual trials, midpoints of each rolling window were extracted and assigned to trial numbers by assessing which trial number the midpoint was closest to. For example, a rolling window with a midpoint of 10.4 would be assigned to trial number 10, while a midpoint of 10.6 (or 10.5 in border cases) would be assigned to trial number 11. All rolling windows with their respective classifications from a single trial would be pooled and counted. The classification with the most counts for that trial number would then be assigned to that trial (Figure 3—figure supplement 1 for an illustrative example). When assigning a common classification across a group of cells recorded simultaneously (e.g. Figure 4B), we used the mode of their classification, in cases where the group only contained two cells and there was not 100% agreement between these two cells, one cell was selected at random to represent the common population code.

To select the optimal rolling window size we considered how the false alarm threshold changes as a function of the number of periodograms used to compute the average periodogram (Figure 3—figure supplements 1 and 2). As the number of samples within the rolling window increases, the false alarm threshold decreases (Figure 3—figure supplement 3). To account for this, an adjusted false alarm threshold was calculated using the first 200 periodograms from a field shuffle to compute an average periodogram. This was repeated for 1000 field shuffles and the 99th percentile of the peak powers used as the adjusted false alarm threshold. We also found that the number of periodograms used to calculate the average periodogram greatly affected the prediction accuracy and bias. We opted for a rolling window size equal to 200 periodograms as this was found to achieve high accuracy with minimal bias (Figure 3—figure supplement 2).

To calculate the coding agreement between any two simultaneously recorded cells, the coding schemes were compared across the course of the session. The agreement score for a cell pair was equal to the percentage of trial classifications that agreed. In order to compare the measured agreement against chance for any cell pair, shuffled arrangements of trial classifications were generated for one of the two cells by splicing the trial classification raster where consecutive trials switch coding schemes and then reordering them at random (Figure 4D). This procedure was repeated 10 times for each cell pair and agreement scores calculated accordingly. Where shuffled agreement scores are visualised (Figure 4E), the average of the shuffled agreement scores are shown.

A potential weakness of the Lomb-Scargle method that we used for trial-level classification is that the window over which classification is made has limited resolution, while simulations on artificial data suggested that classification could be biassed towards task-independent firing depending on how frequent transitions between coding schemes occur. We therefore implemented a second method for trial-level classification (Figure 6—figure supplement 2). With this method we first created an average firing rate profile of the task-anchored trials obtained from the Lomb-Scargle method. We then used this average as a template which we correlated with the firing rate profile of each trial. For analyses in Figure 6—figure supplement 2, trials with a correlation coefficient ≥0.5 were then classified as task-anchored positive (TA+) and task-anchored negative (TA-) otherwise. We note that when using this method we discarded units for which less than 15% of trials were originally classified as task-anchored, as for these units we were unable to generate templates of sufficient quality.

Simulation of firing during the location memory task

To evaluate classification of grid firing as task-anchored or task-independent, we first simulated various cell types including grid cells, place cells, ramp cells, and aperiodic cells (Figure 1—figure supplement 4). For each cell type, we simulated an agent moving with a constant velocity of 10 cm/s across 100 trials of a 200 cm long linear track and logged the locations visited with a sampling rate of 1000 Hz. For each cell type, the probability of firing at any given location was defined by a probability density function (PDF) with a range of 0–1. The average firing rate was set by multiplying this normalised PDF by a scalar variable Pmax(spike) which by default was set to 0.1. Firing events were then assigned to each sampled location based on the scaled PDF. Firing rate maps and subsequent periodograms were created as described above.

PDFs for grid cells were created by positioning Gaussians kernels at equidistant locations along the track, with kernel SD equal to 0.1 multiplied by a given grid spacing between the kernels. To simulate task-anchored grid codes, the Gaussian kernels were positioned at the same track location on each trial, whereas to simulate task-independent grid codes the kernels were positioned independently from the track with distances equal to the grid spacing. To simulate field jitter, a displacement of the kernel position was drawn from another Gaussian distribution with mean=0 cm and SD=0 cm (for no jitter) or SD=10 cm (for default jitter). A random jitter was drawn for each field and was used to shift fields accordingly. The PDF for the place cell example was made up of a singular Gaussian kernel (mean=100 cm, SD=10 cm) positioned at the centre of the track and was repeated every trial. The PDF for the ramp cell example consisted of a linear ramp from the start of the track (0 cm) to the end of the track (200 cm). The PDF for the ‘random field’ cell was created by first generating the PDF for the place cell example and then passing this through the field shuffle as described (see Figure 1—figure supplement 2). The PDF for the Gaussian noise example was a uniform distribution.

To generate PDFs of grid cells alternating between task-anchored and task-independent codes, representations of each type were generated and merged (Figure 3—figure supplement 2). Considering the rolling classification computes a prediction label across a number of trials, we reasoned the manner and frequency of the alternation would affect prediction. We simulated this alternation in both blocks of trials and at the level of single trials. For the simulations that alternated in blocks of trials, the initial trial was randomly assigned to either the task-anchored PDF or the task-independent PDF with equal probability. For all subsequent trials there was a 10% chance of alternating to the other PDF (e.g. task-anchored to task-independent or task-independent to task-anchored). For simulations that alternated at the level of single trials, every trial was randomly assigned to either the task-anchored PDF or the task-independent PDF, with equal probability.

To evaluate our classification of periodic firing at the level of individual cells, we simulated 500 task-anchored grid cells and 500 task-independent grid cells with grid spacings uniformly distributed between 40 and 400 cm and compared the true labels of these simulated cells with the predicted classifications (Figure 1—figure supplement 5). To determine what spatial frequency tolerance to use in our classification, we classified the simulated dataset across the full range of spatial frequency thresholds. This was repeated using a range of Pmax(spike) and jitter SD values. To simplify the analysis, no field shuffle was computed on simulated data and therefore no false alarm threshold was used. This effectively forced our classifier to label cells as task-anchored or task-independent without the possibility of an aperiodic label. The prediction accuracy was calculated as the percentage of true task-anchored and task-independent coding grid cells with a correct prediction label. The prediction bias was calculated as the percentage of actual task-anchored cells minus the percentage of predicted task-anchored cells. As the classification in the simulation analysis had only two valid labels, positive bias represents over classification as task-independent whereas negative bias represents over classification as task-anchored. In plots showing prediction bias, positive and negative bias is relabeled to reflect this.

To evaluate classification of periodic firing at the level of individual trials, we simulated 100 grid cells with grid spacings uniformly distributed between 40 and 400 cm that could alternate between task-anchored and task-anchored task-independent coding task-independent either in blocks of trials or every trial (see above) and compared the true labels of these simulated cells and trials with the predicted classifications (Figure 3—figure supplement 2). To determine how many periodograms to average over (or if any), we classified the simulated dataset across a range of rolling window sizes to map at what rolling window size we could maximise prediction accuracy and minimise bias between task-anchored and task-independent classifications. Again, this was repeated using a range of Pmax(spike) and jitter SD values and no field shuffles were computed. The prediction accuracy of our classification was calculated as the average percentage of true task-anchored and task-independent coding trials with a correct prediction label. The prediction bias was calculated as the average percentage of actual task-anchored trials minus the percentage of predicted task-anchored trials across cells.

Statistical analyses

Group comparisons used linear mixed effect models (Figures 2F4E–F, Figure 3—figure supplement 4) or generalised linear mixed effect models (Figures 4E, 6B and D–F) implemented using lme4 (Bates et al., 2015), lmerTest (Kuznetsova et al., 2017), and glmmTMB (Brooks et al., 2017) packages within R (R Development Core Team, 2021), with model comparisons using ANOVA and post-fitting pairwise comparisons (Searle et al., 1980) using estimated marginal means (Lenth et al., 2024). Fits of firing rate, spatial information, and peak width in Figures 2F and 3G and Figure 3—figure supplement 4A-B, D used log transformed data. Fits in Figure 4E (comparisons of shuffled data) used a beta family function, and in Figure 6 used a binomial family function with logit linker. Random effects had a nested structure to account for animals and sessions (all models), and where appropriate neuron identity (Figures 4E and 6). For analyses in Figure 6, trials classified as ‘aperiodic’ were removed from the dataset to facilitate direct comparison of trials with task-anchored and task-independent aperiodic grid firing. To estimate the effect size of the relative influence of task-anchored firing versus task-independent firing on task performance (Figure 6F), odds ratios and confidence intervals were extracted from the full model using sjPlot (Lüdecke et al., 2023).

Acknowledgements

We thank Caswell Barry for helpful discussions. This work was supported by the Wellcome Trust (200855/Z/16/Z to MFN), MRC Precision Medicine PhD programme (MR/S502479/1 to HC), and the Simons Initiative for the Developing Brain (to MFN). This work made use of resources provided by the Edinburgh Compute and Data Facility. For the purpose of open access, the author has applied a CC BY public copyright license to any author accepted manuscript version arising from this submission.

Funding Statement

For the purpose of Open Access, the authors have applied a CC BY public copyright license to any Author Accepted Manuscript version arising from this submission.

Contributor Information

Matthew F Nolan, Email: mattnolan@ed.ac.uk.

Lisa M Giocomo, Stanford School of Medicine, United States.

Laura L Colgin, University of Texas at Austin, United States.

Funding Information

This paper was supported by the following grants:

  • Medical Research Council MR/S502479/1 to Harry Clark.

  • Wellcome Trust 10.35802/200855 to Matthew F Nolan.

  • Simons Initiative for the Developing Brain to Matthew F Nolan.

Additional information

Competing interests

No competing interests declared.

Author contributions

Conceptualization, Data curation, Formal analysis, Investigation, Visualization, Methodology, Writing - original draft, Writing - review and editing.

Conceptualization, Formal analysis, Supervision, Writing - original draft, Project administration, Writing - review and editing.

Ethics

All experiments were carried out under a UK Home Office project licence, were approved by the Animal Welfare and Ethical Review Board of the University of Edinburgh College of Medicine and Veterinary Medicine, and conformed with the UK Animals (Scientific Procedures) Act 1986 and the European Directive 86/609/EEC.

Additional files

Supplementary file 1. Summary table of recorded cells and estimated tetrode locations.
elife-89356-supp1.docx (16.8KB, docx)
MDAR checklist
Source data 1. MicroCT imaging for tetrode localisation 1/2.
elife-89356-data1.png (5.9MB, png)
Source data 2. MicroCT imaging for tetrode localisation 2/2.
elife-89356-data2.png (5.8MB, png)

Data availability

Data have been deposited at Edinburgh DataShare and code at GitHub (copy archived at Zenodo).

The following datasets were generated:

Clark and Nolan 2024. Task-anchored grid cell firing is selectively associated with successful path integration-dependent behaviour. Edinburgh DataShare.

Clark HD. 2024. MattNolanLab/eLife_Grid_anchoring_2024: v1.0.0.0. Zenodo.

The following previously published dataset was used:

Clark et al. 2022. Spatial representation by ramping activity of neurons in the retrohippocampal cortex. Edinburgh DataShare.

References

  1. Barry C, Hayman R, Burgess N, Jeffery KJ. Experience-dependent rescaling of entorhinal grids. Nature Neuroscience. 2007;10:682–684. doi: 10.1038/nn1905. [DOI] [PubMed] [Google Scholar]
  2. Barry C, Burgess N. To be a grid cell: shuffling procedures for determining “gridness.”. bioRxiv. 2017 doi: 10.1101/230250. [DOI]
  3. Bates D, Mächler M, Bolker BM, Walker SC. Fitting linear mixed-effects models using lme4. Journal of Statistical Software. 2015;67:1–48. doi: 10.18637/jss.v067.i01. [DOI] [Google Scholar]
  4. Brooks M, Kristensen K, Benthem K, Magnusson A, Berg C, Nielsen A, Skaug H, Mächler M, Bolker B. glmmtmb balances speed and flexibility among packages for zero-inflated generalized linear mixed modeling. The R Journal. 2017;9:378. doi: 10.32614/RJ-2017-066. [DOI] [Google Scholar]
  5. Brun VH, Leutgeb S, Wu HQ, Schwarcz R, Witter MP, Moser EI, Moser MB. Impaired spatial representation in CA1 after lesion of direct input from entorhinal cortex. Neuron. 2008;57:290–302. doi: 10.1016/j.neuron.2007.11.034. [DOI] [PubMed] [Google Scholar]
  6. Campbell MG, Ocko SA, Mallory CS, Low IIC, Ganguli S, Giocomo LM. Principles governing the integration of landmark and self-motion cues in entorhinal cortical codes for navigation. Nature Neuroscience. 2018;21:1096–1106. doi: 10.1038/s41593-018-0189-y. [DOI] [PMC free article] [PubMed] [Google Scholar]
  7. Casali G, Shipley S, Dowell C, Hayman R, Barry C. Entorhinal neurons exhibit cue locking in rodent VR. Frontiers in Cellular Neuroscience. 2018;12:512. doi: 10.3389/fncel.2018.00512. [DOI] [PMC free article] [PubMed] [Google Scholar]
  8. Chrastil ER, Sherrill KR, Aselcioglu I, Hasselmo ME, Stern CE. Individual differences in human path integration abilities correlate with gray matter volume in retrosplenial cortex, hippocampus, and medial prefrontal cortex. ENEURO. 2017;4:ENEURO. doi: 10.1523/ENEURO.0346-16.2017. [DOI] [PMC free article] [PubMed] [Google Scholar]
  9. Chung JE, Magland JF, Barnett AH, Tolosa VM, Tooker AC, Lee KY, Shah KG, Felix SH, Frank LM, Greengard LF. A fully automated approach to spike sorting. Neuron. 2017;95:1381–1394. doi: 10.1016/j.neuron.2017.08.030. [DOI] [PMC free article] [PubMed] [Google Scholar]
  10. Domnisoru C, Kinkhabwala AA, Tank DW. Membrane potential dynamics of grid cells. Nature. 2013;495:199–204. doi: 10.1038/nature11973. [DOI] [PMC free article] [PubMed] [Google Scholar]
  11. Fiete IR, Burak Y, Brookings T. What grid cells convey about rat location. The Journal of Neuroscience. 2008;28:6858–6871. doi: 10.1523/JNEUROSCI.5684-07.2008. [DOI] [PMC free article] [PubMed] [Google Scholar]
  12. Gardner RJ, Hermansen E, Pachitariu M, Burak Y, Baas NA, Dunn BA, Moser MB, Moser EI. Toroidal topology of population activity in grid cells. Nature. 2022;602:123–128. doi: 10.1038/s41586-021-04268-7. [DOI] [PMC free article] [PubMed] [Google Scholar]
  13. Gaskin S, White NM. Temporary inactivation of the dorsal entorhinal cortex impairs acquisition and retrieval of spatial information. Neurobiology of Learning and Memory. 2010;93:203–207. doi: 10.1016/j.nlm.2009.09.012. [DOI] [PubMed] [Google Scholar]
  14. Gaskin S, White NM. Parallel processing of information about location in the amygdala, entorhinal cortex and hippocampus. Hippocampus. 2013;23:1075–1083. doi: 10.1002/hipo.22179. [DOI] [PubMed] [Google Scholar]
  15. Gerlei K, Passlack J, Hawes I, Vandrey B, Stevens H, Papastathopoulos I, Nolan MF. Grid cells are modulated by local head direction. Nature Communications. 2020;11:4228. doi: 10.1038/s41467-020-17500-1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  16. Gil M, Ancau M, Schlesiger MI, Neitz A, Allen K, De Marco RJ, Monyer H. Impaired path integration in mice with disrupted grid cell firing. Nature Neuroscience. 2018;21:81–91. doi: 10.1038/s41593-017-0039-3. [DOI] [PubMed] [Google Scholar]
  17. Ginosar G, Aljadeff J, Las L, Derdikman D, Ulanovsky N. Are grid cells used for navigation? On local metrics, subjective spaces, and black holes. Neuron. 2023;111:1858–1875. doi: 10.1016/j.neuron.2023.03.027. [DOI] [PubMed] [Google Scholar]
  18. Gu Y, Lewallen S, Kinkhabwala AA, Domnisoru C, Yoon K, Gauthier JL, Fiete IR, Tank DW. A map-like micro-organization of grid cells in the medial entorhinal cortex. Cell. 2018;175:736–750. doi: 10.1016/j.cell.2018.08.066. [DOI] [PMC free article] [PubMed] [Google Scholar]
  19. Hales JB, Schlesiger MI, Leutgeb JK, Squire LR, Leutgeb S, Clark RE. Medial entorhinal cortex lesions only partially disrupt hippocampal place cells and hippocampus-dependent place memory. Cell Reports. 2014;9:893–901. doi: 10.1016/j.celrep.2014.10.009. [DOI] [PMC free article] [PubMed] [Google Scholar]
  20. Hales JB, Vincze JL, Reitz NT, Ocampo AC, Leutgeb S, Clark RE. Recent and remote retrograde memory deficit in rats with medial entorhinal cortex lesions. Neurobiology of Learning and Memory. 2018;155:157–163. doi: 10.1016/j.nlm.2018.07.013. [DOI] [PMC free article] [PubMed] [Google Scholar]
  21. Hales JB, Reitz NT, Vincze JL, Ocampo AC, Leutgeb S, Clark RE. A role for medial entorhinal cortex in spatial and nonspatial forms of memory in rats. Behavioural Brain Research. 2021;407:113259. doi: 10.1016/j.bbr.2021.113259. [DOI] [PMC free article] [PubMed] [Google Scholar]
  22. Jacob PY, Capitano F, Poucet B, Save E, Sargolini F. Path integration maintains spatial periodicity of grid cell firing in a 1D circular track. Nature Communications. 2019;10:840. doi: 10.1038/s41467-019-08795-w. [DOI] [PMC free article] [PubMed] [Google Scholar]
  23. Keene CS, Bladon J, McKenzie S, Liu CD, O’Keefe J, Eichenbaum H. Complementary functional organization of neuronal activity patterns in the perirhinal, lateral entorhinal, and medial entorhinal cortices. The Journal of Neuroscience. 2016;36:3660–3675. doi: 10.1523/JNEUROSCI.4368-15.2016. [DOI] [PMC free article] [PubMed] [Google Scholar]
  24. Kinkhabwala AA, Gu Y, Aronov D, Tank DW. Visual cue-related activity of cells in the medial entorhinal cortex during navigation in virtual reality. eLife. 2020;9:e43140. doi: 10.7554/eLife.43140. [DOI] [PMC free article] [PubMed] [Google Scholar]
  25. Krishnan S, Heer C, Cherian C, Sheffield MEJ. Reward expectation extinction restructures and degrades CA1 spatial maps through loss of a dopaminergic reward proximity signal. Nature Communications. 2022;13:6662. doi: 10.1038/s41467-022-34465-5. [DOI] [PMC free article] [PubMed] [Google Scholar]
  26. Kunz L, Schröder TN, Lee H, Montag C, Lachmann B, Sariyska R, Reuter M, Stirnberg R, Stöcker T, Messing-Floeter PC, Fell J, Doeller CF, Axmacher N. Reduced grid-cell-like representations in adults at genetic risk for Alzheimer’s disease. Science. 2015;350:430–433. doi: 10.1126/science.aac8128. [DOI] [PubMed] [Google Scholar]
  27. Kuznetsova A, Brockhoff PB, Christensen RHB. lmerTest package: tests in linear mixed effects models. Journal of Statistical Software. 2017;82:i13. doi: 10.18637/jss.v082.i13. [DOI] [Google Scholar]
  28. Lakshminarasimhan KJ, Petsalis M, Park H, DeAngelis GC, Pitkow X, Angelaki DE. A dynamic bayesian observer model reveals origins of bias in visual path integration. Neuron. 2018;99:194–206. doi: 10.1016/j.neuron.2018.05.040. [DOI] [PMC free article] [PubMed] [Google Scholar]
  29. Lenth RV, Bolker B, Buerkner P, Giné-Vázquez I, Herve M, Jung M, Love J, Miguez F, Riebl H, Singmann H. Emmeans: estimated marginal means, Aka least-squares means. 1.10.0CRAN. 2024 https://CRAN.R-project.org/package=emmeans
  30. Lomb NR. Least-squares frequency analysis of unequally spaced data. Astrophysics and Space Science. 1976;39:447–462. doi: 10.1007/BF00648343. [DOI] [Google Scholar]
  31. Lopes G, Monteiro P. New open-source tools: using bonsai for behavioral tracking and closed-loop experiments. Frontiers in Behavioral Neuroscience. 2021;15:647640. doi: 10.3389/fnbeh.2021.647640. [DOI] [PMC free article] [PubMed] [Google Scholar]
  32. Low IIC, Williams AH, Campbell MG, Linderman SW, Giocomo LM. Dynamic and reversible remapping of network representations in an unchanging environment. Neuron. 2021;109:2967–2980. doi: 10.1016/j.neuron.2021.07.005. [DOI] [PMC free article] [PubMed] [Google Scholar]
  33. Lüdecke D, Bartel A, Schwemmer C, Powell C, Djalovski A, Titz J. sjPlot: data visualization for statistics in social science. 2.8.15CRAN. 2023 https://CRAN.R-project.org/package=sjPlot
  34. Mathis A, Herz AVM, Stemmler MB. Resolution of nested neuronal representations can be exponential in the number of neurons. Physical Review Letters. 2012;109:1–5. doi: 10.1103/PhysRevLett.109.018103. [DOI] [PubMed] [Google Scholar]
  35. McNaughton BL, Battaglia FP, Jensen O, Moser EI, Moser MB. Path integration and the neural basis of the “cognitive map.”. Nature Reviews. Neuroscience. 2006;7:663–678. doi: 10.1038/nrn1932. [DOI] [PubMed] [Google Scholar]
  36. Miao C, Cao Q, Ito HT, Yamahachi H, Witter MP, Moser MB, Moser EI. Hippocampal remapping after partial inactivation of the medial entorhinal cortex. Neuron. 2015;88:590–603. doi: 10.1016/j.neuron.2015.09.051. [DOI] [PubMed] [Google Scholar]
  37. Moser EI, Kropff E, Moser MB. Place cells, grid cells, and the brain’s spatial representation system. Annual Review of Neuroscience. 2008;31:69–89. doi: 10.1146/annurev.neuro.31.061307.090723. [DOI] [PubMed] [Google Scholar]
  38. Newton C, Pope M, Rua C, Henson R, Ji Z, Burgess N, Rodgers CT, Stangl M, Dounavi M-E, Castegnaro A, Koychev I, Malhotra P, Wolbers T, Ritchie K, Ritchie CW, O’Brien J, Su L, Chan D, PREVENT Dementia Research Programme Path integration selectively predicts midlife risk of alzheimer’s disease. bioRxiv. 2023 doi: 10.1101/2023.01.31.526473. [DOI] [PMC free article] [PubMed]
  39. Noel JP, Lakshminarasimhan KJ, Park H, Angelaki DE. Increased variability but intact integration during visual navigation in Autism Spectrum Disorder. PNAS. 2020;117:11158–11166. doi: 10.1073/pnas.2000216117. [DOI] [PMC free article] [PubMed] [Google Scholar]
  40. Osborne JE, Dudman JT. RIVETS: a mechanical system for in vivo and in vitro electrophysiology and imaging. PLOS ONE. 2014;9:e89007. doi: 10.1371/journal.pone.0089007. [DOI] [PMC free article] [PubMed] [Google Scholar]
  41. Pettit NL, Yuan XC, Harvey CD. Hippocampal place codes are gated by behavioral engagement. Nature Neuroscience. 2022;25:561–566. doi: 10.1038/s41593-022-01050-4. [DOI] [PMC free article] [PubMed] [Google Scholar]
  42. Petzschner FH, Glasauer S. Iterative Bayesian estimation as an explanation for range and regression effects: A study on human path integration. The Journal of Neuroscience. 2011;31:17220–17229. doi: 10.1523/JNEUROSCI.2028-11.2011. [DOI] [PMC free article] [PubMed] [Google Scholar]
  43. Price-Whelan AM, Lim PL, Earl N, Starkman N, Bradley L, Shupe DL, Patil AA, Corrales L, Brasseur CE, Nöthe M, Donath A, Tollerud E, Morris BM, Ginsburg A, Vaher E, Weaver BA, Tocknell J, Jamieson W, van Kerkwijk MH, Robitaille TP, Merry B, Bachetti M, Günther HM, Aldcroft TL, Alvarado-Montes JA, Archibald AM, Bódi A, Bapat S, Barentsen G, Bazán J, Biswas M, Boquien M, Burke DJ, Cara D, Cara M, Conroy KE, Conseil S, Craig MW, Cross RM, Cruz KL, D’Eugenio F, Dencheva N, Devillepoix HAR, Dietrich JP, Eigenbrot AD, Erben T, Ferreira L, Foreman-Mackey D, Fox R, Freij N, Garg S, Geda R, Glattly L, Gondhalekar Y, Gordon KD, Grant D, Greenfield P, Groener AM, Guest S, Gurovich S, Handberg R, Hart A, Hatfield-Dodds Z, Homeier D, Hosseinzadeh G, Jenness T, Jones CK, Joseph P, Kalmbach JB, Karamehmetoglu E, Kałuszyński M, Kelley MSP, Kern N, Kerzendorf WE, Koch EW, Kulumani S, Lee A, Ly C, Ma Z, MacBride C, Maljaars JM, Muna D, Murphy NA, Norman H, O’Steen R, Oman KA, Pacifici C, Pascual S, Pascual-Granado J, Patil RR, Perren GI, Pickering TE, Rastogi T, Roulston BR, Ryan DF, Rykoff ES, Sabater J, Sakurikar P, Salgado J, Sanghi A, Saunders N, Savchenko V, Schwardt L, Seifert-Eckert M, Shih AY, Jain AS, Shukla G, Sick J, Simpson C, Singanamalla S, Singer LP, Singhal J, Sinha M, Sipőcz BM, Spitler LR, Stansby D, Streicher O, Šumak J, Swinbank JD, Taranu DS, Tewary N, Tremblay GR, Val-Borro M, Van Kooten SJ, Vasović Z, Verma S, de Miranda Cardoso JV, Williams PKG, Wilson TJ, Winkel B, Wood-Vasey WM, Xue R, Yoachim P, Zhang C, Zonca A, Paper Authors. Astropy Project Contributors The astropy project: sustaining and growing a community-oriented open-source project and the latest major release (v5.0) of the core package*. The Astrophysical Journal. 2022;935:167. doi: 10.3847/1538-4357/ac7c74. [DOI] [Google Scholar]
  44. Qin H, Fu L, Hu B, Liao X, Lu J, He W, Liang S, Zhang K, Li R, Yao J, Yan J, Chen H, Jia H, Zott B, Konnerth A, Chen X. A visual-cue-dependent memory circuit for place navigation. Neuron. 2018;99:47–55. doi: 10.1016/j.neuron.2018.05.021. [DOI] [PMC free article] [PubMed] [Google Scholar]
  45. R Development Core Team . Vienna, Austria: R Foundation for Statistical Computing; 2021. https://www.r-project.org [Google Scholar]
  46. Rowland DC, Obenhaus HA, Skytøen ER, Zhang Q, Kentros CG, Moser EI, Moser MB. Functional properties of stellate cells in medial entorhinal cortex layer II. eLife. 2018;7:e36664. doi: 10.7554/eLife.36664. [DOI] [PMC free article] [PubMed] [Google Scholar]
  47. Sargolini F, Fyhn M, Hafting T, McNaughton BL, Witter MP, Moser MB, Moser EI. Conjunctive representation of position, direction, and velocity in entorhinal cortex. Science. 2006;312:758–762. doi: 10.1126/science.1125572. [DOI] [PubMed] [Google Scholar]
  48. Scargle JD. Studies in astronomical time series analysis: II - Statistical aspects of spectral analysis of unevenly spaced data. The Astrophysical Journal. 1982;263:835. doi: 10.1086/160554. [DOI] [Google Scholar]
  49. Schlesiger MI, Cannova CC, Boublil BL, Hales JB, Mankin EA, Brandon MP, Leutgeb JK, Leibold C, Leutgeb S. The medial entorhinal cortex is necessary for temporal organization of hippocampal neuronal activity. Nature Neuroscience. 2015;18:1123–1132. doi: 10.1038/nn.4056. [DOI] [PMC free article] [PubMed] [Google Scholar]
  50. Searle SR, Speed FM, Milliken GA. Population marginal means in the linear model: an alternative to least squares means. The American Statistician. 1980;34:216–221. doi: 10.1080/00031305.1980.10483031. [DOI] [Google Scholar]
  51. Skaggs WE, McNaughton BL. Theta phase precession in hippocampal. Hippocampus. 1996;6:149–172. doi: 10.1002/(SICI)1098-1063(1996)6:2&#x0003c;149::AID-HIPO6&#x0003e;3.0.CO;2-K. [DOI] [PubMed] [Google Scholar]
  52. Solstad T, Boccara CN, Kropff E, Moser MB, Moser EI. Representation of geometric borders in the entorhinal cortex. Science. 2008;322:1865–1868. doi: 10.1126/science.1166466. [DOI] [PubMed] [Google Scholar]
  53. Sreenivasan S, Fiete I. Grid cells generate an analog error-correcting code for singularly precise neural computation. Nature Neuroscience. 2011;14:1330–1337. doi: 10.1038/nn.2901. [DOI] [PubMed] [Google Scholar]
  54. Steffenach HA, Witter M, Moser MB, Moser EI. Spatial memory in the rat requires the dorsolateral band of the entorhinal cortex. Neuron. 2005;45:301–313. doi: 10.1016/j.neuron.2004.12.044. [DOI] [PubMed] [Google Scholar]
  55. Tennant SA, Fischer L, Garden DLF, Gerlei KZ, Martinez-Gonzalez C, McClure C, Wood ER, Nolan MF. Stellate cells in the medial entorhinal cortex are required for spatial learning. Cell Reports. 2018;22:1313–1324. doi: 10.1016/j.celrep.2018.01.005. [DOI] [PMC free article] [PubMed] [Google Scholar]
  56. Tennant SA, Clark H, Hawes I, Tam WK, Hua J, Yang W, Gerlei KZ, Wood ER, Nolan MF. Spatial representation by ramping activity of neurons in the retrohippocampal cortex. Current Biology. 2022;32:4451–4464. doi: 10.1016/j.cub.2022.08.050. [DOI] [PubMed] [Google Scholar]
  57. VanderPlas JT. Understanding the lomb–scargle periodogram. The Astrophysical Journal Supplement Series. 2018;236:16. doi: 10.3847/1538-4365/aab766. [DOI] [Google Scholar]
  58. Waaga T, Agmon H, Normand VA, Nagelhus A, Gardner RJ, Moser MB, Moser EI, Burak Y. Grid-Cell Modules Remain Coordinated When Neural Activity Is Dissociated from External Sensory Cues. bioRxiv. 2021 doi: 10.1101/2021.08.29.458100. [DOI] [PMC free article] [PubMed]
  59. Whittington JCR, McCaffary D, Bakermans JJW, Behrens TEJ. How to build a cognitive map. Nature Neuroscience. 2022;25:1257–1272. doi: 10.1038/s41593-022-01153-y. [DOI] [PubMed] [Google Scholar]
  60. Yoon K, Buice MA, Barry C, Hayman R, Burgess N, Fiete IR. Specific evidence of low-dimensional continuous attractor dynamics in grid cells. Nature Neuroscience. 2013;16:1077–1084. doi: 10.1038/nn.3450. [DOI] [PMC free article] [PubMed] [Google Scholar]

eLife assessment

Lisa M Giocomo 1

This valuable study examines the relationship between positional anchoring of grid cell activity and performance in spatial navigation tasks that require path integration. The authors demonstrate that grid cells can either fire in relation to the position relative to task-relevant virtual stimuli or independently based on the distance covered. Their findings convincingly reveal that mice exhibited better performance in the path integration task when grid cell activity was anchored to their position on the virtual track rather than the distance traversed, highlighting the contribution of grid firing to spatial navigation behavior. The work will be of interest to experimental and computational neuroscientists interested in spatial navigation.

Reviewer #1 (Public Review):

Anonymous

Summary:

In this study, Clark et. al. used electrophysiology approaches to measure MEC neuron activity while mice performed spatial memory tasks in one-dimensional virtual tracks, where the mice must stop in a specific reward zone for a reward. The authors identified that grid cell activity could either be anchored to the track reference frame ('task-anchored') or can maintain a periodic firing pattern independent of the track reference frame ('task-independent'). They found that in the task that requires path integration, good task performance is specifically associated with task-anchored grid cell activity.

Strength:

This study took advantage of the variation in neural activity and navigation task behaviors to answer an important question: how grid cell activity is associated with performance of spatial tasks. The mice performed individual trials where they must stop in a specific reward zone for a reward. Individual behavioral sessions could include three types of trials: (1) a visual cue at the reward location (beaconed trials), (2) no cue at the reward location (non-beaconed trials), and (3) no cue and no reward regardless of stopping (probe trials). The authors found that, interestingly, grid cell activity pattern could be anchored to task reference frame or maintain a periodic pattern independent of the reference frame. The anchoring of activity patterns could switch within a behavioral session. On the other hand, spatial firing of non-grid cells was either coherent with the grid population or was stably anchored to the task reference frame. Combining grid cell activity feature with task behaviors, they uncovered an association between the task-anchoring of grid cell activity with good performance in spatial navigation tasks that requires path integration (non-beaconed and probe trials). This work suggests the contribution of grid firing to path integration-dependent navigation.

Weakness:

It would be interesting to find out that on the trial-by-trial basis, whether the activity anchoring switched first, or the task behaviors altered first, or whether they happened within the same trial. This will potentially determine whether the encoding is causal for the behavior, or the other way around. However, based the authors explanation, their experimental design lacks sufficient statistical power to address the timing of mode switches within a trial, because task mode switching is relatively infrequent (so the n for switching is low) and only a subset of trials are uncued (making the relevant n even lower), while at a trial level the behavioral outcome is variable (increasing the required n for adequate power).

In addition, the authors reported that the activity anchoring of some non-grid cells coherently switched with grid cells, while others do not. They propose that the MEC implement multiple coding schemes. However, it is unclear whether and how the coding scheme is associated with behavior. It would be interesting to further investigate this question.

Reviewer #2 (Public Review):

Anonymous

Clark and Nolan's study aims to test whether the stability of grid cell firing fields is associated with better spatial behavior performance on a virtual task. Mice were trained to stop at a rewarded location along a virtual linear track. The rewarded location could be marked by distinct visual stimuli or be unmarked. When the rewarded location was unmarked, the animal had to estimate its distance run from the beginning of the trial to know where to stop. When the mouse reached the end of the virtual track, it was teleported back to the start of the virtual track.

The authors found that grid cells could fire in at least two modes. In the "task-anchored" mode, grid firing fields had stable positions relative to the virtual track. In the "task-independent" mode, grid fields were decoupled from the virtual cues and appeared to be located as a function of distance run on the track. Importantly, on trials in which the rewarded location was unmarked, the behavioral performance of mice was better when grid cells fired in the "task-anchored" mode. When a unique visual cue marked the reward location, navigation performance was not correlated with the grid cells' firing mode.

This study is very timely as there is a pressing need to identify/delimit the contribution of grid cells to spatial behaviors. More studies are needed in which grid cell activity is linked to navigational abilities. The link proposed by Clark and Nolan between "task-anchored" coding by grid cells and navigational performance is a significant step toward better understanding how grid cell activity might support behavioral behavior. The results also highlight that some forms of navigation (approaching a location marked by a visual cue) might be less dependent on the anchoring of grid cells.

It should be noted that the study by Clark and Nolan is correlative. Therefore, the effect of selective manipulations of grid cell activity on the virtual task will be needed to evaluate whether the activity of grid cells is causally linked to the behavioral performance on this task. A previous study by the same research group showed that inactivating the synaptic output of stellate cells of the medial entorhinal cortex affected mice's performance of the same virtual task (Tennant et al., 2018). Although this manipulation likely affects non-grid cells, it is still one of the most selective manipulations of grid cells that are currently available.

It is interesting to consider how grid cells remain anchored to virtual cues. Recent work shows that grid cell activity spans the surface of a torus (Gardner et al., 2022). A run on the track can be mapped to a trajectory on the torus. Assuming that grid cell activity is updated primarily from self-motion cues on the track and that the grid cell period is unlikely to be an integer of the virtual track length, having stable firing fields on the virtual track likely requires a resetting mechanism taking place on each trial. During this resetting event, the active location on the torus is likely to jump to a new toroidal location, independently of self-motion cues. Future studies in which large numbers of grid cells are recorded could pinpoint at which moment such resetting event occurs on each trial.

eLife. 2024 Mar 28;12:RP89356. doi: 10.7554/eLife.89356.3.sa3

Author response

Harry Clark 1, Matthew F Nolan 2

The following is the authors’ response to the original reviews.

We thank the editors and reviewers for their tremendously helpful comments. We outline below changes we have made to the manuscript in response to each point. These include new analyses and a substantial rewrite to address the concerns about lack of clarity.

We believe the revisions strengthen the evidence for our conclusion that grid fields can be either anchored to or independent from a task reference frame, and that anchoring is selectively associated with successful path integration-dependent behaviour. Our additional analyses of non-grid cells indicate that while some are coherent with the grid population, many are not, suggesting cell populations within the MEC may implement grid-dependent and grid-independent computations in parallel.

We hope the reviewers will agree that our novel experimental strategy complements and avoids limitations of perturbation-based approaches, and by providing evidence to dissociate the two major hypotheses for whether and when grid cells contribute to behaviour our results are likely to have a substantial impact on the field.

Public Reviews:

Reviewer #1 (Public Review):

In this study, Clark et. al. uncovered an association between the positional encoding of grid cell activity with good performance in spatial navigation tasks that requires path integration, highlighting the contribution of grid firing to behaviour… The conclusions of this paper are mostly well supported by data, the finding about the association between grid cell encoding and behaviour in spatial memory tasks is important. However, some aspects of the analysis need to be clarified or extended.

Thank you for the overview and constructive comments.

(1) While the current dataset aims to demonstrate a "correlation" between grid cell encoding and task performance, the other variables that could confound this correlation should be carefully examined.

(1.1) The exact breakdown of the fraction of beaconed/non-beaconed/probe trials is never shown. if the session makeup has a significant effect on the coding scheme or other results, this variable should be accounted for.

The lack of information about the trial organisation was a substantial oversight in our preparation of the first version of the manuscript. Session make up can not account for effects on grid stability and its relationship to behavioural outcome but this was not made at all clear.

In all sessions trial types were varied in a fixed repeating sequence. Therefore, continuous blocks of trials on which grid firing is anchored (or independent from) the track can not be explained by the mouse experiencing a particular trial type. We have revised the manuscript to make this clearer, e.g. p 5, ‘These switches could not be explained by variation between trials in the availability of cues or rewards, as these were interleaved in blocks that repeated throughout a session (see Methods), whereas periods in which grid cell activity was in a given mode extended across the repeating blocks (e.g. Figures 3D,E, 4A, 5E,F).’ and methods p 12, ‘Trials were delivered in repeating blocks throughout a recording session…’

(1.2) The manuscript did not provide information about whether individual mice experienced sessions with different combinations of the three trial types, and whether they show different preferences in position or distance encoding even in comparable sessions. This leads to the question of whether different behaviour and activity encoding were dominated by experimental or natural differences between individual mice. Presenting the data per mouse will be helpful.

As we note above, because trial types were interleaved in a fixed sequence, experience of a particular trial type can not account for switching between task-anchored and taskindependent firing modes. This was insufficiently clear in the first version of the manuscript.

We varied the proportions of trials of a particular type between sessions with the aim of maximising the number of non-beaconed and probe trials. This was necessary because we find that if we introduce too high a proportion of these trials early in training then mice appear to ‘lose interest’ in the task and their performance drops off. We therefore used an approach in which we increased the proportions of non-beaconed and probe trials over training days as mice became familiar with the task. This is now described in the methods (p 12).

Because the decision for when to vary the proportion of trial types was based on the previous day’s performance, the experimental design was not optimised for addressing the reviewer’s question about dissociating experimental from natural differences in mice. To provide some initial insight we have analysed the relationship between task anchored coding and proportion of beaconed trials in a session (Figure 3, Figure Supplement 7). While on average there is a higher proportion of trials in which grid fields are task-anchored in sessions with more beaconed trials, this effect is small and most of the variance is independent from the proportion of beaconed trials.

(1.3) Related to the above point, in Figure 5, the mice appeared to behave worse in probe trials than non-beaconed trials. If the mouse did not know if a trial is a probe or a non-beacon trial, they should behave equivalently until the reward location and thus should stop an equal amount. If this difference is because multiple probe trials are placed consecutively, did the mouse learn that it will not get a reward and then stop trying to get rewards? Did this affect switching between position and distance coding?

Thankyou for flagging this. This reflected an inconsistency arising from the way we detected stops that we have now corrected. Briefly, the temporal resolution of the processed location data against which the stop detection threshold was applied was insufficiently high. As a result, stops in the non-beaconed group were picked up, as they tended to be longer because mice remained still to consume rewards, whereas some stops in the probe group were missed because they were relatively short. We have corrected this by repeating the analyses on raw position data at the highest temporal resolution available. This analysis is now clearly described in the Methods (see p13 “A stop was registered in Blender3D if the speed of the mouse dropped below 4.7 cm/s. Speed was calculated on a rolling basis from the previous 100 ms at a rate of 60 Hz.”).

(1.4) It is not shown how the behaviours (e.g., running speed away from the reward zone, licking for reward) in beaconed/non-beaconed/probe trials were different and whether the difference in behaviours led to the different encoding schemes.

Because trial types were interleaved and repeated with a period less than the length of typical trial sequences during which grid cell activity remained either task-anchored or taskindependent, differences between trial types are unlikely to explain use of the different coding schemes. Hopefully, this is clarified by the comments above.

To further describe the relationship between behavioural outcomes, trial types and grid anchoring, we now also show running speed as a function of location for each combination of trial types and trial outcomes (Figure 6, Figure Supplement 1). This illustrates and replicates our previous findings (Tennant et al. 2018) that running speed profiles are similar for a given trial outcome regardless of trial type (Figure 6, Figure Supplement 1A), and further further shows that the behavioural profile for a given trial outcome and trial-type does not differ when grid cells are in task-anchored and task-independent modes (Figure 6, Figure Supplement 1B). This further argues against the possibility that difference in behaviours leads to the different encoding schemes.

(2) Regarding the behaviour and activity encoding on a trial-by-trial basis, did the behavioural change occur first, or did the encoding switch occur first, or did they happen within the same trial? This analysis will potentially determine whether the encoding is causal for the behaviour, or the other way around.

This is a good question but our experimental design lacks sufficient statistical power to address the timing of mode switches within a trial. This is because mode switching is relatively infrequent (so the n for switching is low) and only a subset of trials are uncued (making the relevant n even lower), while at a trial level the behavioural outcome is variable (increasing the required n for adequate power).

(3) The author determined that the grid cell coding schemes were limited to distance encoding and position encoding. However, there could be other schemes, such as switching between different position encodings (with clear spatial fields but at different locations), as indicated by Low et. al., 2021, and switching between different distant encodings (with different distance periods). If these other schemes indeed existed in the data, they might contribute to the variation of the behaviours.

Switching between position encoding schemes appears to be rare within our dataset and unlikely to contribute to variation in behaviour. In most sessions we did not observe switching between grid phases / position encodings (e.g. Figures 2A-B, 3B-E, 4A, 5C-D, F). In one session we found switching between different phases when grid cells were taskanchored. Because the grid period was unchanged, the spatial periodograms remained similar. We report this example in the revised manuscript (Figure 5E).

(4) The percentage of neurons categorised in each coding scheme was similar between nongrid and grid cells. This implies that non-grid cells might switch coding schemes in sync with grid cells, which would mean the whole MEC network was switching between distance and position coding. This raises the question of whether the grid cell coding scheme was important per se, or just the MEC network coding scheme.

We very much appreciate this suggestion. We note first that while the proportion of taskanchored grid and non-grid cells is similar, task-independent periodic firing of non-grid cells is much rarer than for grid cells (Figure 2E), suggesting a dissociation between the populations. To further address the question we have included additional analyses of nongrid cells (Figure 3, Figure Supplement 5). This shows that while some non-grid cells have anchoring that switches coherently with simultaneously recorded grid cells, others do not. Figures 4 and 5 now show examples of non-grid cell activity recorded simultaneously with grid cells.

Together, our data suggest that the MEC implements multiple coding schemes: one that is associated with the grid network and includes some non-grid cells; and one (or more) that can be independent from the grid network. This dissociation adds to the insights into MEC function that are provided by our study and is now highlighted in the abstract and discussion.

(5) In Figure 2 there are several cell examples that are categorised as distance or position coding but have a high fraction of the other coding scheme on a per-trial basis. Given this variation, the full session data in F should be interpreted carefully, since this included all cells and not just "stable" coding cells. It will be cleaner to show the activity comparison only between the stable cells.

We have now included examples in Figure 2A-C where the grid mode is stable throughout a session. As the view of activity at a session level is important, we have not updated Figure 2F, but have clarified the terminology to now clearly refer to classification at either season or trial levels. In addition, we have repeated the analyses shown in Figure 2F but after grouping cells according to whether their firing has a single mode on >85% of the trials (Figure 3 Figure Supplement 4). This analysis supports similar conclusions to those of Figure 2F.

(6) The manuscript is not well written. Throughout the manuscript, there are many unexplained concepts (especially in the introduction) and methods, mis-referenced figures, and unclear labels.

We very much appreciate the feedback and have substantially rewritten the manuscript. We have paid particular attention to explaining key concepts in the introduction and have carefully checked the figures. We welcome further feedback on whether this is now clearer.

Reviewer #2 (Public Review):

Clark and Nolan's study aims to test whether the stability of grid cell firing fields is associated with better spatial behaviour performance on a virtual task… This study is very timely as there is a pressing need to identify/delimitate the contribution of grid cells to spatial behaviours. More studies in which grid cell activity can be associated with navigational abilities are needed.

Thank you for the supportive comments and highlighting the importance of the question.

The link proposed by Clark and Nolan between "virtual position" coding by grid cells and navigational performance is a significant step toward better understanding how grid cell activity might support behaviour. It should be noted that the study by Clark and Nolan is correlative. Therefore, the effect of selective manipulations of grid cell activity on the virtual task will be needed to evaluate whether the activity of grid cells is causally linked to the behavioural performance on this task. In a previous study by the same research group, it was shown that inactivating the synaptic output of stellate cells of the medial entorhinal cortex affected mice's performance of the same virtual task (Tennant et al., 2018). Although this manipulation likely affects non-grid cells, it is still one of the most selective manipulations of grid cells that are currently available.

Again, thank you for the supportive comments. We recognise the previous version of the manuscript did not sufficiently clarify the motivation for our approach, or the benefits of capitalising on behavioural variable variability as a complementary strategy to perturbation approaches. We now make this clearer in the revised introduction (p 2, paragraphs 2 and 3).

When interpreting the "position" and "distance" firing mode of grid cells, it is important to appreciate that the "position" code likely involves estimating distance. The visual cues on the virtual track appear to provide mainly optic flow to the animal. Thus, the animal has to estimate its position on the virtual track by estimating the distance run from the beginning of the track (or any other point in the virtual world).

We appreciate the ambiguity here was confusing. We have re-named the groups to ‘taskanchored’, corresponding to when grid cells encode position on the track (as well as distance as the reviewer correctly points out), and ‘task-independent’, corresponding to the group we previously referred to as distance encoding.

It is also interesting to consider how grid cells could remain anchored to virtual cues. Recent work shows that grid cell activity spans the surface of a torus (Gardner et al., 2022). A run on the track can be mapped to a trajectory on the torus. Assuming that grid cell activity is updated primarily from self-motion cues on the track and that the grid cell period is unlikely to be an integer of the virtual track length, having stable firing fields on the virtual track likely requires a resetting mechanism taking place on each trial. The resetting means that a specific virtual track position is mapped to a constant position on the torus. Thus, the "virtual position" mode of grid cells may involve (1) a trial-by-trial resetting process anchoring the grid pattern to the virtual cues and (2) a path integration mechanism. Just like the "virtual position" mode of grid cell activity, successful behavioural performance on non-beaconed trials requires the animal to anchor its spatial behaviour to VR cues.

Reviewer #3 (Public Review):

This study addresses the major question of 'whether and when grid cells contribute to behaviour'. There is no doubt that this is a very important question. My major concern is that I'm not convinced that this study gives a significant contribution to this question, although this study is well-performed and potentially interesting. This is mainly due to the fact that the relation between grid cell properties and behaviour is exclusively correlative and entirely based on single cell activity, although the introduction mentions quite often the grid cell network properties and dynamics. In general, this study gives the impression that grid cells exclusively support the cognitive processes involved in this task. This problem is in part related to the text.

Thank you for the comments. We recognise now that the previous text was insufficiently clear. We have modified the introduction to clarify the value of an approach that takes advantage of behavioural variability. Importantly, this approach is complementary to perturbation strategies we and others have used previously. In particular it addresses critical limitations of perturbation strategies which can be confounded by off-target effects and possible adaptation, both of which are extremely difficult to fully rule out. We hope that with this additional clarification it is now clear that as for any important question multiple and complementary testing strategies are required to make progres, and second, that our study makes a new and important contribution by introducing a novel experimental approach and by following this up with careful analyses that clearly distinguish competing hypotheses.

However, it would be interesting to look at the population level (even beyond grid cells) to test whether at the network level, the link between behavioural performance and neural activity is more straightforward compared to the single-cell level. This approach could reconcile the present results with those obtained in their previous study following MEC inactivation.

We’re unclear here about what the reviewer means by ‘more straightforward’ as clear relationships between activity of single grid cells and populations of grid cells are well established (Gardner et al., 2021; Waaga et al., 2021; Yoon et al., 2013).

To give a clearer indication of the corresponding population level representations, as mentioned in response to Reviewer #1, we now include additional data showing many simultaneously recorded neurons, and analyses of non-grid as well as grid cells (Figures 4, 5, Figure 5 Figure Supplement 2).

To reconcile results with our previous study of MEC inactivation we have paid additional attention to the roles of non-grid cells (following suggestions by Reviewer #1). We show that while some non-grid cells show transitions between task-anchored and task-independent firing that are coherent with the grid population, many others have more stable firing that is independent of grid representations. This is consistent with the idea that the MEC supports localised behaviour in the cued and uncued versions of the task (Tennant et al., 2018), and suggests that while grid cells preferentially contribute when cues are absent, non-grid cells could also support the cued version. We make this additional implication clear in the revised abstract and discussion.

The authors used a statistical method based on the computation of the frequency spectrum of the spatial periodicity of the neural firing to classify grid cells as 'position-coding' (with fields anchored to the virtual track) and 'distance-coding' (with fields repeating at regular intervals across trials). This is an interesting approach that has nonetheless the default to be based exclusively on autocorrelograms. It would be interesting to compare with a different method based on the similarities between raw maps.

While our main analyses use a periodogram-based method to identify when grid cells are / are not anchored to the task environment, we validate these analyses by examination of the rate maps in each condition (Figures 2-4). For example, when grid cells are task-anchored, according to the periodogram analysis, the rate maps clearly show spatially aligned peaks, whereas when grid cells are not anchored the peaks in their rate maps are not aligned (Figure 2A vs 2B; Figure 3B-E; Figure 4C). We provide further validation by showing that spatial information (in the track reference frame) is substantially higher when grid cell activity is task-anchored vs task-independent (Figures 2F, 3G, 4F and Figure 3 Figure Supplement 4).

To further address this point we have carried out additional complementary analyses in which we identify task anchored vs task independent modes using a template matching method applied to the raw rate maps (Figure 6, Figure Supplement 2). These analyses support similar conclusions to our periodogram-based analyses.

Beyond this minor point, cell categorization is performed using all trial types.

Each trial type (i.e. beacon or non-beacon) is supposed to force mice to use different strategies and should induce different spatial representations within the entorhinal-hippocampal circuit (and not only in the grid cell system). In that context, since all trials are mixed, it is difficult to extrapolate general information.

We recognise that the description of the task design was insufficiently clear but are unsure why ‘it is difficult to extrapolate general information’. Before addressing this point, we should first be clear that mice are not ‘forced’ to adopt any particular strategy. Rather, on uncued trials a path integration strategy is the most efficient way to solve the task. However, mice could instead use a less efficient strategy, for example by stopping at short intervals they still obtain rewards. Detailed behavioural analyses indicate that such random stopping strategies are used by naive mice, while with training mice learn to use spatial stopping strategies (Tennant et al. 2018).

In terms of ‘extracting general information’ from the task, the following findings lead to general predictions: (1) Grid cells can exist in either task-anchored or task-independent periodic firing modes; (2) These modes can be stable across a session, but often modeswitching occurs within a session; (3) While some non-grid cells show task-independent periodic firing, this is much less common than for grid cells, which suggests a model in which many non-grid MEC neurons operate independently from the grid network; (4) When a marker cue is available mice locate a reward equally well when grid cells are in taskanchored versus task-independent modes, which argues against theories in which grid cells are a key part of a general system for localisation; (5) When markers cues are absent taskanchored grid firing is associated with successful reward localisation, which corroborates a key prediction of theories in which grid cells contribute to path integration.

In revising the manuscript we have attempted to improve the writing to make these advances clearer, and have clarified methodological details that made interpretation more challenging than it should have been. For example, as noted in our response to Reviewer #1, we have included additional details to clarify the organisation of trials and relationships between trials, behavioural outcomes and neural codes observed.

On page 5 the authors state that 'Since only position representations should reliably predict the reward location, ..., we reasoned that the presence of positional coding could be used to assess whether grid firing contributes to the ongoing behaviour'. I do not agree with this statement. First of all, position coding should be more informative only in a cue-guided trial. Second, distance coding could be as informative as position coding since at the network level may provide information relevant to the task (such as distance from the reward).

Again, this point perhaps reflects a lack of clarity on our part in writing the manuscript. When grid cells are anchored to the track reference frame (now called ‘tasked anchored’, previously ‘position encoding’), then the location of the rate peaks in grid firing is reliable from trial to trial. This is the case whether or not the trial is cued. When grid cells are independent of the track reference frame (now called ‘task independent’, previously ‘distance encoding’), then the location of the firing rate peaks vary from trial to trial. In the latter case, position can not be read out directly from trial to trial.

In principle, in the task-independent mode track position could be calculated by storing the grid network configuration at the start of the track, which would differ on each trial, and then implementing a mechanism to readout relative distance as mice move along the track. However, if mice do use this computation we would expect them to do so equally well on cued and uncued trials. By contrast, our results clearly show a dissociation between trial types in the relationship between grid firing and behavioural outcome. We highlight and discuss this possibility in the revised manuscript (p 10, ‘Alternatively, mice could in principle estimate track location with a system that utilises information about distance travelled obtained from task-independent grid representations’).

Third, position-coding is interpreted as more relevant because it predominates in correct trials. However, this does not imply that this coding scheme is indeed used to perform correct trials.

We have revised the manuscript to clarify our goal of distinguishing major hypotheses for the roles of grid cells in behaviour (Introduction, ‘On the one hand, theoretical arguments that grid cell populations can generate high capacity codes imply that they could in principle contribute to all spatial behaviours Fiete et al., 2008; Mathis et al., 2012; Sreenivasan and Fiete, 2011). On the other hand, if the behavioural importance of grid cells follows from their hypothesised ability to generate position representations by integrating self-motion signals (McNaughton et al., 2006), then their behavioural roles may be restricted to tasks that involve path integration strategies.’

By showing that performance on cued trials is similar regardless of whether grid cells are task-anchored or not, we provide strong evidence against the idea that grid firing is in general necessary for location-based behaviours. By showing that task anchoring is associated with successful localisation when cues are absent we corroborate a key prediction of hypothesised roles for grid cells in path integration-dependent behaviour. Therefore, we substantially reduce the space of behaviours to which grid cells might contribute. Importantly, this space is much larger for the MEC, which is required for cued and uncued versions of the task. We have revised the introduction and discussion to make these points clearer.

While we believe our results add a key piece of evidence to the puzzle of when and where grid cells contribute to behaviour, we agree that further work will be required to develop and test more refined hypotheses. Alternative models also remain plausible, for example perhaps the behaviourally relevant computations are implemented elsewhere in the brain with grid anchoring to the track as an indirect consequence. Nevertheless, explanations of this kind are more difficult to reconcile with evidence that inactivation of stellate cells in the MEC impairs learning of the task, and other manipulations that modify grid firing impair performance on similar tasks. We now discuss these possibilities (discussion p 10, ‘mice could in principle estimate track location with a system that utilises information about distance travelled obtained from task-independent grid representations’).

It could be more informative to push forward the correlative analysis by looking at whether behavioural performance can be predicted by the coding scheme on a trial-by-trial basis.

The previous version of the manuscript showed these analyses (now in Figure 6). Thus, task anchored grid firing predicts more successful performance on uncued trials at the session level (Figure 6A-B) and at the trial level (Figure 6C-D).

Reviewer #1 (Recommendations For The Authors):

(1) The author particularly mentioned that the 1D tracks are different from the "cue-rich environments that are typically used to study grid cells". It is not clear what conclusions would hold for a cue-rich environment or a track, which may require relatively less path integration compared to the cue-sparse environment. This point should be discussed.

This is an important point that we did not pay sufficient attention to in the previous version of the manuscript. Our finding of successful localisation in the cued environment when grid cells are not task anchored implies that grid anchoring is not required to solve cued tasks. The implication here is that cue rich environments may then not be the most suitable for investigation of grid roles in behaviour as non-grid mechanisms may suffice, although this does not rule out the possibility that anchored grid codes may play important roles in learning about cue rich environments. We now address this point in the discussion (p 10, ‘An implication of this result is that cue rich tracks often used to investigate grid activity patterns may not engage behaviours that require anchored grid firing.’).

(2) It would be good to see the statistics for the number of different cells (stable position or distance encoding, and unstable cells) identified per mouse/session and the number of grid cells per session.

These are now added to Supplemental Data 2 and will also be accessible through code and datasets that we will make available alongside the version of record.

(3) Figure 2F: any explanation about why AG cells had high spatial information?

Previously the calculation used bits per spike and as aperiodic cells have low firing rates the spatial information was high. We have replaced this with bits per second, which provides a more intuitive measure and no longer implies high spatial information. We have amended this in the methods (p 15, ‘Spatial information was calculated in bits per second…’).

(4) The following methods sections should provide additional details:

(4.1) Details of the training protocol are largely left to reference papers. The reference papers give a general outline of the training protocol, but the details are not completely comparable given the single experiment performed on these mice. More details should be given on training stages and experience at the time of the experiment.

The task is more clearly described in the introduction (p 3), and additional details of the training protocol are now provided in the methods (p 12-13).

(4.2) The methods reference mean speed across sessions, but it is not clear where this was used.

This was very poor wording. We have now changed this to ‘For each session the mean speed was calculated for each trial outcome’.

(4.3) The calculation of the spatial autocorrelogram on a per-trial basis should be more explicitly stated. Is it the average of each 10 cm increment with the centre trial?

We have added additional information to the methods (p 16-18).

(4.4) 1D field detection is not sufficiently explained in Figure 1/S2. This information should also appear in the methods section.

This is now clarified on page 16 in section ‘Analysis of neural activity and behaviour during the location memory task’.

(5) The data in Figure 4A and B only shows speed vs. location for one example mouse. The combined per mouse or per session data should also be shown.

This is now shown in Figure 5A and Figure 5, Figure Supplemental 2

(6) Figure 5 is somewhat confusing. Why are A/B by session and C/D by trial? The methods imply that A/B are originally averaged by cell, but that duplicate cells in the same session are excluded because behaviour versus session type is identical. This method should be valid if all grid cells within a session are all "stable". This is likely given the synchrony of code-switching between grid cells, but not all co-active grid cells behaved identically.

It is understandable that C/D are performed by trial, but it should be made clear that it is not a comparable analysis to A/B. It is unclear what N refers to in C. The figure says by trial, but the legend says the error bar is by cell. If data is calculated by trial and then averaged by cell, this should be more clearly stated.

In Figure 6A/B (previously Figure 5A/B) we focus our analysis on sessions in which the mode of grid firing, either task-anchored or task-independent, was relatively stable on a trialto-trial basis (see Figure 3F for definitions). This enables us to then compare behaviour averaged across each session, with sessions categorised as task-anchored and task independent. This analysis has the advantage that it focuses on large blocks of time (whole sessions) in which the mode of grid firing is unambiguous, but the disadvantage is that it excludes many sessions in which grid firing switches between task-anchored and taskindependent modes.

Figure 6C/D (previously Figure 5C/D) addresses this limitation by carrying out similar analyses with behaviour sorted into task-anchored versus task-independent groups at the level of trials. A potential limitation for this analysis is that grid firing is somewhat variable on a trial-by-trial basis and so some trials may be mis-classified. We don’t expect this to lead to systematic bias, but it may make the data more noisy. Nevertheless, these analyses are important to include as they allow assessment of whether conclusions from 6A/B hold when all sessions are considered.

We have added additional clarification of the rationale for these analyses to the main text (p7-8, ‘’We addressed this by using additional trial-level comparisons’). We have also added clarification in the methods section for categorisation of task-anchored versus taskindependent trials when multiple grid cells were recorded simultaneously (p 17, ‘When assigning a common classification across a group of cells recorded simultaneously...’) and an explanation for the N in the figure legend. We also clarify that the analyses use a nested random effects design to account for dependencies at the levels of sessions and mice (methods, p 20, ‘Random effects had a nested structure to account for animals and sessions…’) .

(7) Panels E and F of Figure 5 are not explained in the main text.

This is now corrected (see p8, ‘Additional analyses…’).

(8) Figure 5: Since stable grid cells and all grid cells are shown, it will be better to show unstable cells, which can be compared with grid cells.

Given that the rationale for differences between Figure 6A/B and C/D (previously Figure 5AD) were not previously clear, the reason for focussing on stable grid cells here was likely also not clear (see point 6 above). We don’t show unstable grid cells in Figure 6A-B as the behaviour averaged at the level of a session would be a mix of trials when they are taskanchored and when they are task-independent. Therefore, the analysis would not test predictions about the relationship between task-anchored vs task-independent modes and behaviour. We hope this is now clear in the manuscript given the revisions introduced to address point 6 above.

(9) The methods describing the statistics for these experiments are also confusing. The methods section should be written more clearly, and it should be made clear in the text or figure legend whether this data is the "original" data or is processed in relation to the model, such as excluding duplicate grid cells within a session. The figure legend should also state that a GLMM was used to calculate the statistics.

We have revised the methods section with the goal of improving clarity, adding detail and removing ambiguity. This includes updates of the methods for the GLMM analysis, which are referred to within the Figure 6 legend. A clear definition of a stable session is now also added to the Figure 6 legend.

Reviewer #2 (Recommendations For The Authors):

When grid fields are anchored to the virtual world (position mode), there is probably small trialto-trial variability in the firing location of the firing fields. Is this trial-to-trial variability related to the variability in the stop location? This would provide a more direct link between path integration in grid cell networks and behaviour that depends on path integration.

When attempting to address this we find that the firing of individual grid cells is too variable to allow sufficiently precise decoding of their fields at a single trial level. This is expected given the Poisson statistics of spike generation and previous evaluations of grid coding (e.g. (Stemmler et al., 2015)).

The conclusion of the abstract is: "Our results suggest that positional anchoring of grid firing enhances the performance of tasks that require path integration." This statement is slightly confusing. The task requires (1) anchoring the behaviour to the visual cues presented at the start of the trial and (2) path integration from thereon to identify the rewarded location. The performance is higher when grid cells anchor to the visual cues presented at the start of the trial. What the results show is that the anchoring of grid firing fields to visual landmarks enhances the performance of tasks that require path integration from visual landmarks (i.e. grid cells being anchored to the reference frame that is behaviorally relevant).

To try to more clearly explain the logic and conclusion we have rewritten the abstract, including the final sentence.

Similar comment for the title of Figure 5: "Positional grid coding is not required for cued spatial localisation but promotes path integration-dependent localisation." Positional coding means that grid cells are anchored to the behaviorally relevant reference frame.

To address the lack of clarity we have modified the little of Figure 6 (previously Figure 5) to read ‘Anchoring of grid firing to the task reference frame promotes localisation by path integration but is not required for cued localisation’.

In Figure 1, there is a wide range of beaconed (40-80%) and non-beaconed (10-60%) trials given. It is not 100% clear whether these refer to the percentage of trials of a given type within the recording sessions. Was the proportion of non-beaconed trials manipulated? If so, was the likelihood of position and distance coding changing according to the percentage of nonbeaconed trials?

The ranges given refer to proportions across different behavioural sessions. Within any given behavioural session the proportion was constant. We now make this clear in the figure legend and in the results and methods sections.

We did not manipulate proportions of trial types during a session. Manipulations betweens sessions were carried out with the goal of maximising the numbers of uncued trials that the mice would carry out (see response to public comments above). While the effect of trial-type at the session level is not relevant to the hypotheses we aim to test here, we have included an additional analysis of the relationship between task anchoring and the proportions of trial types in a session (Figure 3, Figure Supplement 7)(also discussed above). As disentangling the effects of learning and motivation will be complex and likely require new experimental designs we have not drawn strong conclusions or pursued the analysis further..

I was not convinced that the labels "position" and "distance" were appropriate for the two grid cell firing modes. My understanding is that the "position" code also requires the grid cell network to estimate distance. It seems that the main difference between the "position" and "distance" modes is that when in the "position" mode, the activity on the torus is reset to a constant toroidal location when the animal reaches a clearly identifiable location on the virtual track. In the "distance" mode, this resetting does not take place.

As previously mentioned, we agree these terms weren’t the best and have since relabelled these as “task-anchored” and “task-independent”.

There are a few sections in the manuscript that implicitly suggest that a causal link between grid cell activity and behaviour was demonstrated. For instance: "It has been challenging to directly test whether and when grid cells contribute to behaviour.": The assumption here is that the manuscript overcomes this challenge, but the study is correlative.

We have modified the wording to be clear that we are introducing new tests of predictions made by hypotheses about causal relationships between grid coding and behaviour (introduction, p 1-2). We also clarify that our results argue against the hypothesis that grid cells provide a general coded for behaviour, but corroborate predictions of hypotheses in which they are specifically important for path integration (discussion, p 10).

We have modified the title abstract and main text to try to treat claims about causality with care. We now more thoroughly introduce and contrast the approach we report here with previous experiments that use perturbations (introduction, p2). While it is tempting to make stronger claims for causality with these approaches, there are also logical limitations with perturbation-based approaches, for example the challenges of fully excluding off target effects and adaptation. We now explain how these strategies are complementary. Our view is that both strategies will be required to develop strong arguments for whether and when grid cells contribute to behaviour. From this perspective, it is encouraging that our conclusions are in agreement with what are probably the most specific perturbations of grid cells reported to date (Gil et al. 2017), while perturbations that more generally affect MEC function appear to impair cued and path integration-dependent behaviours (Tennant et al. 2018). We now discuss these points more clearly (introduction, p 2).

I am slightly confused by the references to the panels in Figure 4.

"In some sessions, localization of the reward occurred almost exclusively when grid cells were anchored to position and not when they encoded distance (Figure 4C). Figure 4C only shows position coding.

"In other sessions, animals localised the reward when grid firing was anchored to position or distance, but overall performance was improved on positional trials (Figure 4D-E)." The reference should probably point to Figure 4E-F or just to 4E.

"In a few sessions, we observed spatial stopping behaviour comparable to cued trials, even when grid firing almost exclusively encoded distance rather than position (Figure 4F)." From Figure 4F, it seems that the performance on non-beaconed trials is better during "position" coding.

We have now updated Figure 5 (Figure 4 in the original manuscript) and references to the Figure in the text. Now Figure 5 shows the activity of cells recorded in stable and unstable task-anchored and task-independent sessions (see Figure 5C-F).

Minor issues:

Is this correct: (Figure 4A and Figure 4, Figure Supplement 1).

This has been corrected.

Figure 4B: There could be an additional label for position and distance.

Figure 4B from the original manuscript has now been removed.

Figure 4C-F. The panels on the right side should be explained in the Figure Legend.

Legends for Figure 5C-F (previously Figure 4C-F) have now been updated.

Reviewer #3 (Recommendations For The Authors):

Specific questions :

(1) Position coding reflects a coding scheme in which fields are spaced by a fixed distance; previous studies have shown that a virtual track grid map is a slice of the 2D classic grid. In that case, the fields are still anchored to the track but would produce a completely different map. Did the authors check whether it is the case at least for some cells? If not, what could explain such a major difference?

Το avoid confusion we now use the term ‘task-anchored’ rather than ‘position coding’ (see comments above). We should further clarify that our conclusions rest on whether or not the grid fields are anchored to the track. Task anchored firing does not require that grid fields maintain their spacing from 2D environments, only that fields are at the same track position on each trial. Thus, whether the spacing of the fields corresponds to a slice through a 2D grid makes no difference to the hypotheses we test here.

We agree that the relationship between 1D and 2D field organisation could be an interesting future direction, for example anchoring could involve resetting the grid phase while maintaining a stable period, or it could be achieved through local distortions in the grid period. However, since these outcomes would not help distinguish the hypotheses we test here we have not included analyses to address them.

(2) Previous studies have highlighted the role of grid cells in goal coding. Here there is an explicit reward in a particular area. Are there any grid modifications around this area? This question is not addressed in this study.

Again, we note that the hypotheses we test here relate to the firing mode of grid cells - taskanchored or task-independent - and interpretation of our results is independent from the specific pattern of grid fields on the track. This question nevertheless leads to an interesting prediction that if grid fields cluster in the goal area then this clustering should be apparent in the task-anchored but not the task-independent firing mode.

We test this by considering the average distribution of firing fields across all grid cells in each firing mode (Reviewer Figure 1). We find that when grid firing is task-anchored there is a clear peak around the reward zone, which is consistent with previous work by Butler et al. and Boccara et al. Consistent with our other prediction, this peak is reduced when grid cells are in the task-independent mode.

Author response image 1. Plot shows the grid field distribution during stable grid cell session (> 85 % task-anchored or task-independent) (A) or during task-anchored and task-independent trials (B).

Author response image 1.

Shaded regions in A and B represent standard error of the mean measured across sessions and epochs respectively.

(3) The behavioural procedure during recording is not fully explained. Do trial types alternate within the same session by blocks? How many trials are within a block? Is there any relation between trial alternation and the switch in the coding scheme observed in a large subset of the grid cells?

We agree this wasn’t sufficiently clear in the previous version of the manuscript. Trial types were interleaved in a fixed order within each session. We have updated the results and methods sections to provide details (see responses above).

(4) From the examples in Figure 2 it seems that firing fields tend to shift toward the start position. Is it the case in all cells? Could this reflect some reorganisation at the network level with cells signalling the starting as time progresses?

This is inconsistent between cells. To make this variability clear we have included additional examples of spiking profiles from different grid cells (Figure 2 - 5). Because quantification of the phenomena would not, so far as we can tell, help distinguish our core hypotheses we have not included further analyses here.

(5) Are grid cells with different coding properties recorded in different parts of the MEC? Are there any differences between these cell categories in the 2D map?

The recordings we made are from the dorsal region of the MEC (stated at the start of the results section). We don’t have data to speak to other parts of the MEC.

Minor:

There are very few grid cell examples that repeat in the different figures. I would suggest showing more examples both in the main text and supplementary material.

We have now provided multiple additional examples in Figures 2, 4 and 5. Grid cell examples repeat in the main figures twice, in both cases only when showing additional examples are shown from the same recording session (Figure 2A example #1 with Figure 5C, Figure 3E with Figure 4A). Further similar repeats are found in the supplemental figures (Figure 3D with Figure 5, Figure Supplement 2A, Figure 3C with Figure 5, Figure Supplement 2F).

Fig1 A-B shows the predictions in a 1D track based on distance or position coding. The A inset represents the modification of field distribution from a 2D arena to a 1D track, as performed in this study. The inset B is misleading since it represents the modifications expected from a circular track to a 1D track as in Jacob et al 2019, that is not what the authors studied. It would be better to present either the predictions based on the present study or the prediction based on previous studies. In that case, they should mention the possibility that the 1D map is a slice of the 2D map.

The goal of Figure 1A-B is to illustrate predictions (right) based on conclusions from previous studies (left). Figure 1A shows predicted 1D track firing given anchoring to the environment typically observed in grid cell studies in 2D arenas. Figure 1B shows predicted 1D track firing given the firing shifting firing patterns observed by Jacob et al. in a circular 2D track. To improve clarity, we have modified the legend to make clear that the schematics to the right are predictions given the previous evidence summarised to the left. As we outline above, the critical prediction relates to whether the representations anchor to the track. Whether the 1D representation is a perfect slice isn’t relevant to the hypotheses tested and so isn’t included in the schematic (see comments above).

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Data Citations

    1. Clark and Nolan 2024. Task-anchored grid cell firing is selectively associated with successful path integration-dependent behaviour. Edinburgh DataShare. [DOI] [PMC free article] [PubMed]
    2. Clark HD. 2024. MattNolanLab/eLife_Grid_anchoring_2024: v1.0.0.0. Zenodo. [DOI]
    3. Clark et al. 2022. Spatial representation by ramping activity of neurons in the retrohippocampal cortex. Edinburgh DataShare. [DOI] [PubMed]

    Supplementary Materials

    Supplementary file 1. Summary table of recorded cells and estimated tetrode locations.
    elife-89356-supp1.docx (16.8KB, docx)
    MDAR checklist
    Source data 1. MicroCT imaging for tetrode localisation 1/2.
    elife-89356-data1.png (5.9MB, png)
    Source data 2. MicroCT imaging for tetrode localisation 2/2.
    elife-89356-data2.png (5.8MB, png)

    Data Availability Statement

    Data have been deposited at Edinburgh DataShare and code at GitHub (copy archived at Zenodo).

    The following datasets were generated:

    Clark and Nolan 2024. Task-anchored grid cell firing is selectively associated with successful path integration-dependent behaviour. Edinburgh DataShare.

    Clark HD. 2024. MattNolanLab/eLife_Grid_anchoring_2024: v1.0.0.0. Zenodo.

    The following previously published dataset was used:

    Clark et al. 2022. Spatial representation by ramping activity of neurons in the retrohippocampal cortex. Edinburgh DataShare.


    Articles from eLife are provided here courtesy of eLife Sciences Publications, Ltd

    RESOURCES