Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2019 Oct 18.
Published in final edited form as: Cell. 2018 Sep 27;175(3):736–750.e30. doi: 10.1016/j.cell.2018.08.066

A map-like micro-organization of grid cells in the medial entorhinal cortex

Yi Gu 1,2,#, Sam Lewallen 1,2,ǂ, Amina A Kinkhabwala 1,2,, Cristina Domnisoru 1,2, Kijung Yoon 3,4,, Jeffrey L Gauthier 1,2, Ila R Fiete 3,4, David W Tank 1,2,#,*
PMCID: PMC6591153  NIHMSID: NIHMS1505756  PMID: 30270041

Summary:

How the topography of neural circuits relates to their function remains unclear. Although topographic maps exist for sensory and motor variables, they are rarely observed for cognitive variables. Using calcium imaging during virtual navigation, we investigated the relationship between the anatomical organization and functional properties of grid cells, which represent a cognitive code for location during navigation. We found a substantial degree of grid cell micro-organization in mouse medial entorhinal cortex: grid cells and modules all clustered anatomically. Within a module, the layout of grid cells was a noisy two-dimensional lattice, in which the anatomical distribution of grid cells largely matched their spatial tuning phases. This micro-arrangement of phases demonstrates the existence of a topographical map encoding a cognitive variable in rodents. It contributes to a foundation for evaluating circuit models of the grid cell network, and is consistent with continuous attractor models as the mechanism of grid formation.

Introduction

Topographical maps have been observed in many sensory and motor systems. For example, neurons in primary visual cortex form a retinotopic map, in which neuronal responses are anatomically organized to reproduce the visual image on the retina (Tootell et al., 1982). Similarly, sound frequency, body surface, and body musculature are represented by topographically arranged neurons in the auditory cortex (tonotopic map) (Weisz et al., 2004), somatosensory cortex (somatotopic map) (Kaas et al., 1979), and motor cortex (Purves et al., 2001), respectively. However, topographic maps for cognitive variables have not been widely reported. A notable exception is a recently revealed topographical organization in the central complex of the fly, where a bump of activity is generated within a circle of dendritic arbors and tracks the fly’s orientation (Seelig and Jayaraman, 2015), a cognitive variable important for navigation. In contrast, the limited number of studies on the micro-organization of neurons encoding cognitive variables in mammals, such as a rodent’s location and behavioral choice, suggest cells are spatially intermingled (Dombeck et al., 2010; Harvey et al., 2012). The fact that topographical maps exist in some neural networks but not others indicates that topography is not required for the function of neural networks, as some networks can operate by enforcing a certain connectivity diagram on randomly arranged neurons. However, in the presence of topography, the anatomical arrangement of neurons mirrors the pattern of projections they receive (e.g. somatotopic map) or the property of the variable computed in the network (e.g. tonotopic map), favoring both the precision and efficiency of neural connectivity and facilitating circuit function.

Here we address the relationship between anatomical location and function of grid cells in the mouse medial entorhinal cortex (MEC), a higher cognitive system important for spatial representation and episodic memory. In rodents, the firing fields of each grid cell lie on a triangular lattice characterized by spatial scale, lattice orientation, and phase (Hafting et al., 2005). Given the previous findings of nearly non-existent topography for cognitive variables, do MEC grid cells with these different properties also exhibit limited topography?

Grid cells are highly abundant in layer 2 of the MEC, which contains two excitatory cell types: pyramidal cells, which are arranged in patches on a triangular lattice, and stellate cells, which distribute between patches (Kitamura et al., 2014; Ray et al., 2014). Grid cells also form functionally independent modules, in which scale and orientation are similar for cells within a module, but different across modules (Stensola et al., 2012). Since previous tetrode recordings cannot identify the precise anatomical location of recorded cells, it remains undetermined how grid cells are arranged within the pyramidal/stellate structure, and how different modules are organized at the microstructural level.

Moreover, within each module, it is unclear how cells with different grid phases (the relative locations of grid vertices, Figures 1A and 1B) are organized. In one class of continuous attractor networks (CAN) that model grid firing, neuronal activity across the population is manifest as multiple bumps of activity in a two-dimensional sheet of phase-arranged grid cells (Burak and Fiete, 2009; Fuhs and Touretzky, 2006) (Figure 1C). If the brain uses the efficiently-implemented synaptic connectivity underlying attractor models, in which each neuron has spatially restricted interactions with its surrounding neighbors, one predicts that grid cells with identical phase might be anatomically located in a set of vertices of a grid like lattice pattern across the cell sheet. Also, in the local neighborhood of any particular grid cell the relative anatomical arrangement of cells with different phases would correspond to their relative two-dimensional phase offsets (Figure 1C, panel i). During early development, such a topographically-arranged network could also serve as a teaching signal for a less topographical grid cell network in adults (McNaughton et al., 2006). Although evidence exists supporting CAN models (Couey et al., 2013; Domnisoru et al., 2013; Heys et al., 2014; Pastoll et al., 2013; Stensola et al., 2012; Yoon et al., 2013), the topographical pattern of phases that would be predicted if neuron somas were organized anatomically according to their connectivity has never been examined, although higher activity correlations between nearby grid cells suggests closer phases (Heys et al., 2014). Alternatively, the cells may be connected according to their phases but soma locations may be topographically random (Figure 1C, panel ii). Such topographical randomness increases the difficulty of establishing the precise synaptic connectivity matrix required for CAN models. In general, a better understanding of the micro-organization of grid phases will help to elucidate the potential biological implementation of CAN models.

Figure 1. Possible anatomical organizations of grid cells in CAN models.

Figure 1.

A. An animal navigates past three locations in a square environment.

B. Firing fields of three grid cells with different phases (a, b and c) active at the three locations in A (1, 2, and 3, respectively) and their relative phase offsets, shown in the phase overlay.

C. Two possible anatomical organizations of grid cells under the synaptic connectivity predicted by CAN models. Panel i) grid cell somas are organized by their phase offsets. Top: at every location the animal passes, the cell sheet exhibits multiple activity bumps arranged in a triangular lattice. The cells generating these bumps have identical phases in the environment (e.g., all cells at magenta bumps have identical phases as cell a in B). The lattice of activity bumps moves along with the animal’s trajectory so that the trajectory in the environment is mapped to multiple activity trajectories on the cell sheet. Middle: cells with identical phases are anatomically arranged at vertices of a triangular lattice. Bottom: relative anatomical arrangement of cells in local brain neighborhoods corresponds to their phase offsets (phase overlay in B) and repeats on the cell sheet. Panel ii) Grid cell somas and activity bumps are randomly arranged. The anatomical arrangement of cells with identical phases (middle) and the relative arrangements of cells in local neighborhoods (bottom) are random.

Here we investigated the micro-organization of grid cells in mouse MEC using cellular resolution two-photon calcium imaging during navigation, which allowed us to precisely correlate grid cell activity with anatomical location. We demonstrate a significant map-like relationship between the topography of these neurons and their circuit function.

Results

Simultaneous imaging of pyramidal and stellate cells during virtual navigation

Two-photon calcium imaging of neurons in layer 2 of the mouse MEC was performed using a microprism chronically implanted into the transverse fissure, providing fields of view (FOVs) nearly parallel to the cortical surface (Low et al., 2014) (Figures S1A and S1B).

Imaging was performed in GP5.3 transgenic mice (Dana et al., 2014), which expressed the calcium indicator GCaMP6f in both pyramidal and stellate cells (77.6±5.0% and 91.0±1.2%, respectively) (Figures S1C-S1G), allowing simultaneous and minimally biased measurement of activity of the two cell populations (Figure S1H). The two cell types could be distinguished in vivo based on cell body diameters: stellate cells generally have larger diameters than pyramidal cells. The two cell types were classified with high accuracy (98.0% and 96.4% for stellate and pyramidal cells, respectively), and classified pyramidal cells formed multiple patches surrounded by stellate cells, as previous observed (Kitamura et al., 2014; Ray et al., 2014) (Figures S1I-S1N).

Calcium imaging was performed while mice ran unidirectionally along 1D virtual tracks (10- or 18 meters, Figures S1O and S1P). As shown previously, cells exhibited multiple “spatial fields”, which were used to identify putative grid cells by applying a previously developed 1D grid cell classifier (Domnisoru et al., 2013; Heys et al., 2014; Yoon et al., 2016) (Figure S1Q). We augmented the classifier to eliminate a recently discovered non-grid spatial cell type in the MEC (7.3±1.3% of cells originally classified as grid cells), which represents environmental features (Diehl et al., 2017; Kinkhabwala, 2015) (Figures S1R-S1V, S2A-S2C).

Grid cells are mostly stellate cells and form clusters

We first investigated how grid cells map onto anatomical cell types: pyramidal and stellate cells.

While a consensus has not been reached on the relative proportions of grid cells in the two cell populations (Domnisoru et al., 2013; Sun et al., 2015; Tang et al., 2015), we found that both cell types contained active and silent cells during navigation, indicated by significant calcium transients (Figure 2A). Among stellate cells, a larger fraction was identified as grid cells (40.1±4.5%) than among pyramidal cells (18.4±2.9%) (Figures 2B and 2C), and most grid cells were stellate (75.6±3.2%). Relatedly, significant calcium transients in stellate cells generally showed higher frequencies and larger amplitudes than in pyramidal cells (Figure S2D). Grid cells had similar transient frequencies and amplitudes, independent of their stellate or pyramidal identity (Figure S2E).

Figure 2. Grid cells are mostly stellate cells and form clusters.

Figure 2.

A. Baseline-subtracted ΔF/F (black) and significant calcium transients (red) in three stellate and pyramidal cells. Virtual track position and water rewards are shown at bottom.

B. Spatial dependence of calcium responses of stellate and pyramidal grid cells. For each cell: (Top) heat plot of ΔF/F versus track position of sequential traversals. Black dots are bins without imaging data due to very low or high running speed (STAR Methods). (Middle) Mean ΔF/F versus track position. (Bottom) 1-pvalue function (1-p).

C. Percentage of GCaMP6f+ stellate and pyramidal cells that were grid cells (517 stellate and 408 pyramidal cells in 18 FOVs of six mice). p=2.5×10−4

D. Pairwise distances between grid cells (G/G), and grid and non-grid cells (G/NG) (294 grid and 631 non-grid cells in 18 FOVs of six mice). p =5.2×10−29

E. Percentage of pyramidal grid cells at different distances from centers of pyramidal patches (272 pyramidal cells in 14 FOVs of five mice). Curves: real data (magenta) and 100 shuffles (gray). Bin width: 15μm.

F. Pairwise distances between pyramidal grid cells and stellate cells (PG), and pyramidal non-grid cells and stellate cells (PNG) (517 stellate and 408 pyramidal cells in 18 FOVs of six mice). p =3.3×10−38.

G. Distribution of grid (G) and non-grid cells (NG). Dots and circles represent centers of mass (COMs) of individual cells, similar in all figures. Scale bar: 100μm. Gray patterns represent blood vessels; D: dorsal. V: ventral. M: medial. L: lateral, similar in all figures.

*p ≤0.05, ***p≤0.001, Student’s t-test. Error bars: mean±SEM.

See also Figures S1 and S2.

Anatomically, grid cells mainly clustered and were largely separated from non-grid cells, as revealed by shorter pairwise distances between grid cells than between grid and non-grid cells (Figure 2D). Interestingly, the percentage of grid cells increased from center to edge of pyramidal patches (Figure 2E), and pyramidal grid cells were closer to stellate cells than pyramidal non-grid cells (Figure 2F). These results indicate that pyramidal cells located at the edge of patches, and thus closer to stellate cells, are more likely to be grid cells than those near patch centers. Consistently, frequencies and amplitudes of significant transients increased from the center to the edge of pyramidal patches (Figures S2F and S2G).

The relatively low percentage of grid cells among pyramidal cells and the edge-distribution of grid cells within pyramidal patches were also consistently observed in another transgenic mouse line (Emx1-IRES-Cre: CaMKIIa-tTA: Ai93), in which 95.3% of pyramidal cells in layer 2 of the MEC were specifically labeled by GCaMP6f (Figures S2H-S2N). This observation provides evidence that the different features of grid cells in pyramidal and stellate cells, especially grid cell percentages, were not biased by the lower percentage of GCaMP6f labeling of pyramidal cells than stellate cells in the GP 5.3 mice. In summary, grid cells in layer 2 form clusters that are comprised of mostly stellate cells and some pyramidal cells at patch edges (Figure 2G).

Grid modules cluster

Although modules with larger scale generally distribute more ventrally than those with smaller scales, most modules are reported to show some degree of overlap (Stensola et al., 2012). Cellular-resolution imaging allowed us to investigate the microstructural organization of modules in the overlapping areas. Grid modules, which are typically defined by clustering of spatial response scales of neurons in two-dimensional (2D) environments (Stensola et al., 2012), were accurately determined (100% and 98% in two datasets, Figures S2O-S2T) by clustering 1D field spacings and widths of the same set of grid cells on two different virtual linear tracks or two different trials on the same track (Figure 3A).

Figure 3. Grid modules form anatomical clusters.

Figure 3.

A. Diagram for assigning grid cells in the same FOV to different modules, based on the field width (W) and spacing (S) of their 1D calcium responses on two VR tracks or two trials on the same VR track.

B. Examples of 1D activity of grid cells (among 19 simultaneously imaged grid cells) in modules 1 (smallest spacing) and 2 (with the second smallest spacing) in two trials of the same 1D VR track. Annotations are similar to Figures 2B and 3A.

C. Clustering of 1D spacings (S1 and S2) and widths (W1 and W2) for the 19 cells. Each dot represents one cell.

D. Anatomical locations of the 19 cells in two modules. Scale bar: 50μm.

E. Pairwise distances of cells in D. 1-1, 2-2 and 1-2 are distances of cells in module 1, in module 2, between modules 1 and 2, respectively. p=4.9×10−9 for 1–1 and 1–2, and 2.6×10−14 for 2-2 and 1-2.

F. Intra- and inter-module pairwise distances of multiple modules (20 modules in ten FOVs of six mice). p =7.1×10−4.

G. Anatomical distribution of grid modules in two mice. Grid spacing increases from modules 1 to 3. To show the distribution of modules from clearly defined pyramidal patches, each panel contains merged FOVs from multiple focal planes. Scale bar: 50μm.

H. Percentage of pyramidal cells in different modules (individual dots, 23 modules in ten FOVs of six mice).

***p≤0.001. n.s. p >0.05. Student’s t-test. Error bars: mean±SEM.

See also Figure S2.

The properties of assigned grid modules were further validated based on the previous theory that the 1D response of a grid cell is well approximated as a slice through a 2D triangular lattice; the 2D field width, spacing, and orientation of the cell were estimated as the width and spacing of the lattice, and the angle of the slice, respectively (Yoon et al., 2016). We observed that 1D responses of assigned co-modular grid cells were well fit by parallel slices in the same triangular lattice (Figure S2U), consistent with observations that co-modular grid cells share scale and orientation (Stensola et al., 2012). The ratio of 2D spacing between successive modules, which was the spacing of their best fit triangular lattice, was 1.51 on average (Figure S2V), close to the ratio in 2D real environments (1.42) (Stensola et al., 2012). These results indicate that co-modular grid cells identified in 1D VR had similar properties to those in 2D real environments.

We then investigated how different modules were anatomically organized at the microstructural level. For the 19 grid cells assigned in two modules (Figure 3B: cell examples. Figure 3C: clustering of 1D field widths and spacings), we identified the anatomical locations of grid cells and calculated their pairwise distances (Figure 3D). Distances between cells in different modules (inter-module distances) were greater than those between cells in the same module (intra-module distances) (Figure 3E). Other modules showed similar results, strongly suggesting that co-modular grid cells cluster and are separated from other modules (Figure 3F). However, the intermingling of cells in different modules created irregular boundaries between these modules, which may have led to their “overlapping” appearance at the macroscopic level (Stensola et al., 2012) (Figure 3G). In addition, while grid modules were largely distributed in the space between the pyramidal patches, the percentage of pyramidal cells in all modules was similar (Figure 3H), indicating that module clustering was not due to uneven fractions of spatially-clustered pyramidal cells in different modules.

Consistent arrangement of anatomical and spatial tuning phases within local brain neighborhoods

We next investigated how grid phases are anatomically organized within a module. We first asked how the phase distances between cells scale with their physical distances. While the 2D spatial fields of a grid cell lie on the vertices of a triangular lattice, grid phase can be represented by the location of a fixed point of the environment in the unit-rhombus, which is a repeating unit of the triangular lattice. All possible phases can therefore be fully sampled as point locations throughout the rhombus, and the phase distance between a pair of grid cells is the distance between their point locations within the rhombus (Figure 4A). Similarly, while the 1D responses of co-modular grid cells were best fit as parallel slices in the same triangular lattice (Figure S2U), their phases could be estimated as starting points of the slices in the unit-rhombus of the lattice. The phase distance of a grid cell pair was well predicted by the distance between their starting points in the rhombus (Yoon et al., 2016) (Figures 4B and S3A). Thus, we used 1D responses to reliably predict 2D phase distances between grid cells (linear correlation of 2D and 1D phase distances, r2=0.71; absolute error: 0.08±0.01, Figures S3B-S3E).

Figure 4. Anatomical arrangement of grid phases in local brain neighborhood.

Figure 4.

A. Schematic diagram for calculating phase distance of two co-modular grid cells from their spatial responses in a 2D environment.

B. Schematic diagram for calculating phase distance of two simultaneously-imaged co-modular grid cells from their spatial responses on a 1D VR track.

C. Anatomical locations of nine module 1 cells, color-coded based on phase distance from the reference cell (Ref.). Scale bar: 25μm.

D. Phase distances of the reference cell (Ref.) and its close (cell 1) and distal (cell 2) cells, as indicated in C. Left: calcium response (black) and modeled activity based on slice fit (gray). Right: phase distance to the reference cell (yellow line) based on the starting points of their fitted slices (red and black dots) in the same unit-rhombus (white).

E. Pairwise phase versus physical distances (bin width 30μm) of the nine cells in C.

F. Phase plot showing relative anatomical locations of cells in C with small (< 20th percentile) and large phase distances (> 80th percentile), axes as in C.

G. Pairwise phase versus physical distances of all module 1 cells (modules with the smallest spacing; bin width: 30μm; 10246 cell pairs in 17 modules of six mice). The blue rectangle highlights physical distances ≤ 120μm.

H. Relationship of pairwise physical distances within 120μm and the percentage of module 1 cell pairs with small and large phase distances (black: <10th percentile, left y-axis; red: >90th percentile, right y-axis; bin width: 15 μm; 1044 and 1030 cell pairs with small and large phase distances in 17 modules of six mice, respectively).

I. Folding analysis of a cell group chosen around a center cell (C.C.). In brain and phase spaces, the same cells are assigned to the same color and a triangle of the same color is drawn between the same three cells. Scale bar: 20μm.

J. Comparison of folding scores of real and 100 shuffled phases of the cell group in I.

K. Comparison of folding scores of 29 co-modular cell sets (242 cell groups composed of 345 unique cells) with real (red) and shuffled phases (gray, 100 / set). Mean score of all cell groups in each co-modular cell set was used for the comparison. The mean folding scores were normalized so that shuffled scores had mean 0 and standard deviation 1. Probabilities were normalized so that the maximal probabilities of real and shuffled data were 1. p=1.3×10−7, Kolmogorov-Smirnov test.

p values in E and G were calculated as the percentage of shuffled data points that are below (if mean of real data ≤ mean of shuffled data) or above real data (if mean of real data ≥ mean of shuffled data). *p ≤0.05, **p ≤0.01, ***p≤ 0.001. Error bars: mean±SEM.

See also Figures S3.

Using this method, we examined the relationship between grid phase and physical distance. In a cell group with one reference cell and its neighbors (maximal distance between neighboring cells and the reference cell: 119.5μm, Figure 4C), anatomically close neighbors showed smaller phase distances to the reference cell than distal neighbors (Figure 4D). The physical and phase distances between all cell pairs in the group were positively correlated (Figure 4E). To better visualize this relationship, we assigned each cell as the reference cell located at the origin and plotted the relative anatomical locations of other cells with small and large phase distances (phase plot, Figure S3F). The plot showed that cells with small and large phase distances were closer and distal to the origin (reference cells), respectively (Figure 4F).

We summarized data from modules with the smallest spacings across animals and found a positive correlation between phase and physical distance within 120μm (Figure 4G). Consistently, within this range, the percentage of cell pairs with small and large phase distances decreased and increased, respectively, with the increase of their physical distances (Figure 4H). Similar results were true for modules with larger spacings (Figures S3G-S3K).

The positive correlation between physical and phase distance in a small anatomical range inspired us to further investigate whether the anatomical arrangement of grid cells (anatomical phases) in local brain neighborhoods matches the arrangement of their phases determined by spatial responses (spatial tuning phases). To test this, we performed a “folding triangle analysis” (Figures S3L and S3M), in which small groups of cells were connected using non-overlapping triangles (“brain triangles”), and the spatial tuning phases of the same cells were connected using the same triangles (“phase triangles”). If the layouts of their anatomical and spatial tuning phases match, the phase triangles should show a low degree of overlap (high “folding score”). This measurement reflects more than the correlation of local phase and physical distances, because nearby cells with similar phases but with incorrect arrangement will produce overlapping phase triangles (low “folding score”). We observed that the phase triangles of real data showed significantly less overlap than shuffles, in which the phases within the local group of cells were randomly permuted (Figure 4I4K). This result revealed the well-matched distribution of anatomical and spatial tuning phases within local brain neighborhoods.

Grid phases are globally arranged in a lattice

How are grid cells arranged at larger spatial scales? We observed that the physical and phase distances of grid cells had no consistent relationship beyond 120 μm, as cells at further anatomical separations could have short phase distances (Figures 4G and S3J). In fact, the sets of cells with similar phases (“phase clusters”) not only clustered locally, but could also be widely distributed at multiple locations (Figure 5A). A spatial autocorrelogram revealed that phase clusters were arranged in a lattice (Figure 5B). The phase cluster lattice had a higher grid score (Figure S4A) than shuffled data, in which the anatomical locations of cells were preserved but the phases were randomly permuted (Figures 5C and 5D), indicating that the lattice pattern did not rely on the anatomical distribution of grid cells per se, but instead reflected their phase relationships. The lattice-shaped phase clusters were similarly observed in a module with larger spacing (Figures S4B-S4D) and additional clusters were revealed in combined FOVs (Figure S4E). In summary, among the 33 identified modules with at least 14 cells, 29 modules showed at least five local maxima near the center of their phase cluster autocorrelograms, which could be used to calculate grid scores of their phase cluster lattices (STAR Methods). We found that the grid scores of phase cluster lattices were significantly higher than shuffled scores (Figures 5E and S4F). The lattices were non-regular triangular lattices (Figures S4G-S4I). The spacing of phase cluster lattices positively correlated with the firing field spacing of the associated grid modules, suggesting a possible mechanism for different grid scales in modules (Figure S4J). Finally, the smaller spacing of phase clusters indicated that they were arranged at smaller spatial scales than pyramidal patches (Figures S4K and S4L).

Figure 5. Global arrangement of grid phases.

Figure 5.

A. Phase clusters of a group of module 1 grid cells. Cells with similar phase (phase distances <10th percentile of all distances) are assigned to the same color. Scale bar: 50μm.

B. Phase cluster lattice. Left: phase plot showing relative anatomical locations of cells with small phase distances (<10th percentile). Middle: same data as on left but spatially binned (15μm×15μm bins). Right: autocorrelogram of the middle map and its grid score.

C. Phase plot and autocorrelogram of a shuffled dataset. Annotations are the same as in B.

D. Comparison of grid scores of real data in B and its 200 shuffles.

E. Comparison of grid scores of the 29 modules with their shuffles (200/module). Grid scores were normalized so that shuffled scores of each module had mean 0 and standard deviation 1. Probabilities were normalized so that the maximal probabilities of real and shuffled data were 1. p=1.8×10−11.

F. Two models for global arrangement of grid phases. Left: spatial tuning phases of three different phase cluster sets (red, blue and yellow) in a unit-rhombus. Middle and right: in the brain, the arrangements of their anatomical locations and spatial tuning phases match (Model 1) or do not match (Model 2).

G. An example of co-modular grid cells in a FOV. Cells with the same color belonged to the phase cluster in H with corresponding color. Scale bar: 100μm.

H. Global lattice fit of cells in G. From left to right: Phases: spatial tuning phases of all cells were assigned to five clusters (five colors). Autocorrelogram: the best fit lattice generated based on two generating vectors (v1 and v2) drawn from the center to two vertices in the phase cluster autocorrelogram. Cell migration: the migration distances (orange dotted lines) of cells from their original locations (circles) to the locations matching their spatial tuning phases (orange crosses). Green, magenta and gray circles represent identified stellate, pyramidal, and unidentified cells due to unclear cell body boundaries. Note that the best fit lattice minimizes cell migration distance in the brain for the perfect match. Scale bar: 100μm.

I. Lattice fits of cells in G with “locality preserving” shuffled phases. Annotations are similar to H. Scale bar: 100μm. Note: (1) only two phase clusters (dark blue and green) were permuted (red arrows). (2) The autocorrelograms of phase clusters and the best fit lattices in H and I are very similar. (3) The cell migration distances in I are longer than that in H.

J. Comparison of fit scores of cells in G-I with real (red) and shuffled phases (gray). The score was the mean migration distance of all cells in the best fit lattice.

K. Comparison of normalized fit scores of cells with real (red) and shuffled phases (gray) in the 29 sets of co-modular cells. Fit scores were normalized so that the shuffled scores of each module had mean 0 and standard deviation 1. Probabilities were normalized so that the maximal probabilities of real and shuffled data were 1. p=1.8 × 10−5.

L. Diagram showing how to place cells in all unit-parallelograms of a lattice into a single anatomical unit-rhombus. The color and location of a cell in the unit-rhombus represent spatial tuning phase and anatomical phase, respectively.

M. Distributions of spatial tuning phases in anatomical rhombus after global lattice fit analysis, representing noise of anatomical phase maps in fitted lattices. Spatial tuning phases were represented in three color schemes (the first column, from top to bottom): 1D colors in two axes (r1 and r2) of the rhombus and 2D colors. From second to last column: perfect match between anatomical and spatial tuning phases, real data of all mice combined, real data of mouse 1, real data of mouse 2, and random spatial tuning phases. Note: due to limited sampling of lattices, some noise was introduced to the perfect case by the lattice fitting procedure. For “perfect”, “all mice”, and “random”: n=744 (29 FOVs in six mice). For mouse 1: n=236 in ten FOVs. For mouse 2: n=183 in six FOVs.

***p ≤ 0.001. Kolmogorov-Smirnov test.

See also Figures S4, S5 and S6.

While cells with similar spatial tuning phases form a phase cluster lattice, how are different phase cluster lattices relatively arranged in the brain? Our previous results showed that the local arrangements of anatomical and spatial tuning phases were well-matched. This local match and the existence of the phase cluster lattice together suggest that the local organization of grid cells may globally repeat in a lattice, in which the arrangements of anatomical and spatial tuning phases are also consistent (Figure 5F). To test this model, we developed a global lattice fit analysis, in which we laid a set of various anatomical lattices on co-modular grid cells in a large FOV. The shapes of these lattices were determined by vertices of their phase cluster lattice. The anatomical phase of each cell in a lattice was calculated as its location within a unit-parallelogram of the lattice. Among these lattices, we identified the best fit lattice, which required minimal cell migration distances in the brain to reach the perfect match between their anatomical and spatial tuning phases (Figures S4M-S4O). Thus, the migration distances were used to quantify the levels of inconsistency (“noise”) between the arrangements of anatomical and spatial tuning phases of cells in the fitted lattice. If the arrangements truly match, we expect short migration distances (low “fit score”), otherwise, the distance would be longer (high “fit score”). Since the clustering of similar phases may bias towards shorter migration distances even when the relative distributions of different phases are random, we designed “locality preserving” phase shuffles as controls to account for this effect (Figure S4P). In these shuffles the phase clustering was maintained but the relative locations of different phase cluster sets in the rhombus were permuted. These shuffles maintained the property of phase clustering, as reflected by their similar autocorrelograms to real data, and allowed us to understand the organization of phases beyond clustering. We observed that for the best fit lattice, the total migration distance of real cells was shorter than that of the “locality preserving” phase shuffles (Figures 5G5J). This result was valid not only for multiple sets of co-modular cells in several mice (Figure 5K), but also for individual mice (Figure S6A top panels), suggesting that grid phases are more likely arranged in an anatomically repeating lattice pattern.

To visualize this anatomical phase map, especially how much noise exists in the map compared to a perfect phase lattice, we placed cells from all unit-parallelograms, which constituted the best fit lattices from the above analysis, in a single unit-rhombus (anatomical rhombus). The original locations of cells (without migration) in the anatomical rhombus, i.e. their anatomical phases, were preserved to reveal the “noise” in the fitted anatomical lattice. The spatial tuning phase of each cell was represented by color (Figure 5L). A perfect phase lattice would have highly matched anatomical and spatial tuning phases, thus the distribution of cells in the anatomical rhombus would closely follow the color scheme of spatial tuning phases. We observed that although the phase map in mouse MEC was noisy, the anatomical arrangement of grid cells largely followed their spatial tuning phases, indicating that grid phases form a noisy two-dimensional lattice on the MEC cell sheet (Figure 5M, quantitative analyses: Figures S5 and S6A).

Grid cell activity propagates along consistent directions in a lattice pattern

While the phase analyses suggest a lattice arrangement of grid phases, we further asked whether the intrinsic dynamics of the grid cell network, which is independent of the phase analyses, also supports this phase map.

In a grid phase lattice, when the animal unidirectionally traverses a linear track, the activity trajectory on the MEC cell sheet should move accordingly in one direction, and this unidirectional flow should also repeat in each unit-parallelogram of the lattice (Figure 6A). Therefore, vectors from active cells (upstream cells) to their next active cells (downstream cells) within a range of a unit-parallelogram (“short vectors”) should point along consistent directions. The resultant vector of a set of these vectors should point in the direction corresponding to the motion (Figure 6A, top panel). However, vectors between all sequentially active cell pairs (each pair contains one upstream cell and one downstream cell and the vector points from the upstream to the downstream cell), regardless of their anatomical distances (“short and long vectors”), may be oriented differently, such that the resultant vector has reduced amplitude (Figure 6A, bottom panel). To test these hypotheses, we studied the directionality of vectors connecting sequentially active cells, whose spatial fields sequentially occurred during navigation (Figures 6B and 6C). Indeed, we found that short vectors exhibited higher directionality compared to those of shuffled datasets with randomly permuted calcium responses (Figures 6D6G). This high directionality was not observed when both short and long vectors were included (Figures 6H6K). This unidirectional propagation of activity within small anatomical areas during 1D navigation reflects the correspondence between anatomical and spatial tuning phase.

Figure 6. Activity propagates along consistent directions within the anatomical lattice.

Figure 6.

A. Predicted activity flow in the phase lattice map. Grid cells with different phases (green, magenta, and blue dots) are similarly arranged in each unit-parallelogram of the lattice (gray). Large gray arrow indicates activity trajectory during 1D navigation. Top: short vectors (white arrows) between sequential cell pairs in the same unit-parallelogram. Bottom: short and long vectors between all sequential cell pairs regardless of their anatomical distances (only arrows from cell 1 and cell 2 are shown for simplicity).

B. Calcium responses of a sequentially active cell pair (annotations are similar to Figure 2B) showing firing fields (pink regions) and peak ΔF/F of each field (green or magenta dot), indicating the field location.

C. Identification of the two cells in B as sequential cells. Top: field peaks indicating field locations. Pairs of sequential fields are grouped (gray boxes). Bottom: overlay of mean ΔF/F of the two cells. Note that for each pair of sequential fields, the field of cell 1 always occurred before that of cell 2, so they are a sequential cell pair and cell 1 was the upstream cell.

D. Short vectors between a group of co-modular grid cells (gray dots). Gray: fitted anatomical lattice. Vectors with angles between 120° to 300° are magenta, otherwise they are green. Scale bar: 50 μm.

E. Distribution of short vector angles and their resultant vector (yellow). Angle colors are consistent with D.

F. Comparison of resultant vector lengths of real and shuffled data of cells in D. The real resultant vector was longer than 95.5% of 200 shuffled vectors.

G. Comparison of resultant vector lengths of 13 groups of co-modular grid cells with shuffles (200/group). Lengths of resultant vectors were normalized so that shuffled vector lengths in each group had mean 0 and standard deviation 1. Probabilities were normalized so that the maximal probabilities of real and shuffled data were 1. p=7.3×10−4.

H-K. Directionality of short and long vectors between sequential cells in D. Annotations and angle colors are similar to D-G.

J. Resultant vector length of real data was longer than 17.5% of 200 shuffles.

K. Resultant vector lengths of real data were not significantly different from those of shuffles. p =0.52.

*** p ≤0.001, n.s. p >0.05. Kolmogorov-Smirnov test.

See also Figure S6.

We also examined the pattern of activity bumps on the anatomical sheet while activity propagated during navigation. If grid phases repeated in a lattice, during navigation grid cells with similar phases would be co-active and generate activity bumps forming the same lattice. We tested this hypothesis by identifying the anatomical distribution of co-active cells, which represent the pattern of activity bumps during navigation (Figure S6B). We observed that the general anatomical pattern of co-active grid cells highly correlated with the previously identified lattice pattern of phase clusters (Figures S6C-S6G), suggesting that during propagation of activity in the brain, the activity bumps also formed a lattice.

In summary, these analyses of the directionality and spatial activity patterns in the grid cell network are independent of the phase analyses and provide additional support for the lattice map of grid phases in the MEC.

Grid phase clusters are functionally independent

Lastly, if the grid phase lattice is composed of multiple repeating units (unit-parallelograms of the lattice), it is possible that cells in different units exhibit some functional autonomy. Indeed, we observed that anatomically separated phase clusters, although correlated, could exhibit some independence, as revealed by an analysis of “missed fields”. When the animal traveled along the virtual track, there were individual traversals during which the expected firing was absent in a field (a “missed field”) (Domnisoru et al., 2013). We examined whether cells in different phase clusters missed their fields together. In a group of seven grid cells in three phase clusters, we analyzed a field common to all cells by examining the significant calcium transients within the field on a run-by-run basis and calculated the missed-field pattern (Figures 7A-7C, S7A and S7B). The intra-cluster correlations of missed-field patterns were higher than the inter-cluster correlations for this field (Figure 7D) and other fields in the same cells (Figure 7E), as well as for many phase clusters in multiple animals (Figure 7F), indicating that different phase clusters are not perfectly synchronized. The functional independence of phase clusters further supports the lattice map of grid phases.

Figure 7. Phase clusters are independent functional units.

Figure 7.

A. Phase clusters of a set of co-modular grid cells, color-coded based on their phase distances to the reference cell (Ref.). Scale bar: 50μm.

B. Phase distances of grid cells with similar phase as reference cell but in same (1–3) or different phase clusters (4–6) (annotations are similar to Figure 4D). Blue box highlights a common field in all cells.

C. Missed-field patterns of the highlighted field in B in the six cells. Top: run-by-run significant transients in the field highlighted in B (each red dot is the track location of a significant transient peak). Bottom: missed-field pattern of the field in each cell.

D. Correlation of the missed-field patterns of the field in C for cells within same (intra) and in different phase clusters (inter). p=6.1×10−4.

E. Intra- and inter-cluster correlations of missed-field patterns of all fields in the cells in A. p=8.1×10−3.

F. Missed-field correlations for intra- and inter-cluster cells in 191 phase clusters in 22 FOVs of six mice. Each dot represents the mean intra- or inter-cluster correlation of the missed field patterns of a set of phase clusters. p=3.9×10−4.

G. Diagram of the micro-organization of grid cells in layer 2 of the MEC. For simplicity, stellate cells between pyramidal patches are not shown. The grid phase lattice is only shown for module 1, but similar phase lattices exist for larger modules. Grid cells in module 1 are represented in nine colors based on their spatial tuning phases and distributed in an anatomical phase lattice with six repeating units. Note that the phase map is distorted in at least two ways: (1) the global distortion of a rigid lattice to match the geometry of the module; (2) the local distortion of grid phases within each unit of the lattice: while most cells are located in color zones matching their spatial tuning phases, some cells are located in non-matching zones. Scale bar: 120μm.

**p ≤ 0.01. ***p ≤0.001. Student’s t-test. Error bars: mean±SEM.

See also Figure S7.

Discussion

Our results revealed a close correspondence between the functional and anatomical organization of the grid cell network at multiple levels (Figure 7G). First, grid cells were mainly stellate and clustered. Second, co-modular grid cells formed clusters. Third, grid cells were anatomically organized in local regions according to their spatial tuning phases, with nearby cells exhibiting similar phases. This phase pattern repeated anatomically in a global lattice. The anatomical clustering of grid cells, grid modules, and phases suggests strong intra-cluster connectivity, weak inter-cluster connectivity, and specific inputs to different clusters. These predicted connectivity patterns suggest a degree of functional independence of grid and non-grid cells, modules, and phase clusters (Diehl et al., 2017; Stensola et al., 2012).

The cell type specificity of grid cells in layer 2 of the MEC has been previously studied with conflicting results. It was reported that pyramidal cells, rather than stellate cells, were more likely to be grid cells (Tang et al., 2014). In contrast, we and another group found that grid cells were present in both cell types (Domnisoru et al., 2013; Sun et al., 2015). While the latter group showed similar abundances of grid cells in the two cell types (Sun et al., 2015), our study determined that most grid cells were stellate cells. The high percentage of grid cells in stellate cells suggests that the stellate population contains more spatial information than the pyramidal population, consistent with the role of stellate cells in encoding context information for fear memory (Kitamura et al., 2015) and estimating locations during spatial learning (Tennant et al., 2018). In addition, while recent evidence supports the existence of structural and functional connections between and onto stellate cells (Beed et al., 2013; Couey et al., 2013; Fuchs et al., 2016; Pastoll et al., 2013; Schmidt et al., 2017; Winterer et al., 2017), stellate cells are also more involved in communicating with deep layers of the MEC (Surmeli et al., 2015; Tang et al., 2015; Winterer et al., 2017), which have an abundance of grid, head direction, and grid-head direction conjunctive cells that are predicted to be important for path integration during navigation (McNaughton et al., 2006; Sargolini et al., 2006). Therefore, we propose that grid-like activity in stellate cells can be either formed locally within layer 2 or inherited from deeper layers of the MEC (Figures 7C-7E).

CAN models hypothesize that grid cell activity is generated by recurrent connectivity within a network (Burak and Fiete, 2009; Fuhs and Touretzky, 2006; Guanella et al., 2007). Typically, the neurons in the network are arranged in a two-dimensional sheet illustrating both the relationship between cells with different phases and a suggested form of biological implementation. In the simplest version of these models, the unit-rhombus representing the complete set of grid cell phases directly correlates with the local anatomical organization of cells with different phases, and therefore, anatomically nearby grid cells share more similar phases than distal cells. According to different implementations of CAN models, the network can either contain a single unit-rhombus (single activity bump), or multiple unit-rhombuses tiling the neuron sheet (multiple activity bumps) (Burak and Fiete, 2009; Fuhs and Touretzky, 2006; Guanella et al., 2007). Our results are consistent with the multi-bump model at both the local and global scales. Moreover, we also observed that instead of being regular triangular lattices, the phase lattices were skewed in the brain, similar to the elliptically distorted hexagons of pyramidal patches (Ray et al., 2014). The importance and implications of these distortions remain unclear. Lastly, the micro-organization of grid phases within a short physical distance is consistent with the recently identified short-range synapses in layer 2 of the MEC, which are mostly from excitatory cells to other cells within 100μm (Schmidt et al., 2017). These synapses likely occur between grid cells with similar phases within local brain neighborhoods and could explain the functional independence of different phase clusters.

The microstructural organization of grid cells described here provides a much finer resolution understanding of the circuits than what was previously available using electrophysiological methods, and calls for further studies of the MEC at the microstructural level. The grid phase map, although noisy, provides strong support for continuous attractor network models as prime candidates for explaining grid formation. Further studies using more advanced approaches to assess network activity of the MEC in different species will be necessary to generalize our conclusions. The relationship between the anatomical distribution of grid cells and their function in mouse MEC demonstrates how topography and function can be intimately related in neural circuits.

STAR Methods

Contact for Reagent and Resource Sharing

Further information and requests for resources should be directed to and will be fulfilled by the Lead Contact, David W. Tank (dwtank@princeton.edu).

Experimental Model and Subject Details

All experiments were performed in accordance with the Guide for the Care and Use of Laboratory Animals (http://www.nap.edu/openbook.php?record_id=12910) and the procedures were approved by the Princeton University Institutional Animal Care and Use Committee. Mice used in the two photon imaging experiments were six adult male GP5.3, which were heterozygous carrying the transgene Thy1-GCaMP6f-WPRE (Dana et al., 2014) (10-12 weeks old at the beginning of experiments), and three adult male mice, which were triple-transgenics of Emx1-IRES-Cre, CaMKIIa-tTA and Ai93 (Madisen et al., 2015) (11-22 weeks old at the beginning of experiments). The tetrode experiments were performed on four C57BL/6J male mice aged 3-6 months during experiments. Mice were maintained on a 12-hour light on / 12-hour light off schedule. All surgical manipulations and behavioral tests were conducted during their light off period. Mice were free of all known mouse pathogens (Surveillance PRIA®, Charles River, Wilmington, MA), were not involved in previous procedures, and were drug and test naïve.

Method Details

Implantation of microprism for MEC imaging

The microprism implant assembly and surgical procedures were similar to those described previously (Low et al., 2014).

Microprism implant assembly

Briefly, the microprism assembly was composed of a right angle microprism (1.5mm side length, BK7 glass, hypotenuse coated with aluminum; Optosigma) bonded to the center of a circular coverslip (3.0 mm diameter, #1 thickness, BK7 glass; Warner Instruments). The coverslip was bonded to the end of a thin metal cylinder (304 stainless steel, 0.8mm height, 3.0mm outer diameter, 2.8mm inner diameter; MicroGroup). All components were bonded together using UV-curing optical adhesive (Norland #81).

Surgical procedures

The microprism implantation was always performed in the left hemisphere as its vasculature pattern was more suitable for implantation based on previous observations (Low et al., 2014). The mouse was mounted in a stereotaxic frame (David Kopf Instruments) under anesthesia induced by isoflurane (induction: 2-3%, surgery: 0.75-1.5%). Body temperature was maintained at 37° C using a homeothermic blanket (Harvard Apparatus). Buprenorphine (5μg), dexamethasone (2mg/kg) and saline (0.9% NaCl, 0.5ml) were administered by intraperitoneal (IP) injection. A circular craniotomy (3mm diameter) was performed over the implantation site, centered 3.4mm lateral to the midline and 0.75mm posterior to the center of the transverse sinus (at 3.4mm lateral). The dura over the cerebellum was removed. Mannitol (3g/kg) was administered by IP injection 30-60 minutes before the durotomy. The microprism assembly was manually implanted, with the prism inserted into the subdural space within the transverse fissure. The gap between the skull and the implant was sealed with n-butyl cyanoacrylate tissue adhesive (Vetbond, 3M), and the implant was bonded to the skull using dental cement (Metabond, Parkell). A titanium headplate, having a single flange for external mounting on the side opposite to the side of the craniotomy, was bonded to the skull using Metabond.

Histology

Histology was performed to verify GCaMP expression in layer 2 cells in the MEC of GP5.3 mice (Figures S1C, S1D, S1I and S2H).

Transcardial perfusion and sagittal slices

Mice were deeply anesthetized with ketamine (200mg/kg) and xylazine (20mg/kg) and transcardially perfused. Mice were first perfused with 20-30 ml ice-cold PBS, followed by 30-50 ml ice-cold paraformaldehyde (4% in PBS). The brain was post-fixed in 4% paraformaldehyde for 24 hours at 4°C and then sectioned sagittally (40μm thickness) on a vibrating microtome (Vibratome Model 1500). All slices were stored in 0.1M phosphate buffer (PB, 0.019M NaH2PO4, 0.081M NaH2PO4, pH 7.4) with 0.1% NaN3.

Immunohistochemistry

To examine the expression of GCaMP6f in layer 2 of the MEC, we performed immunohistochemistry on the sagittal slices generated above with different antibodies.

The general procedure was as follows. After rinsing the slice four times with PBS for 10 minutes each time, the slice was incubated with blocking buffer (10% BSA, 0.5% triton X-100, in PBS) for one hour at room temperature. Primary antibodies were then applied at appropriate concentrations in the antibody buffer (2% BSA, 0.4% triton X-100, in PBS) for 48-72 hours at 4°C. After the antibody incubation, the slice was rinsed four times with PBS (10 minutes for each rinse). Alexa fluor secondary antibodies (Molecular Probes) were applied at 1:500 in the antibody buffer for 2 hours at room temperature. The slice was finally rinsed two times in PBS (10 minutes for each rinse) and once in 0.1M PB for 5 minutes, and mounted with Vectashield mounting medium (H-1000; Vector Laboratories). The gap between the coverslip and slide was sealed with nail polish (New York Color).

Several primary antibodies were used to target different antigens: anti-reelin (mouse IgG1, CR-50, MBL Life science) at 1:100; anti-Wfs1 (rabbit, 11558-1-AP, Proteintech) at 1:500; anti-GAD67 (mouse IgG2a, 1G10.2, EMD Millipore) at 1:500. Secondary antibodies targeting different species or mouse IgG isotypes of the primary antibodies were conjugated with Alexa fluor dye 568 or 647 so that their emission spectra were largely separated from that of GCaMP6f.

We observed that GCaMP6f was expressed in three major cell types (interneurons, pyramidal and stellate cells), which were characterized using specific antibodies against Wfs1, reelin, and GAD67 (Chin et al., 2007; Kitamura et al., 2014). While Wfs1 specifically labeled pyramidal cells, reelin was expressed in both stellate and a subpopulation of interneurons, which were further distinguished by the interneuron-specific antibody GAD67. We found that GCaMP6f+ neurons showed immunoreactivity to either Wfs1 or reelin. GCaMP6f was highly expressed in pyramidal and stellate cells (77.6±5.0% and 91.0±1.2%, respectively), but rarely observed in interneurons (24.0±6.5%). Only 3.3±1.1% of reelin+/GCaMP6f+ neurons were identified as interneurons, which expressed GCaMP6f at lower intensity comparing to stellate cells (Figures S1D-S1F). Therefore, the contamination in reelin+ stellate cells by interneurons was negligible and all the observed reelin+ neurons were considered as stellate cells.

Confocal imaging

The mounted slices were imaged under a confocal microscope (A1Rsi; Nikon) using a 20x (CFI Plan Apo Lambda 20×, NA 0.75; Nikon) or 40x objective (CFI Plan Fluor 40× Oil, NA 1.3; Nikon). The fluorescence signals of GCaMP6f, Alexa fluor dye 568, and 647 were sequentially collected, except the co-staining of reelin and Wfs1. Since the fluorescence signal of Wfs1 was much stronger than that of reelin, the signal of Wfs1 could contaminate the signal of reelin. We therefore performed a spectrum excitation over the range of 547–733 nm and isolated the emission signals from two major peaks, which corresponded to reelin and Wfs1, using the “blind unmixing” function in the NIS elements confocal software (Nikon).

Classification of pyramidal and stellate cells

In brain slices, pyramidal cells generally exhibited smaller cell body diameters than stellate cells. The diameters of GCaMP6f+ cell bodies in layer 2 showed a bimodal distribution. This bimodal distribution of cell body diameters was also observed in vivo by two-photon imaging, indicating that the diameters could be similarly used to distinguish the two cell types in calcium imaging data. Detailed information is described below.

Measuring diameters of cell bodies

Since the shapes of the cells in layer 2 of the MEC were mostly elongated in one direction, their diameters were determined as the length of the long axis of their cell bodies and measured in vitro and in vivo as follows. The diameters of cells in in vitro sagittal brain slices were measured based on a confocal z-stack of the slice. For each cell, the image containing the maximal size of its cell body was selected and the boundary of its cell body was manually outlined. The long axis of the cell body was defined as the long axis of the ellipse, which best fit the cell shape (using the MATLAB function “regionprops”).

For cells in an in vivo field-of-view (FOV), we took a two-photon z-stack containing the focal plane of the FOV to identify their maximal cell bodies. We found that the cells with clear boundaries and nuclearly excluded GCaMP6f expression in the FOV were mostly “in-focus” cells and their maximal cell bodies could be found in the current FOV. However, cells with blurry edges and unclear GCaMP6f expression pattern were “out-of-focus” cells and their maximal cell bodies were normally present in adjacent focal planes in the z-stack. Therefore, the cell body diameters of “in-focus” cells were directly measured in the current FOV, whereas the diameters of “out-focus” cells were identified in adjacent focal planes in the z-stack. We discarded cells that could not be clearly identified in either the current FOV or the z-stack. The diameter, which was the long axis of the cell body, was then determined using the method described for in vitro data.

Cell classification in vivo (Figures S1I-S1M)

The classification of the two cell types in vivo was based on clustering cell body diameters into two distributions. Given the fact that the bimodal distribution of cell body diameters in vitro strongly correlated with the two different cell types (Figures S1I-S1K), and that a similar diameter distribution was also observed in vivo (Figures S1L and S1M), we reasoned that the bimodal distribution of in vivo diameters also correlated with the two cell types. Therefore, we performed k-means clustering on the in vivo cell body diameters and the number of clusters was set to two. The cells in the small and big diameter clusters were classified as pyramidal and stellate cells, respectively.

Identification of pyramidal cells in the same patch

In the same FOV, the pyramidal cells in different patches were identified based on their physical locations (in X and Y axes) in the FOV. The X and Y coordinates of all pyramidal cells were clustered by k-means and the different clusters correspond to individual patches. The optimal number of patches was obtained using the MATLAB function “evalclusters” under the Calinski-Harabasz clustering evaluation. Since the size of the FOV was 410μm×410μm (0.168mm2) and the density of pyramidal patches in dorsal MEC is approximately 15 patches/mm2 (2.5 patches /0.168mm2) (Naumann et al., 2016; Ray et al., 2014), we reasoned that each FOV should contain no more than three patches. Therefore, one to three clusters were evaluated to obtain the optimal number of patches. Only patches with more than 10 pyramidal cells were analyzed in Figures 2E, S2F, S2G and S2N. The X and Y coordinates of the center of a patch were calculated as the mean coordinates of all cells within the patch.

Spacing of pyramidal patches

The spacing of a pair of pyramidal patches was measured as the distance between their center coordinates, as defined above. The spacing distributions in Figure S4L included all individual spacings between every pair of pyramidal patches.

Virtual reality for imaging

The virtual reality (VR) system was similar to that described previously (Low et al., 2014). Mice ran on an air-supported spherical treadmill (20cm diameter) while their heads were held fixed under a two-photon microscope by clamping the headplate to the arm of a support column located on the right hand side. The treadmill was constrained by a ball bearing-mounted axle inserted into the equator on one side so that the sphere only rotated in the forward/backward direction. Forward and backward motions were measured using an optical motion sensor (ADNS3080; red LED illumination) controlled with an Arduino Due. The VR environment, which was projected onto a toroidal screen surrounding the mouse, was rendered in blue and projected through a blue filter (Edmund Optics 54-462) to reduce the entry of projected light into the microscope’s fluorescence collection system (517-567nm bandpass collection filter). ViRMEn software (Aronov and Tank, 2014) was used to display and control the VR environment, which was a 1000 or 1800 cm long linear track with textured walls and columns as visual cues. Two water rewards (4μl each) were separately given at the beginning and the end of the track. Upon running to the end of the track, mice were teleported back to the beginning of the track.

Training in virtual reality

Mice were allowed to recover for five days after surgery. Water restriction began on the sixth day and mice received 1ml of water per day. After 2-3 days of water restriction, mice began daily behavioral training (45-60 min) on the VR system at approximately the same time each day. During all training sessions, the mouse’s head was positioned under the microscope and oriented in the same manner as for imaging experiments. Imaging experiments began when mice reached a daily performance criterion of 2-4 rewards per minute (after 10-15 training sessions).

Two-photon imaging during virtual navigation

Imaging setup

As described previously, imaging was performed using a custom-built, VR-compatible two-photon microscope (Low et al., 2014) with a rotatable objective. The 920nm excitation laser was delivered by a mode-locked Ti:sapphire laser (Chameleon Ultra II, Coherent, 140fs pulses at 80MHz). The laser scanning was achieved by a resonant scanning mirror (Cambridge Tech.). Fluorescence of GCaMP6f was isolated using a bandpass emission filter (542/50nm, Semrock) and detected using GaAsP photomultiplier tubes (1077PA-40, Hamamatsu). Black rubber tubing was attached to the objective (Olympus 40×, 0.8 NA) as a light shield covering the space from the objective to the imaging window. Ultrasound transmission gel (Sonigel, refractive index: 1.3359 (Larson et al., 2011); Mettler Electronics) was used as the immersion medium. The optical axes of the microscope objective and microprism were aligned at the beginning of each experiment as described previously (Low et al., 2014).

Imaging control and data acquisition

Microscope control and image acquisition were performed using ScanImage software (v5; Vidrio Technologies (Pologruto et al., 2003)). Images were typically acquired at 30hz at a resolution of 512 × 512 pixels (~410 × 410 μm FOV). Average beam power measured at the front of the objective was typically 60-90mW. Imaging and behavioral data were synchronized as described previously (Low et al., 2014) by simultaneously recording the voltage command signal to the galvanometer together with behavioral data from the VR system at a sampling rate of 1kHz, using a Digidata/Clampex acquisition system (Molecular Devices). In general, 18,000-63,000 frames (10-35 min depending on the length of the track and behavioral performance) were collected from each FOV during one behavioral trial.

General processing of imaging data

Motion correction

Two-photon image time series were analyzed using custom MATLAB code. Motion correction was performed using a whole-frame, cross-correlation-based method via MATLAB scripts and ImageJ (Schneider et al., 2012) plugins (Template Matching and Slice Alignment). In general, the imaging stacks were read, down-sampled in MATLAB and then imported to ImageJ to obtain the subpixel shifts for each frame, which led to the maximal cross correlation between the frame and the template. Frames were then shifted in MATLAB by applying a rigid transformation with linear interpolation for fractional shifts (Giovannucci, 2017).

Practically, while the raw imaging data of one imaging session were acquired as multiple time series stacks with 1002 frames per stack (raw stack), each stack was down-sampled by averaging every three frames (334 frames /stack, down-sampled raw stack). The first 150 frames of the first raw stack were removed due to image distortion during the starting of the resonant scanner. The stack in the middle of the imaging session (reference stack) was first motion corrected using its median as a template. This motion correction was iterated and the template was updated each time. The correlation of the median of the corrected stack with the template was computed each time. The motion correction algorithm iterated until the difference of the correlations in consecutive correction sessions were less than 0.00005 (5-10 iterations were normally required), indicating that the quality of the motion correction was maximally optimized. The median of the corrected reference stack was further used as the template for all other down-sampled raw stacks. Subsequently, each down-sampled stack was corrected 10 times according to the template. The required shifts in all frames were normally close to zero after the 10 corrections.

Note that although the original imaging acquisition frequency was 30 Hz, the effective acquisition frequency of the motion-corrected data was 10 Hz due to the down-sampling mentioned above.

ROIs, raw fluorescence, ΔF/F, significant transients

All regions of interest (ROIs) were identified by the following algorithm, except for pyramidal and stellate cells that were manually annotated and identified in related analyses (Figures 2, 3G, 3H, 5H, 5I, S1G, S1L-S1N, S2C, S2F, S2G, S2I, S2J, S2M, S2N, S4K, S4L). Details about the ROI extraction algorithm is described as follows. For each FOV, motion-corrected stacks (≤ 40 stacks) were used to identify ROIs. The stacks were first down-sampled by a factor of 2 in all three dimensions (time and spatial axes (X and Y)). The whole FOV was then evenly split as nine blocks. For each block, an independent component analysis (ICA) based algorithm (Mukamel et al., 2009) was used to identify ROIs (parameters: mu=0.7, 30 principal components, 150 independent components, s.d.threshold=3). Independent ROIs in the nine blocks corresponding to individual cell bodies in the FOV were manually identified and retained for subsequent analyses. Fluorescence time series of these ROIs were extracted from all motion-corrected stacks.

For each cell, a negative offset, which was produced by ScanImage5 and indicated the voltage value of zero in the case of zero signal, was subtracted from its fluorescence time series so that all fluorescence values were non-negative. Remaining negative values, which only existed in very few cases, were set to zero. The fractional change in fluorescence with respect to baseline (ΔF/F) was calculated as (F(t) - F0(t)) / F0(t), similar to what described previously (Low et al., 2014). F0(t) denotes baseline fluorescence over time, which was estimated as a sum of two components: F0(t) = Fs(t) + m. Fs(t) denotes the smoothed fluorescence signal, calculated as the 8th percentile of F(t) within a ±15s moving window centered at time t. The m is a small, constant value such that, under baseline conditions, F0(t) matches the local mean of F(t) and ΔF/F has mean zero. m was calculated for each cell as the mean of F(t) - Fs(t) over a set of time points (baseline points), during which no transients or other fast fluctuations occurred. The baseline points were mathematically determined as points, the standard deviations of which were smaller than stdmin+0.05*(stdmax-stdmin). stdmin and stdmax were the minimal and maximal standard deviations among all data points within a 20 frame (±1s) moving window, respectively. The significant calcium transients were identified as transients that exceeded cell-specific amplitude and duration thresholds so that the artefactual fluctuations were expected to account for less than 1% of detected transients, as described previously (Heys et al., 2014).

Position-related calcium signals

Analysis included only motion-corrected data points (effective acquisition frequency: 10 Hz, i.e., frame time interval: 0.1s), during which the mouse's running speed met or exceeded a speed threshold, which was specifically calculated for each imaging/behavioral session as follows. For each session, the instantaneous running speed of an imaging frame n was calculated by dividing the instantaneous travel distance (i.e., track position difference between frame n and frame n-1, 0 if n=1) by the frame time interval (0.1s). All positive speeds of the session were binned into 100 bins and the bin edge of the first bin was set as the speed threshold of the session. In our data, the thresholds largely (95.4%) varied from 0.7 to 2.0 cm/s, whereas mean running speeds (the average positive speed of a session) were mostly (94.9%) distributed from 10 to 45 cm/s.

To calculate mean ΔF/F as a function of position along the virtual linear track, the track was divided into non-overlapping 5cm bins and the mean ΔF/F within each bin was calculated. Heat plots, which showed ΔF/F as a function of position across multiple traversals along the track, were similarly generated except that the mean ΔF/F within each 5cm bin was calculated for each individual traversal. For display purposes, color values representing the mean ΔF/F were normalized to span the minimum and maximum values for each cell. As explained in Figure 2B, a black color in heat plots indicates bins without imaging data for two reasons: (1) within the bin the mouse traversed below the speed threshold, so the imaging data was eliminated from the analysis. (2) Within the bin the mouse traversed at very high speed, so there was no imaging data in the bin. Note that the effective acquisition frequency in motion-corrected data was 10 Hz. When the mouse’s running speed in a 5cm bin was above 50 cm/s, the bin contained no imaging data because the mouse spent less than 0.1 s within the bin. This high speed was frequently observed in well-trained mice running in 1D virtual reality.

Tetrode recordings

Tetrode recordings provided ground truth information for distinguishing cue cells from grid cells (Figures S1R-S1U), module assignment (Figures S2O-S2T), and phase calculations based on 1D responses (Figures S3B-S3E).

Microdrives

Customized microdrives were similar to those described previously (Domnisoru et al., 2013), except they were smaller and lighter. 3D printed microdrives (APProto) were assembled manually. Tetrodes, which were made of PtIr (18 micron, California Fine Wire), were plated using Platinum Black (Neuralynx) to 100-150kΩ at 1kHz. Shuttles were made of dental acrylic and moved with an embedded drive screw. Each shuttle contained two tetrodes. A reference wire (0.004” coated PtIr, 0.002” uncoated 300μm top) was placed into the brain at a similar depth as the tetrode, but medial to the MEC on both hemispheres. A stainless steel screw or wire above the cerebellum was used as reference ground.

Electrode recording system

The system was similar to that described previously (Aronov and Tank, 2014). Custom headstages were designed (PADS), printed (Sunstone Circuits), and assembled at the Princeton Physics Department electronics facility. The headstage design was identical to the one used previously (Aronov and Tank, 2014), with extra solder pads to power two LEDs to track animal location and head orientation. A lightweight 9-wire cable (3m, Omnetics) connected the headstage to the electrode interface board, which was customized to mate with the headstage for these miniature microdrives. 32 input channels were filtered (5 Hz-7.7 kHz), amplified, and multiplexed by the headstage into a single output using a multiplexing amplifier array (Intan Technologies, RHA2132). The multiplexing array used a 1MHz crystal oscillator clock for 32 channels, which provided a sampling rate of 31.25 kHz to each channel. The multiplexed signals were digitized with a data acquisition card (National Instruments, PCI-6133) and acquired using custom software in Matlab.

Surgery

The surgery was performed as described previously (Domnisoru et al., 2013). The mouse skull was tilted in the anterior-posterior direction by 18 degrees (Bregma tilted upwards) so that the microdrive could be implanted vertically. Bilateral craniotomies were performed at 3.2mm lateral to the midline and just rostral to the lambdoid suture. A headplate was centered on the skull and affixed with dental cement (Metabond, Parkell). Shuttle screws driving the tetrodes were retracted by 2-4 turns and mineral oil was applied inside the cannula of the microdrive. The microdrive was then mounted on the stereotaxic arm and lowered so that the bottom of the cannula touched the dura of each craniotomy. A fillet of composite (Dentin, Parkell) was made around the cannula to protect the inside tetrodes from the Metabond. The Metabond was then applied to affix the microdrive to the skull. Once the Metabond solidified, the tetrodes were lowered at least 1mm into the brain by slowly turning the screw on each drive by 4-6 turns. Animals woke up within 10 minutes after surgery and were able to walk and lift their heads.

Environment—real 2D arena

The real 2D arena was a 0.5m square environment with black walls (≥30 cm high) made from plastic sheet or foam board. The floor was made of styrofoam. Black vertical construction rails (Thorlabs) defined the corners of the arena. A single white cue card was placed on one wall. The arena was positioned near the virtual reality setup for easy transfer of the animal when plugged into the headstage between the two systems, which facilitated the recording of the same cells in both environments. In most cases, a single light was positioned above the area to illuminate the environment. In some cases, the light was turned off so that only the LED light on the headstage was present during the recording.

Environment—virtual reality

The virtual reality system was similar to that described previously (Domnisoru et al., 2013). The virtual environments were 800cm-long 1D linear tracks with different wall textures and visual cues along the tracks. ViRMEn (Aronov and Tank, 2014) was used to design and display the virtual linear track on the toroidal screen, deliver water rewards under control of a solenoid valve, and monitor running velocity of the mouse. The animal ran on a cylindrical treadmill, the rotational velocity of which was proportional to mouse velocity. This velocity was measured using sequential sampling of an angular encoder (US Diginal) on each ViRMEn iteration (~60 iterations per second).

Training in real 2D arena and virtual reality

At least one week after surgery, animals were introduced to the real 2D arena. They quickly began to regularly explore the arena and forage for chocolate crumbs (Hershey’s milk chocolate) during these training sessions. The animals were then trained to run on the virtual linear tracks.

Behavior during recording

Animals were first placed in a real 2D area and neural activity was recorded as they foraged for small pieces of chocolate scattered in the arena at random times. Trials generally lasted 10-20 minutes.

Animals were then transferred to the virtual reality setup and ran along a virtual linear track. Most animals were recorded on just a single virtual track. To collect 1D data for module assignment, the animals were recorded when they ran on two different virtual tracks sequentially.

Position tracking in the real 2D arena

A Neuralynx acquisition system (Digital Lynx) was used for the video tracking (Domnisoru et al., 2013). Two LEDs with different colors were attached to the headstage plugged into the animal’s microdrive. The locations of the LEDs were tracked by Neuralynx Cheetah acquisition software based on images taken by a color video camera above the arena. The midpoint between the two LEDs was defined as the animal’s location.

Timing

Digital timing signals were used to synchronize all computers. These signals were sent and acquired using a NI-DAQ card and transmitted once per iteration in ViRMEN (60Hz).

General processing of tetrode data

Data analysis was performed using custom MATLAB code. Electrophysiology data were first demultiplexed and filtered (500Hz highpass). Spikes were detected using a negative threshold, which was set to be three times the standard deviation of the averaged signal across all electrodes on the same tetrode. Features of extracted waveforms were calculated. The features included the baseline-to-peak amplitudes of the waveforms on each of the tetrode wires, and the top three principal components calculated from a concatenation of the waveforms from all wires.

Cluster separation

Features of the waveforms were plotted with a custom Matlab GUI and polygons were manually drawn in the feature space to define clusters. All data from one day were grouped and analyzed together. Criteria for eliminating clusters from the dataset were: (1) units with less than 100 spikes (in the real 2D arena or virtual tracks); (2) the minimal spatial firing rate along the virtual track was larger than 10Hz and the maximal firing rate was larger than 50Hz; (3) the tetrode was positioned outside of the MEC based on histology.

Spatial firing rates

Position data were subsampled at 50Hz and spikes were assigned to the corresponding 0.02 second bins. Velocity at the spike time point was calculated by smoothing the instantaneous velocity with a moving window of 1 second. Only data in which the animal’s velocity exceeded 1cm/sec were used for further analysis.

Spatial firing rates in the real 2D arena were calculated as follows. The 2D arenas were divided into 2.5×2.5cm non-overlapping spatial bins. Spike counts and the total amount of time the animal spent in these bins were convolved with a Gaussian window (5×5 bins, σ=1 bin). The firing rate in each bin was given by the smoothed spike counts in the bin divided by the time spent in the bin. Firing rate was not defined for bins visited for less than 0.3 seconds.

Spatial firing rate on virtual linear tracks were computed as follows. Virtual tracks were divided into 5cm non-overlapping spatial bins. Spike counts and the total amount of time the animal spent in these bins were convolved with a Gaussian window (3-point, σ=1 bin). The firing rate in each bin was calculated as the smoothed spike count in the bin divided by the smoothed time in the bin.

Quantification and Statistical Analysis

Except the last section “Tetrode data analysis”, all the following sections are analyses of calcium imaging data recorded in 1D virtual reality.

Statistics

Values in bar graphs or curves with error bars are reported as mean±SEM. Statistical analyses are described in figure legends and below in individual sections. Most statistical analyses used standard parametric approaches, such as t tests (for Gaussian-distributed data) and Kolmogorov-Smirnov tests (for non-Gaussian-distributed data). Significance was defined using a p value threshold of 0.05. In figures, we use different numbers of “*” to represent different ranges of p values: *p ≤0.05, **p ≤0.01, ***p ≤0.001.

Classifying grid cells based on 1D calcium responses

In- and out-of-field periods

The in- and out-field periods in the 1D calcium-dependent responses of cells were similarly determined as those in previous studies (Domnisoru et al., 2013; Heys et al., 2014; Yoon et al., 2016). The mean ΔF/F, ΔF/F and significant-transient-only traces, which occurred when the running velocity was greater than the velocity threshold (see “Position-related calcium signals”), were used for the analysis. In- and out-of-field periods were defined by comparing the mean ΔF/F value in each 5 cm bin to that of a random distribution created by 1000 bootstrapped shuffled responses. Each bootstrapped shuffled response was generated by rotating the ΔF/F of the entire recording so that for every time point of the recording, its track position was preserved but its calcium response was changed. The ΔF/F trace was rotated by starting the trace from random sample numbers chosen from the interval 0.05 × Nsamples to 0.95 × Nsamples, where Nsamples was the number of samples in the ΔF/F trace. A shuffled mean ΔF/F was calculated for each rotation. For each 5 cm bin, a pvalue equaled the percent of shuffled mean ΔF/F that were higher than the real mean ΔF/F. Therefore, 1-pvalue equaled the percent of shuffled mean ΔF/F lower than the real mean ΔF/F. In-field-periods were defined as three or more adjacent bins (except at the beginning and end of the track where two adjacent bins were sufficient) whose 1-pvalue ≥0.8 and for which at least 10% of the runs contained significant calcium transients within the period. Out-of-field periods were defined as two or more bins whose 1-pvalue≤0.25. Bins with intermediate mean ΔF/F remained unassigned.

1D grid cell classifier

The 1D classifier used to identify grid cells based on their 1D responses was identical to what was used previously (Yoon et al., 2016), which was itself a modified version of a previous classifier (Domnisoru et al., 2013) to be compatible with cells having a larger grid scale. The criteria were as follows. (1) a grid cell must have at least two spatial fields on a track. (2) The 1D response of grid cells must have a number of transitions between an in-field and out-of-field period for a track of length L larger than L/(5w), where w is the mean field width of the 1D response. (3) The widest field of the response must be smaller than 5w. (4) At least 30% of the bins must be assigned to either in-field or out-of-field periods. (5) The mean ΔF/F of in-field periods divided by the mean ΔF/F of out-of-field periods must be larger than 2.

Cue cells (Figures S1R-S1V, S2A-S2C)

We augmented our 1D classifier with a method to identify a recently discovered non-grid spatial cell type in the MEC, which represent environmental features (Diehl et al., 2017; Kinkhabwala, 2015). In virtual reality, these cells are termed ‘cue cells’ because their firing fields are tied to salient cues on virtual linear tracks (Kinkhabwala, 2015). These firing field patterns can sometimes produce misclassification of cue cells as grid cells in our original grid cell classifier. Therefore, cue cells, which accounted for 7.28±1.3% of cells originally classified as grid cells, were eliminated from the grid cell corpus used in further analyses (Figures S1R-S1V). Although not further analyzed, most cue cells (66.8±7.8%) were stellate cells and anatomically intermingled with grid cells (Figures S2A-S2C). The procedure for identifying cue cells is described below.

Cue cells were identified based on their cue score, which was developed to measure the correlation between the 1D response of cells and the visual cues of the linear track (Kinkhabwala, 2015). The pattern of visual cues was expressed as a cue template, which was calculated at 5cm spatial bins along the track. Values in most bins of the template were set to 0, whereas the bins containing visual cues were set to 1. This template captured both the locations and the spatial extents of the cues. For tracks with asymmetric cues only cues on the right were used to create the template as we found the MEC cells on the left hemisphere, where we always imaged, mostly responded to cues on the right, but rarely to those on the left (data not shown).

To calculate the cue score, the cross-correlation between the cue template and the 1D response was first calculated under spatial shifts (lags) up to 300 cm in both directions. The peak in the cross-correlation with the smallest displacement from zero was chosen as the best correlation of the firing rate to the cue template. The lag at which this peak occurred was then used to displace the cue template to best align it with the 1D response. Having found the best lag to align the activity with the cue template, we then selected a subset of the track close to and including the visual cues (termed ‘cue bins’) so that we could calculate the correlation between the activity and the cue as follows. For each visual cue represented by the cue template, the cue-bins were defined as those within the extent of the cue and those extending past the cue in both directions by the half-width of the cue. Cues located near the start or the end of the track were removed from the analysis if their cue bins exceeded the range of the track. A local correlation of the template and 1D response within the cue-bins was calculated. The local correlations of all cues were similarly calculated and their mean was defined as the “cue score”.

Cue cells in imaging data were identified by comparing their cue scores with the cue scores of shuffled data (Kinkhabwala, 2015). 200 shuffled 1D responses were generated for each cell by circularly permuting the ΔF/F, identical to what was described for the pvalue analysis. The mean ΔF/F and cue score of each shuffled response was calculated. The distribution of all shuffled cue cell scores combined (203400 shuffles for 1017 imaged cells) was used to calculate a threshold at the 95th percentile. The cells with cue scores above the threshold were identified as cue cells and removed from the grid cell population. Based on our previous study, this method effectively distinguished grid cells from cue cells, which generally did not correlate well with visual cues at consistent locations (Kinkhabwala, 2015).

Assigning grid modules based on 1D calcium responses

Grid modules are typically determined by the clustering of spatial response scales in two-dimensional (2D) environments (Stensola et al., 2012). Previous work showed that the 1D response of a grid cell was well approximated as a slice through a 2D triangular lattice; the 2D field width, spacing, and orientation of the cell were estimated as the width and spacing of the lattice, and the angle of the slice, respectively (Yoon et al., 2016). Since the 2D grid fields are typically grazed by 1D slices, and slices can skip one or more adjacent fields depending on angle, we reasoned that the best estimates of the 2D field width and spacing are the largest 1D field width and smallest 1D field spacing, respectively. Furthermore, if a group of grid cells cluster into more than one module, their 1D spacings and widths should also form separate clusters corresponding to the modules. To obtain a robust module assignment, we clustered the 1D field spacings and widths of the same set of grid cells measured on two different virtual linear tracks or two different trials on the same track in four-dimensional space, and assigned cells to different modules according to this clustering (Figure 3A).

To demonstrate that we could accurately distinguish grid modules using this method, we recorded grid cells using tetrodes in both 2D real and two 1D virtual environments (Figures S2O-S2T). Module identities were determined from the 2D real environment data (‘ground truth’) and separately estimated using clustering of the 1D field widths and spacings in the two 1D tracks.

The detailed procedures for the assignment are described below. The analysis for the ground truth tetrode data is described in “Tetrode data analysis”.

Modified pvalue

As described above, a set of pvalue thresholds and 5cm bin widths, which were similar to those used previously (Domnisoru et al., 2013; Heys et al., 2014; Yoon et al., 2016), were applied to identify spatial fields and to classify grid cells. However, since grid cells in different datasets exhibited various noise levels and drifts in their spatial tuning, the same set of parameters could not always be used to faithfully identify every field of every cell in every dataset. Since the module assignments required precise identification of spatial fields for the measurements of field widths and spacings, we modified the parameters for different imaging sessions. Based on manual inspection of cells in each dataset, the pvalue thresholds for in-field periods were set from 0.75 to 0.95. A 2.5cm bin width was used to better separate out firing fields, especially ones that were spatially close. The same parameters were applied to all cells in a given FOV.

We also observed that while most cells exhibited good run-by-run consistency of their responses, some imaging sessions contained cells in which spatial tuning drifted across many runs. These drift responses mostly occurred at the beginning of the behavioral session when the mouse was just exposed to the VR. To more precisely identify in-field periods for these cells, we computed a stability score, as described previously (Yoon et al., 2016). For an imaging session with N runs, the stability score was the averaged pairwise Pearson’s correlation coefficient of all pairs of single-run responses within a consecutive n-run block [i, i+n-1]. n is generally 10–30 depending on the length of the recording and the consistency of the run by run activity. We repeated this process for different starting positions i in steps of 1 run, starting from i = 1 up to i =N-n+1. We finally selected the n-run block with the largest mean stability score for all cells in the same imaging session and analyzed all cells within this block.

After these modifications, we discarded cells whose identified fields did not match manual inspection.

1D spacing and 1D field width of a cell (Figure 3A)

Adjacent field spacing was measured as the distance between two adjacent field centers. The 1D field spacing of a cell was then determined as the shortest spacing among all the adjacent field spacings. Field width was measured as the spatial width a field spanned. The 1D field width of a cell was determined as the largest width among all field widths.

Assigning cells to modules

The 1D field spacings and widths of simultaneously imaged cells on two VR tracks (or two trials of the same track) were obtained based on their 1D responses on the two tracks (or two trials on the same track), as described above. The cells were clustered based on four parameters: 1D field spacing on track1 (or trial1), 1D field width on track 1 (or trial 1), 1D field spacing on track 2 (or trial 2), and 1D field width on track 2 (or trial 2). The clustering was performed by k-means and the optimal number of clusters was obtained using the MATLAB function “evalclusters” under the Calinski-Harabasz clustering evaluation. One to six clusters were evaluated. The clustering of cells was then used to assign their module identities. In rare cases, the ratio of mean 1D spacings of cells in two different clusters were equal or smaller than 1.1. We considered that these cells belonged to the same module.

Phase distances of co-modular grid cells

The phase distances of simultaneously imaged co-modular grid cells were calculated by fitting their 1D calcium dependent responses on the same VR track to parallel slices in a 2D triangular lattice. The accuracy of this method was tested by applying the analysis to tetrode-recordings of grid cells in both real 2D and virtual 1D environments (Figures S3B-S3E). The cells’ pairwise 2D phase distances were calculated based on their 2D responses (‘ground truth’) and then separately estimated using the best fit parallel slices of their 1D responses in the same 2D triangular lattice.

The details for identifying phase distances from 1D data are as follows. The analysis for ground truth tetrode data is described in “Tetrode data analysis”

Brute-force database

In order to fit cells’ 1D responses to the best slice of a 2D lattice, we first generated a large, ‘brute-force database’ (database 1) containing a large number of modeled 1D responses of grid cells along slices though 2D lattices, which were regular triangular lattices and the widths of all fields (local Gaussian peaks) were equal. The spacings of the 2D lattices were evenly sampled numbers from 10 to 1000cm at 10cm intervals. The field widths of the lattices were determined by the standard deviations (σ) of the Gaussian peaks. For each spacing, we generated 2D lattices whose standard deviations were 10 evenly spaced numbers between σmin and σmax, which generated the minimal and maximal field widths (narrowest and widest Gaussian peaks), respectively:

σmin=0.03σmax=Spacing2×2×ln(50))

The maximal lengths of the slices were 1800cm. The angles of slices were 30 integer angles from 0 to 29 degrees. The starting points of the slices were 121 points evenly distributed in a unit-rhombus, which is the smallest repeating unit of the triangular lattice. In summary, the database contained 3630000 modeled grid cell responses on a 1D track, the maximal length of which is 1800cm.

Fitting simultaneously imaged co-modular cells to slices of a 2D triangular lattice

The 1D mean ΔF/F traces of simultaneously imaged co-modular grid cells were fit using parallel slices of the same 2D triangular lattice. In particular, for each group of co-modular cells, a set of candidate 2D triangular lattices with a range of spacings in the brute-force database was first selected as follows. The minimal spacing of the lattices was 10cm, which was the minimal spacing of lattices the brute-force database. The maximal spacing of the lattices was determined based on the 1D spacings of the simultaneously imaged co-modular grid cells. The density distribution of 1D spacings of all cells was first estimated based on a normal kernel function (using MATLAB function “ksdensity”). The spacing with the highest distribution probability was used as the main spacing (MS) of these grid cells. The maximal spacing of candidate triangular lattices was calculated as:

maximal spacing=2×MS3

This maximal spacing above could be any number, whereas the spacings of lattices in the brute-force database were discontinuous numbers. Therefore, the maximal spacing of the candidate lattices in the database were further determined as the smallest sampled spacing of the database that was larger than the maximal spacing.

The mean ΔF/F of co-modular grid cells were compared with modeled 1D activity patterns, which were generated from parallel slices in the candidate lattices. The similarity of real 1D activity patterns with each simulated 1D slice was quantified by the Pearson’s linear correlation coefficient between them (fit score). For each set of parallel slices under a specific angle in a 2D lattice (note that these slices have different starting points in the rhombus), we found the best fit slice for each cell and averaged the fit scores for all the simultaneously recorded co-modular cells. The 2D lattice with the best average score was then considered as the best fit lattice for these cells, and the spacing of this lattice and the angle of the best fit slices in this lattice were set as s1 and a1, respectively.

There were at least two complications affecting the accuracy of the slice fitting. First, the 1D spatial tuning could drift throughout multiple traversals. Therefore, we only used the activity in the subset of traversals, which had highest stability score (as described above in the section “Assigning grid cells to modules based on their 1D responses”). Second, in some imaging sessions, we observed that in more than half of the cells, prominent fields existed at the beginning and the end of the track, where the rewards were delivered. These fields were generally narrow and precisely aligned to the reward locations. These fields were likely triggered by the rewards, rather than grid activity pattern. In datasets for which this was the case, we only considered the activity between the two reward locations for the purposes of slice fitting.

Significance of the slice fitting

The significance of the fitting of co-modular cells was evaluated by comparing the fitting results to 100 shuffled datasets. The shuffled activity of a cell was generated by randomly shifting its in-field periods along the track. Individual data points of the out-of-field periods and unassigned periods were randomly placed in gaps between shuffled in-field periods. If only a part of the original 1D response was used for the slice fitting, as mentioned above, the shuffled activity was generated from the same part of the 1D response. The shuffles generated by this method still contained the original fields (albeit rearranged) and allowed us to test whether the distributions of these fields followed the 1D slice pattern through a 2D triangular lattice.

Each set of shuffled data, which contained shuffles for each co-modular cell, was similarly fit using parallel slices in triangular lattices in the brute-force database 1, as described above for the real data. The significance of the fit of the co-modular cells was calculated as the percentile of its fit score among the fit scores of 100 shuffled data sets.

Optimization of the slice fitting

After validating the statistical significance of the slice fit of real data in the brute-force database 1 and obtaining the spacing of the best fit lattice and the angle of the best fit slices in the lattice (s1 and a1, as described above), the slice fit was further refined in two steps: (1) If the spacing of the best fit lattice was smaller than 1m, we further optimized the spacing and angle by fitting the co-modular cells in database 2, which contained lattices under finer sampled spacings from 40cm to 1m with an interval of 0.25cm. After this step, we obtained a new best fit lattice with spacing s2 with slices at angle a2. We did not perform this step if the spacing of the best fit lattice of cells was larger than 1m. For these cells, s2=s1, a2=a1. (2) After obtaining s2 and a2, we further optimized the starting points in the unit-rhombus as follows: the 1D responses were fitted in a database 3, which contained a single lattice with spacing s2. Parallel slices at the angle a2 were created under 961 evenly distributed starting points (note that there were only 121 starting points sampled in previous database 1, so database 3 provided finer sampling of starting points of slices) in the unit-rhombus. The new set of optimized starting points led to the higher fit score in database 3.

Phase distances of grid cells (Figure S3A)

After optimizing the slice fit, the phases of grid cell 1D responses were determined as the starting points of their slice fits in the unit-rhombus. The phase distance of a pair of co-modular grid cells was therefore calculated as the distance of their starting points in the same unit-rhombus. Due to the symmetry of the triangular lattice, all the connecting points of the lattice were mathematically identical. Therefore, to calculate the phase distances of two cells (cells a and b), we fixed the starting point of cell a and placed the starting point of cell b at the nine mathematically identical locations around nine fields. The phase distance of a and b was calculated as the shortest distance between the starting point of cell a and the nine starting points of cell b.

Pairwise phase distances versus physical distances

Plots of phase distance versus physical distance (Figures 4E, 4G, S3H and S3J) were generated as follows. For Figures 4G and S3J, we computed all physical distances between cell pairs in a given FOV, and concatenated these distances together across all FOVs into a single vector X. Likewise, we concatenated the corresponding pairwise phase distances into a vector Y. We then binned the elements of X using a bin width of 30 μm. Next, for all cell pairs within each physical distance bin (X bin), the corresponding phase distances in Y were grouped and the mean and standard errors of each group were calculated and plotted against the centers of X bins, producing a “binned phase distance versus physical distance curve.”

We generated shuffled “binned phase distance versus physical distance curves” by randomly permuting the elements of Y with respect to X and applying the same procedure as above. We generated 100 such shuffled (binned) curves and took their average to produce a “mean shuffled curve.” Finally, the value of the curve computed from real data in a given bin was determined to be significantly different from the overall mean phase distance when it was further (in absolute value) from the value of the mean shuffled curve in that bin than 95% of the shuffled curves.

For Figures 4E and S4H, the same procedure was applied with X and Y replaced by vectors of pairwise distances for a single collection of cells in the same FOV.

The plots for the pairwise physical distances versus the percentage of cell pairs within a certain range of phase distances (Figures 4H and S3K) were generated from pairwise physical distances (vector X) and pairwise phase distances (vector Y) described above. The elements of X were binned using a bin width of 15 μm (X bins). Only elements in X bins ≤ 120 μm were used in the analysis. In each of these bins, N represented the total number of elements, and n represented the number of elements, the phase distances of which were within a particular range (e.g., above 90th percentile of all elements in Y). The n/N (as a percentage) was plotted against the center of its X bin.

Phase plot (Figure S3F)

We created “phase plots” to visualize the dependency of phase distance on the 2D relative offset between cell anatomical locations, rather than just their physical distance (i.e., the length of the 2D offsets). For a given reference cell c, we shifted the physical positions of all (simultaneously fitted, co-modular) cells so that c was at (0,0), and colored the other cells according to their phase distance from c. This was repeated for each choice of reference cell in the given set, and the individual plots were then overlaid to form a summary plot across all cell pairs. In this final plot, colors of dots, which indicated phase distances between a cell and a centered reference cell, were all renormalized to the same color scale. Cells within a certain range of phase distances could be further eliminated or kept in the plot depending on the purpose of different analyses.

Grid score of phase clusters

Score calculation (Figure S4A)

The “grid score of phase clusters” was calculated from the autocorrelogram of a modified phase plot, which was constructed only from cell pairs with similar phases; it depended on two parameters, percentile a and bin width b, as follows. We first collected 2D-offsets between cell anatomical locations (revealed in the phase plot) only for those cell pairs whose pairwise phase distance was below the ath percentile of all phase distances. This collection of 2D offsets (phase plot) was then binned using bin width b to generate a 2D histogram H. H can be thought of as the density of 2D offsets between cells with similar phases. In what follows, we refer to the 2D autocorrelogram of H as “the autocorrelogram,” which we used to study the pattern of grid cells with similar phases (phase clusters). The vertices (local maxima) around the center of the autocorrelogram typically produced a distorted hexagonal grid.

We calculated grid scores of the autocorrelogram using a previously described method, which allows both isotropic (equilateral triangle) and anisotropic (squeezed or stretched) grids to assign high scores despite elliptical distortions in a hexagonal grid (Yoon et al., 2013). Specifically, we first identified 5-6 vertices nearest to the center of the autocorrelogram (the grid score of an autocorrelogram with less than five vertices could not be calculated), fitted those vertices with an ellipse, and transformed the autocorrelogram to a regular triangular lattice by applying a linear transformation so that the long and short axes of the ellipse became equal. Given the transformed autocorrelogram, we defined an annular region with inner radius Ri and outer radius Ro, and rotated the autocorrelation map in steps of 60° to compute the Pearson correlation between the rotated and the original map. The grid score was defined by the minimum difference between crests and troughs in rotated correlations.

Grid-score(Ri,Ro)=min[ρi,o(60°),ρi,o(120°)]-max[ρi,o(30°),ρi,o(90°),ρi,o(150°)]

where ρi,o(ϕ) was the correlation value when one map was rotated by angle ϕ relative to another over the annular region defined by Ri, Ro.

We repeated this by letting Ri change from 0.5r to r and Ro change from Ri + 1 cm to 0.5r (or to the maximum allowed value based on the autocorrelogram), each independently and in steps of 1cm. r was the mean distance to the nearest neighboring vertices of the central lattice in the transformed autocorrelogram. The grid score of the cell was then defined as the maximum score over these various annular regions.

Finally, the above procedure was repeated over a fixed range of values for parameters a and b, and the highest grid score so obtained was defined to be the “grid score of phase clusters” for that set of cells. The percentile a could take values 5, 10, 15, 20, 25, 30. The bin width b was the same in the X and Y directions and could take values 10, 15, 20, and 25 (units = μm).

Significance of the score

The significance of the grid score of phase clusters for a set of cells was determined by comparing the score with those of shuffled data. The shuffled data were created by preserving the anatomical locations of all cells while randomly permuting their phases. The phase distances, phase plot, and grid scores were generated as for real cells. The significance of the grid score of real cells was given by its percentile among grid scores of 200 shuffled data sets.

Spacing of phase clusters

Here and below, unless otherwise indicated, “the autocorrelogram” now refers to the autocorrelogram computed with the optimal parameter values, yielding the best grid score as describe above (and therefore defining the “grid score of phase clusters”).

The “spacing of phase clusters” was measured using the untransformed version of this autocorrelogram. Its “vertices” were defined to be its six local maxima nearest to the origin. The spacing in Figure S4J was determined as the mean distance from these six vertices to the origin. The spacings in Figure S4L are the individual distances from the six vertices to the origin, not their mean.

Shape of phase cluster lattice (Figures S4G-S4I)

The “shape of the lattice of phase clusters” was determined from the same untransformed autocorrelogram as above. We first identified the two vertices (local maxima) of the autocorrelogram nearest to the origin, excluding reflections; denote the corresponding vectors (pointing from the origin to the vertices) by v1 and v2, with v1 the shortest and v2 the second shortest.

We now apply the following transformations to v1 and v2 together, in sequence (1) the unique rotation and scaling transformations sending v1 to (1,0); (2) the transformation v2 → −v2, if the y-coordinate of v2 is negative (i.e., v2 is below the x-axis); (3) v2 → v2 + (1,0), if the x-coordinate of v2 is negative. After these transformations, v2 now has x-coordinate between 0 and 0.5, and length at least 1. If a lattice is a regular hexagon, the angle of v2 should be 60 degrees, so its x-coordinate should be 0.5, and its length should be 1. In our results, we observed that the x-coordinate of all the v2 vectors were between 0 and 0.5, suggesting a bias in the set of lattice deformations occurring in the phase maps.

Folding triangle analysis (Figures S3L and S3M)

We applied a method that we called a “folding triangle analysis” to reveal how the physical arrangement of grid phases in the brain neighborhood matched their phase arrangement in the unit-rhombus. Only the 29 sets of co-modular cells with at least five local maxima in the autocorrelation of phase cluster lattice (Figure S4F) were included in this analysis.

Identifying cell groups, triangulation in the brain

For each cell (center cell) in a set of co-modular cells, the cells within a certain distance (r) surrounding it were identified. The center cell and its surrounding cells were called a “cell group”. The parameter r was determined based on the half minimal spacing (s/2) of the spatial autocorrelogram of phase clusters of the set of co-modular cells. If s/2 was shorter than 50μm, r was set to s/2. Otherwise, r was set to 50μm. Only cell groups with at least four cells were used to calculate folding scores.

Non-overlapping triangles (brain triangles) were drawn between cells in the same cell group using the Delaunay triangulation algorithm. The resulting assignment of cells to triangles was held fixed in the computation of a folding score from cell phases, as follows.

Triangulation in phase unit-rhombus, folding score

Cells in a cell group were assigned new locations in phase space based on their spatial tuning phases as follows. The center cell was assigned a phase location equal to its original phase. The remaining cells were assigned phase locations given by the phase offsets between their original phases and the center cell phase: i.e. their phase locations could be shifted in order to ensure the shortest distances to the center cell phase (as mentioned above in “Phase distances of grid cells” and Figure S3A). Cells were assigned to triangles (phase triangles) using the same assignment as in real brain space.

The folding score of a cell group was calculated based on the phase triangles. It was the ratio of the area of the smallest polygon that contains all the triangles to the sum of the areas of all the individual triangles. If the phase arrangement matches the cell arrangement in the brain, the folding score should be close to 1 because the phase triangles are relatively non-overlapping. Otherwise, the folding score should be much smaller than 1.

The folding score of a set of co-modular cells was the mean folding scores of all cell groups in the set. Many cells were involved in more than one cell group.

Comparing to shuffles

One shuffle of a set of co-modular cells was generated by randomly permuting the phases within each cell group while maintaining their physical locations. The folding score of this shuffle was the mean folding score of all permuted cell groups in the set. 100 shuffles were generated for each set to obtain 100 shuffled folding scores.

Global lattice fit analysis (Figures S4M-S4P)

The global lattice analysis was designed to quantify the global, continuous layout of the 2D grid phases across each field of view. Only the 29 sets of co-modular cells whose autocorrelation of phase cluster lattice showed at least five local maxima (Figure S4F) were included in this analysis, because these local maxima were required for constructing candidate lattices, as described below.

Fitting by a rigid lattice derived from autocorrelation vertices

The vertices1 in the autocorrelogram of phase clusters indicate a potential phase lattice in brain space. To further quantify the map-like arrangement of phases in the brain, we used the lattice generated by the autocorrelogram vertices to try to rigidly map the physical cell locations directly to their phases in the unit-rhombus, as described below. Note that as we will see, there are several such phase-mappings consistent with a single lattice L of autocorrelogram vertices; each phase-mapping is determined by a specific choice of vectors (v1,v2) in L. These vectors determine the exact alignment of the unit phase rhombus with the autocorrelation vertices (or hypothetical brain lattice).

More specifically, recall that the 2D phases in the unit-rhombus can be described as vectors H · ρ, for elements ρ ∈ [0,1]2 (the unit square) and H=[112032]. Then a choice of vectors v1, v2, along with a shift s ∈ [0,1]2, determines a linear lattice fit as follows. Define the 2 × 2 matrix V = [v1 v2]. Then for each cell location x in brain coordinates, the vector

Hmod(V1x+s,1) (Equation 1)

defines an anatomical phase of a cell in the unit-rhombus. We quantified the quality of the mapping in Equation by 1 comparing anatomical and spatial tuning phases. More specifically, to fit for optimal map parameters, we performed the following procedure:

1) As described in “Grid score of phase clusters,” for each set of co-modular cells in a FOV, we first computed an autocorrelogram from the modified, binned phase plot H, using the percentile and bin width parameters a and b which yield the highest grid score (and using the same parameter ranges as described in that section). However, to improve robustness, we now additionally rejected parameter values, regardless of grid score, if the number of autocorrelogram vertices produced by those parameter values was less than the maximum number of vertices produced across all parameter values for the same set of cells (usually, six vertices).

Finally, at the end of this process, we had an autocorrelogram with some number of vertices (local maxima). Note that by design, the autocorrelograms coming from the real data each had six vertices; however, by chance, some shuffled autocorrelograms (see “Comparing to shuffles preserving local structure of phase map”) could have fewer vertices. As long as there are at least four vertices, one can perform the following analyses. In our analysis, since the autocorrelograms of shuffles were very similar to that of real data (locality preserved shuffles, see “Comparing to shuffles preserving local structure of phase map”), we did not observe any shuffle with less than four vertices.

2) Let P denote the set of vectors corresponding to the vertices of the autocorrelogram from 1). The set P is initially symmetric about 0 (i.e., it consists of pairs (p, −p)), so we removed one vector from each pair (p, −p) from P before the next step (if not, the next step would result in redundant fits).

3) For each choice of 2 distinct vertices p1, p2P, we constructed the 8 shortest vectors in the lattice L(p1, p2) generated by p1 and p2 (here, L(p1, p2) is the set mp1 + np2 for all integers m and n). To do this we first constructed a pair of shortest generating vectors p~1, p~2 for L(p1, p2). The 8 shortest vectors E then consist of (p~1,p~2,p~1+p~2,p~1p~2) and their negatives. Finally, the candidate vector pairs to define V in Equation 1 consisted of all pairs v1, v2 of vectors in E such that L(p1, p2) = L(v1, v2) (technically, these are the pairs v1, v2E such that the matrix [v1v2]1[p~1p~2] has determinant = ±1; there are 40 such pairs).

4) For every candidate lattice vector pair (v1, v2), we searched over a set of shifts, parameterized by the vector s in the unit square, with the coordinates of s ranging independently over [0,0.2,0.4,0.6,0.8]. For every complete choice of parameters (v1, v2, s), we compared the proposed phase map in the brain (“anatomical phases”) to the true phases in the phase rhombus (“spatial tuning phases”) as described in Equation (1) above (Figure S4O). The fit score was defined to be the average “phase distance” in the unit-rhombus between the anatomical phases and spatial tuning phases. In other words, this is the average migration distance for all cells in order to reach the perfect match between the anatomical and spatial tuning phases.

Comparing to shuffles preserving local structure of phase map (“locality preserving shuffle”)

In order to test for global structure in the phase pattern, above and beyond the structure of local phase clustering, in this analysis we created shuffles which preserved some amount of the local phase structure of the data. Rather than shuffle all the phases at random, we first clustered the phases in the unit rhombus, and then shuffled the clusters. More specifically:

1) For each set of co-modular cells, we clustered the phases in the unit-rhombus into N disjoint sets using MATLAB’s built-in hierarchical clustering, with the distance between phases given by their distance in the unit-rhombus, and the distance between clusters given by the average pairwise distance between cluster elements. We took N = 5 for all co-modular cell sets.

2) For each phase cluster t constructed in 1), we defined its center c to be the center of mass of the phases in that cluster in the unit-rhombus (which is well-defined when the phases are sufficiently close to each other). A shuffle consisted of a permutation of the N clusters. To permute cluster t1 to cluster t2, we translated the phases in t1 by the unique translation of the rhombus sending cluster center c1 to c2 (Figure S4P).

3) For some shuffles, the non-robustness of the vertex finding algorithm led to vertices which corresponded to highly skewed, unrealistic lattices. To avoid this phenomenon, we rejected shuffles for which the best fit lattice failed to pass a number of regularity criteria. Specifically, we rejected a shuffle if its best fit vectors v1, v2 had:

abs(cos(angle(v1,v2)))>0.9,v1v2mean(v1,v2)<0.5,

or if the minimum norm of v1 and v2 for the shuffle was less than 0.8 times the minimum norm of v1 and v2 for the data, and similarly for 1.2 times the maximum norm (here, ∣x∣ denotes the Euclidean norm for a 2d vector x). All these criteria were meant to ensure that the shuffles were not too different than the data (recall that the shuffle test was meant to preserve the autocorrelation as much as possible).

Estimating the noise of phase lattice map

Modeling phase lattice map with noise (Figure S5)

To visualize the noise of a phase map consistent with our previous analyses, we created a family of noise models, which we matched to the data. For a given set of co-modular cells in a FOV, we first obtained the modeled anatomical phases of cells in the unit-rhombus of a regular triangular lattice with spacing p and a random rotation in the brain. The spacing p was set equal to the mean of the two smallest peaks in the original phase cluster autocorrelogram of the co-modular cells. The ideal spatial tuning phases were the set equal to the anatomical phases. Second, we added noise to the ideal spatial tuning phases in the form of random vectors in the unit-rhombus. For a given noise level r, the vectors had random angles and their lengths ranged between 0 and 3r/2 so that the average vector length was r.

For each set of co-modular cells, we constructed 10 sets of noisy phases under six values of r, evenly spaced between 0 and √¾, as well as 10 sets with completely random phases, for which the noise vectors were drawn uniformly from the rhombus. We then created a fit curve (shown in the Figure S5B) by applying the global lattice fit analysis to all simulated phase datasets and averaging the fit scores for each noise level. Finally, we identify the noise level of each co-modular cell set by interpolation of this curve and finding the noise level that matched the mean fit score of the cells.

Plotting anatomical phase lattice map in anatomical unit-rhombus (Figure 5L)

The anatomical phases of all cells were plotted in the same anatomical unit-rhombus and colored according to their spatial tuning phases. The spatial tuning phases can be represented in both 1D and 2D color schemes, as illustrated in the Figure S5E.

Vector direction analysis

This analysis was used to quantify the directional flow of activity in the brain during 1D navigation by measuring the consistency of directions of vectors between cell pairs active in sequence. Since this analysis required enough sampling of phases in unit parallelograms of the anatomical lattice, only 13 sets of co-modular cells (among the 29 sets with at least five local maxima in the phase cluster autocorrelogram, as shown in Figure S4F) with at least three cells per anatomical unit-parallelogram on average were chosen for this analysis.

Identifying sequential cell pairs (Figures 6B and 6C)

Sequential grid cell pairs should have spatial fields that occur one after another; this sequential activation can repeat many times as multiple fields are crossed for each cell. Specifically, spatial fields were identified based on the pvalue, as described above. The track location with the maximal mean ΔF/F within a field was termed as the “field location’. For each pair of cells, if the field location distance of their two, closely-occurring fields (one field from each cell) was shorter than S, these two fields were called sequential fields. S was defined as follows: the density distribution of 1D spacings of all co-modular grid cells was first estimated based on a normal kernel function (using MATLAB function “ksdensity”). The spacing with the highest distribution probability was used as the main spacing (MS) of these cells. To ensure that two fields were truly sequential fields elicited within a short distance on the track, we set S=0.4 × MS.

Only cell pairs with at least two pairs of sequential fields were considered to be potential sequential cell pairs and used in the following analysis. For these cell pairs, if most fields of cell A occurred before those of cell B, we defined cell A as an upstream cell of cell B, and vice versa, cell B as a downstream cell of cell A.

Consistency of vector directions of sequential cell pairs

As illustrated in the top panel of Figure 6A, to only connect sequential cells within a scale of an anatomical unit-parallelogram (a repeating unit of the anatomical phase lattice), vectors were generated between sequential cell pairs within the anatomical distance D, which was the minimal length of lattice vectors used to generate the best fit anatomical phase lattice for these cells (as described in “Global lattice fit analysis”). The length of the vector between a sequential cell pair was set to 1 and its direction was set from the upstream cell to the downstream cell. The resultant vector length of all these vectors was used to quantify the consistency of vector directions: the longer the resultant vector length was, the more consistent vector directions were. The resultant vector length was calculated using a MATLAB toolbox “CircStat” (Berens, 2009).

As illustrated in the bottom panel of Figure 6A, to connect all sequential cells in the FOV regardless of their anatomical distances, vectors were generated between all sequentially active cell pairs in the FOV and the resultant vector length was similarly calculated as described above.

Comparing to shuffles

The shuffles were generated by randomly permuting calcium responses among all co-modular cells in the FOV. Vectors between sequential cells were similarly generated and the resultant vector length was calculated, as described above. 200 shuffles were used for each group of co-modular cells.

Anatomical pattern of co-active cells (Figure S6B)

This analysis was used to identify the anatomical pattern of cells that were active around the same location of the track and test whether these co-active cells formed a lattice, as predicted by the autocorrelogram of phase clusters.

Autocorrelogram of co-active co-modular cells

As described above, the activation of a grid cell was defined when the grid cell showed significant spatial fields along a virtual track. The track was binned under a bin width of 12.5cm. For each bin, cells with field locations (as defined above in “Vector direction analysis”) within the bin were called “co-active cells” in the bin. A single two-dimensional matrix with the same number of pixels as the imaging FOV was generated so that the areas of these co-active cells were set to 1 and other pixels were set to 0. An autocorrelogram of this matrix was generated using the MATLAB function “normxcorr2”. The autocorrelograms were similarly generated for all the bins and averaged as a single autocorrelogram (AA), which reflected the general pattern of co-active cells in the FOV.

Correlation of the autocorrelograms of co-active cells and phase cluster lattice

To quantify whether the co-active cells formed a similar lattice to that predicted by the autocorrelogram of phase clusters (as defined in “Grid score of phase clusters”), a correlation coefficient was calculated between the averaged autocorrelogram of co-active cells (AA) and the autocorrelogram of phase clusters. The AA was binned using the same bin width used for the autocorrelogram of phase clusters.

Comparing to shuffles

The shuffles were generated by randomly permuting calcium responses among all co-modular cells in the FOV. A new averaged autocorrelogram of co-active cells was similarly generated and its correlation coefficient with the autocorrelogram of phase clusters was calculated. 50 shuffles were used for each group of co-modular cells in a FOV.

Missed-field pattern of cells in phase clusters

Identifying cells in different phase clusters

The identification of cells in anatomically-separated phase clusters was determined by two parameters: x and y. The parameter x was a percentile of phases distances of all analyzed co-modular cells in the same FOV and served as the phase similarity threshold for defining phase clusters in this analysis. The parameter y was a physical distance, and it served as the distance threshold to separate cells into different phase clusters. The values of x and y were determined as follows: (1) for a set of co-modular cells, the phase cluster autocorrelogram of which contained at least five local maxima and therefore the grid score of the autocorrelogram was calculated, x was set equal to the phase distance percentile parameter “a” that generated the highest grid score (see “Grid score of phase clusters”), and y was determined as 0.8 × (the shortest spacing of the phase cluster autocorrelogram) (see “Spacing of phase clusters” for the calculation of spacings of the phase cluster autocorrelogram). (2) For other sets of co-modular cells, x and y were set to 15 (i.e., the 15th percentile) and 70μm, respectively.

The phase clusters were identified on a cell-by-cell basis as follows. For a cell A, we first identified the n cells with their phase distances to A no longer than x percentile of all phase distances (so that the total number of cells in the group was n+1, including cell A). The COMs of these cells were then clustered n-1 times using the k-means algorithm, as the number of clusters was varied from 2 to n, producing a sequence of n-1 sets of clusters for a cell group containing n+1 cells. For each set of clusters, we calculated two parameters: (1) p: the maximal pairwise physical distances between cells in the same clusters, and (2) c: the minimal pairwise physical distances between the COMs of the clusters. We only kept the sets of clusters, for which p <= y (cells in the same clusters were close enough) and c >= y (cells in different clusters were far enough). Among the sets of clusters satisfying these criteria, we determined the optimal set of clusters using the MATLAB function “evalclusters” with the Calinski-Harabasz clustering criterion. In this way, the group of n+1 cells was assigned to N anatomically separated clusters, for which N≤n.

This procedure was repeated for each cell so that each cell could select one set of phase clusters under the criteria above. Some cells did not have phase clusters either because they did not have cells with similar phases, or because none of their cluster sets met the criteria above. We then kept unique sets of phase clusters to perform the missed-field analysis below.

Missed-field pattern of a cell (Figures S7A and S7B)

The missed-field pattern of a cell was calculated as the mean of missed-field patterns across the cell’s spatial fields, which were identified based on the pvalue of the ΔF/F, as described above. In turn, the missed-field pattern of an individual spatial field was defined to be a binary vector with one entry per run, calculated as follows: first, run-by-run significant transients were identified at 1% false positive rate across the whole session, as described previously. The coordinate of a given spatial field’s missed-field pattern for a given run was set to 1 if that run had a significant transient with its peak located within the field; otherwise it was set to 0. This missed-field patterns, which were vectors composed of 0s and 1s, were similarly generated for all spatial fields. These vectors were further averaged as the missed-field pattern of the cell.

Missed-field correlation of cells in phase clusters

The missed-field correlation of a pair of cells was calculated as the Pearson’s correlation coefficient of their missed-field patterns. The correlations of cell pairs in the same phase cluster (intra-cluster correlation) and in different phase clusters (inter-cluster correlation) were calculated. Particularly, in Figure 7F, the averaged correlations of cell pairs in the same and different phase cluster were termed as the “inter” and “intra” cluster correlations, respectively.

Tetrode data analysis

Classification of grid cells based on 2D responses

The unbiased autocorrelation of the 2D firing rate in the real arena was calculated (Hafting et al., 2005). Starting from the center of the 2D autocorrelation function, an inner radius was defined as the smallest of the following three radii: (1) where the radial autocorrelation was at a local minimum; (2) where the autocorrelation was negative; (3) 10cm. Multiple outer radii were used from the inner radius+4 bins to the size of the autocorrelation-4 bins in steps of 1 bin. For each of these outer radii, an annulus was defined between the inner and the outer radius. We then computed the Person’s correlation between each of these annuli and its rotation in 30 degree intervals from 30 to 150 degrees. For each annulus we calculated the difference between the maximum of the 60 and 120 degree rotation correlation, and the minimum of the 30, 90, and 150 degree correlations. The grid score was defined as the maximum of all of these differences across all annuli.

A grid cell was defined to be a cell with a grid score exceeding a certain threshold, which was generated from shuffled grid scores as follows. For each cell, its shuffles were generated with spike time circularly permuted by a random amount of time chosen between 0.05×Nsamples and 0.95×Nsamples, where Nsamples was the number of samples in the whole recording. Grid score was similarly calculated for each shuffle. 400 shuffles were generated for each cell and the distribution of shuffled grid scores of all cells combined were used to calculate a grid score threshold at the 95th percentile.

Grid modules based on 2D responses (Figures S2O-S2T)

The grid modules were assigned as described previously (Stensola et al., 2012). Only grid spacings were used for the analysis because they were sufficient to generate the clustering of grid cells in the two animals we analyzed. The number of modules was determined based on the number of peaks in the kernel smoothed density (KSD) estimate of log grid spacings (using Matlab function “ksdensity”) of cells in the same animal. We set the bandwidth parameter σ for the ksdensity function according to the following formula:

σ=an+b,

where n is the number of grid cells, a = 10, and b = 105. The number of modules p was defined to be the number of peaks in the KSD estimate.

The assignment of cells to grid modules was then determined via k-means clustering of the grid spacings, with the number of clusters (modules) set to p, and the number of iterations for the k-means algorithm set to 300.

2D phase distances

The ground truth datasets for the comparison of 1D and 2D grid phases were taken from a previous study (Yoon et al., 2013). The 2D phase distance between a pair of grid cells was given by the geodesic (shortest-path) distance between the phases of the two cells.

Cue cells based on 1D firing rates (Figures S1R-S1U)

The cue cells among tetrode-recorded cells were identified by their cue scores, which were calculated as for imaged cells, with firing rates replacing calcium response traces. To calculate the cue score threshold, 400 shuffles were generated for each cell by circularly permuting their spikes, using the same algorithm as for the pvalue analysis. The mean firing rate and cue score of each shuffled response was calculated. The combined distribution of all shuffled cue scores was used to calculate a threshold at the 95th percentile. The tetrode-recorded cells whose cue scores exceeded this threshold were identified as cue cells.

In- and out-of field periods for 1D firing rates

The in- and out-of-field periods for 1D firing rates were computed as in (Domnisoru et al., 2013) by comparing the firing rate in each bin to shuffled firing rates, as follows. Similar to the procedure performed for calcium imaging data, 1000 bootstrapped shuffles were generated for each firing rate and the 1-pvalue for each spatial bin (5cm) was calculated (see ‘In- and out-of-field periods’ for calcium response analysis).

Out-of-field periods were defined as two or more adjacent bins for which 1-pvalue ≤ 0.05. Candidate in-field periods were defined as three or more adjacent bins (except at the beginning and end of the track, where we only required two or more adjacent bins) all satisfying 1-pvalue ≥ 0.85. The candidate in-field periods were then extended, by no more than one bin on each side, if those adjacent bins satisfied 1-pvalue ≥ 0.70. Finally, firing fields were defined as the candidate in-field periods with spikes on at least 20% of all runs (the remaining candidate in-field periods were left unassigned).

As with the calcium data, the noise level and drift in spatial tuning varied across data sets. Therefore, slightly different 1-pvalue threshold for in-field-periods and subsets of the traversals with higher run-by-run consistency were selected in different datasets based on their stability scores so that the identified spatial field matched manual inspection. The same 1-pvalue threshold was used for all cells in the same animal recorded on the same virtual track. We discard cells, whose identified fields did not match manual inspection.

1D spacing and field width

The 1D spacing and field width for tetrode-recordings were identified by the same method used for calcium responses, described above. The adjacent field spacings for a cell were defined to be the distances between field centers for all pairs of adjacent fields, and the cell’s 1D spacing was defined to be the minimum adjacent field spacing. The 1D field widths of a cell were defined to be the maximum field width across all its spatial fields.

Grid modules based on 1D responses

The assignments (Figures S2T and S2Q) were performed as for imaged grid cells, based on the clustering of four parameters (1D field width and spacing on two different tracks, as described above) via k-means.

1D phase distances of co-modular grid cells

The 1D phase distances of tetrode-recorded co-modular grid cells (Figures S3B-S3E) were calculated as for imaged grid cells, using the starting points of their fitted slices in the same unit-rhombus, with firing rates replacing activity traces for the slice fitting.

Data and Software Availability

Data and custom MATLAB codes will be available upon request to the Lead Contact.

Supplementary Material

1

Figure S1. Cellular-resolution two-photon imaging of grid cells in layer 2 of the mouse MEC during virtual navigation, related to Figure 2.

A. Microprism implant placement for cellular-resolution imaging of the MEC.

B. Strategy for chronic cellular-resolution optical access to the MEC using a 1.5mm right angle microprism inserted into the transverse fissure.

C. Parasagittal slice of the MEC from a GP5.3 mouse stained with Wfs1 and reelin antibodies. Region between the two dashed yellow curves is layer 2, in which GCaMP6f was highly expressed in stellate (reelin+) and pyramidal cells (Wfs1+, wolframin ER transmembrane glycoprotein 1).

D: dorsal; V: ventral; P: posterior; A: anterior. Same in all figures. Scale bar: 100μm. D. Parasagittal slice showing expression of GCaMP6f in reelin+ neurons, which included stellate cells and reelin+ interneurons in layer 2 (the region between the two dashed yellow curves) of the MEC in GP5.3 mice. Interneurons were stained with GAD67 antibody. Scale bar: 50μm.

E. Percentage of different reelin+ neurons expressing GCaMP6f. First two columns show percentages of GCaMP6f+ stellate cells and reelin+ interneurons. Last column shows percentage of reelin+ interneurons among all reelin+ neurons. Intnr: interneuron.

F. Fluorescence intensity of GCaMP6f, which was quantified by mean gray value, in stellate cells and reelin+ interneurons. Intnr: interneuron.

G. Percentages of stellate (Ste) and pyramidal (Pyr) cells that expressed GCaMP6f. Note: since only 3.32 ±1.1% of reelin+ neurons were interneurons (D and E), contamination in reelin+ stellate cells by interneurons was negligible and all the observed reelin+ neurons were considered to be stellate cells.

H. In vivo two-photon image of GCaMP6f-labeled cell bodies in layer 2 of the MEC in GP5.3 mice. Scale bar: 50μm.

I. Pyramidal and stellate cells in layer 2 of the MEC (the region between the two dashed yellow curves) had different cell body diameters in in vitro brain slices (parasagittal). Left panels, from left to right: expression of GCaMP6f in layer 2 neurons of the MEC; Wfs1 staining reveals pyramidal cells; reelin staining reveals stellate cells. Middle panels: overlay of GCaMP6f with Wfs1 (left) or reelin (right). Right panel: diameters of cell bodies. Each dot represents the COM of one cell with a color representing the diameter of its cell body. Scale bar: 50μm.

J. Cell body diameters of GCaMP6f+ layer 2 neurons in the MEC measured in in vitro brain slices. Left: diameters of individual cells. Magenta and green dots represent pyramidal and stellate cells, respectively. Right: distribution of cell diameters of all GCaMP6f+ layer 2 cells in vitro is shown by both a histogram (bars) and a kernel density estimate (red curve).

K. Identification of pyramidal and stellate cells based on their diameters. Magenta and green dots represent real pyramidal and stellate cells, respectively.

L. Cell body diameters of pyramidal and stellate cells in vivo. Left: layer 2 neurons in the MEC in vivo imaged using a two-photon microscope. Middle: diameters of cells in vivo. Each dot represents the COM of one cell with a color showing the diameter of its cell body. Right: identified pyramidal (magenta) and stellate (green) cells based on their cell body diameters. Scale bar: 50μm.

M. Cell body diameters of GCaMP6f+ layer 2 neurons of the MEC in vivo. Top: diameters of individual cells. Each dot represents one cell. Bottom: the distribution of all cell diameters shown by a histogram (bars) and a kernel density estimate (red curve).

N. Distributions of pyramidal and stellate cells identified in vivo in two mice (left and right examples). Green and magenta dots represent the COMs of stellate and pyramidal cells, respectively. Scaler bar: 100μm. D: dorsal. V: ventral. M: medial. L: lateral. Same in all following figures.

O. Schematic diagram of experimental apparatus, consisting of an air-supported spherical treadmill, axle positioned to constrain treadmill rotation to the forward/backward direction, visual display system for VR (RM, reflecting mirror; AAM, angular amplification mirror, toroidal screen, a megapixel camera to record treadmill rotation, PC running ViRMEn software), custom two-photon microscope with rotatable objective, headpost (headplate was mounted only on the right side of the animal), and a water-reward delivery system.

P. Schematic of a 1000-cm virtual linear track used for navigation during imaging of neurons in the MEC. Blue light was displayed to reduce detection of projected light by the microscope.

Q. Spatial dependence of calcium transients of an imaged grid cell. Top: heat plot of ΔF/F versus linear track position for a set of sequential traversals (Runs). Middle: mean ΔF/F versus linear track position, Bottom: 1-pvalue function (1-p, dark blue) along the track, indicating statistical significance of the calcium signals in each spatial bin compared to shuffled data. In- and out-of-field periods (red and gray blocks) were identified based on the 1-pvalue within the periods.

R. Example of schematic response of a cue cell that matches the distribution of salient cues along the virtual track. From top to bottom: side view of a 1000-cm long VR track; the cue template of the track showing the distribution of salient cues; 1D response of a cue cell on the track.

S. To calculate the cue score, the 1D response of a cue cell was shifted according to its correlation to the cue template. Top: cross-correlation between the cue cell response and cue template under spatial shifts (lags) up to 300 cm in both directions. Middle: cue template. Bottom: 1D response of the cue cell was shifted by the amount of the lag, at which the correlation was maximal.

T. Cue score was calculated as the mean correlation between each cue and the 1D response around the cue. Five cues were involved in the calculation for this example. The last cue, which was located at the very end of the track (indicated in S), was removed from the analysis. Cells with cue scores above the 95th percentile of shuffles were identified as cue cells.

U. Tetrode-recorded cue cells and grid cells on a VR track. Each cell was recorded in a real 2D environment and 1D VR track. For each cell: left top: spikes (red dots) and trajectory (gray trace) in a 0.5×0.5m real 2D environment. Left middle: firing rate in the 2D environment, calculated based on the spikes on top. Left bottom: autocorrelogram of the firing rate in the middle. Right top: spikes (red dots) and trajectory (gray trace) on multiple traversals of the 1D VR track. Right middle: firing rate along the track calculated from the spikes on top. Right bottom: overlay of cue template (C.T., in red) and shifted firing rate (F.R., in gray) according to the lag.

V. Imaged cue cells and grid cells on a VR track. Cells were only imaged on 1D VR tracks and classified based on the grid cell classifier and their cue scores. For each cell: top: heat plot of ΔF/F versus linear track position for a set of sequential traversals. Middle: mean ΔF/F versus linear track position. Bottom: overlay of cue template (C.T., in red) and shifted mean ΔF/F (M. ΔF/F, in gray) according to the lag.

A, B and O were modified from Low et al, 2014.

2

Figure S2. Properties of pyramidal and stellate cells in virtual navigation; assigning grid modules based on their 1D responses, related to Figures 2 and 3

A. Percentages of imaged cue cells that were classified as stellate (SteC) and pyramidal cells (PyrC). p=4.6×10−3.

B. Pairwise distances between cue cells versus those between cue and grid cells.

C. An example of the distribution of cue and grid cells among stellate and pyramidal cells. Scale bar: 50μm.

D. Amplitudes (left) and frequencies (right) of significant transients of stellate and pyramidal cells (517 stellate cells and 408 pyramidal cells in 18 FOVs of six mice). p =2.7×10−9 and 1.1×10−9 for amplitudes and frequencies, respectively.

E. Amplitudes (left) and frequencies (right) of significant transients of stellate grid cells (G-S) and pyramidal grid cells (G-P) (75 pyramidal grid cells and 219 stellate grid cells in 18 FOVs of six mice).

F. Example showing frequencies and amplitudes of significant transients of pyramidal cells within a patch. Top left: GCaMP6f+ pyramidal cells imaged in vivo. Top right: white dots: COMs of identified pyramidal cells from the left. Red square: center of the patch. Bottom: pyramidal cells color-coded by frequency (Freq., left) and amplitude (Amp., right) of significant transients. Scale bar: 50μm.

G. Relationship between frequencies (left) or amplitudes (right) of significant transients of pyramidal cells and their distances to patch centers. Dark gray dots: individual cells. Curves: frequencies (left) or amplitudes (right) for real (black) and shuffle data (light gray, 100 shuffles) at different distances from patch centers. Bin width: 15μm. Frequencies and amplitudes positively correlate with the distances (p=1.36×10−6 and 2.07×10−5, respectively).

H. Parasagittal slice of the MEC from an Emx1-IRES-Cre; CaMKIIa-tTA; Ai93 (Ai) mouse stained with Wfs1 antibody. The region between the two dashed yellow curves is layer 2, in which GCaMP6f was highly expressed in pyramidal cells (Wfs1+). Scale bar: 50μm.

I. Comparison of percentages of pyramidal cells (Pyr) in Ai mice, stellate (Ste) and pyramidal (Pyr) cells in GP 5.3 mice that expressed GCaMP6f.

J. Fluorescence intensity in cell bodies of pyramidal cells (Pyr) in Ai mice, stellate (Ste) and pyramidal (Pyr) cells in GP 5.3 mice that expressed GCaMP6f. The fluorescence intensity is represented as mean gray value, which was measured in vivo under two-photon microscope with comparable laser powers used in different mice.

K. In vivo two-photon image of GCaMP6f-labeled cell bodies in layer 2 of the MEC in Ai mouse. Scale bar: 50μm. Note that the labeled cell bodies cluster in a patch, consistent with the immunohistochemistry results that most labeled cells were pyramidal cells.

L. Spatial dependence of calcium transients of an imaged grid cell in an Ai mouse on a 1000 cm-VR track. Annotations are similar to Figure S1Q.

M. Percentage of grid cells in GCaMP6f+ pyramidal cells (Pyr) in Ai mice, GCaMP6f+ stellate (Ste) and pyramidal (Pyr) cells in GP 5.3 mice (2216 pyramidal cells in 37 FOVs of three Ai mice, 517 stellate and 408 pyramidal cells in 18 FOVs of six GP 5.3 mice).

N. Percentage of pyramidal grid cells at different distances from centers of pyramidal patches in Ai mice (1863 pyramidal cells in 37 FOVs of three mice). Curves: real data (magenta) and 100 shuffles (gray). Bin width: 15μm.

O. An example of a ground truth dataset, in which grid cells were recorded using tetrodes in both a 2D real and two 1D virtual environments. These grid cells were clustered into two modules based on their 2D scales.

P. Clustering of the four parameters (1D field widths and spacings on two VR tracks, as shown in Figure 3A) of the 1D response of all grid cells in O.

Q. Comparison of module assignment of cells in O using 1D and 2D responses. The accuracy is 100% for this dataset.

R-T. Module assignment for another ground truth dataset. Annotations are the same as in O-Q. Accuracy is 98% for this dataset.

U. Fitting quality of co-modular grid cells assigned based on their 1D calcium responses. Co-modular cells were simultaneously fit as parallel slices in the same triangular lattice. Each dot represents the percentile of the fitting score of cells in one module compared to those of 100 shuffled datasets. Red dashed line marks the 75th percentile of the shuffled fitting scores.

V. Ratios of 2D grid scales of successive modules, which were the 2D spacings of their fitted 2D triangular lattices. Each dot represents the spacing ratio of a pair of successive modules. Red dashed line marks the average ratio (1.51) of all pairs of modules. *p ≤0.05. **p ≤0.01. ***p ≤0.001. n.s. p > 0.5. Student’s t-test. Error bars: mean±SEM.

3

Figure S3. Methods for calculating phase distances; additional methods and results for local phase arrangement, related to Figure 4.

A. Calculation of phase distance of a pair of grid cells based on fitted slices of their 1D responses. (1) Starting points of fitted 1D slices of two co-modular grid cells (green square and circled magenta star) are shown in the same unit-rhombus (red). The four points of the rhombus are mathematically equal and also equal to other surrounding points of the lattice (gray dots). “s” is the spacing of the lattice. Coordinates of each dot are labeled next to it. Original phase distances of the two cells (Dorig) are marked with a black line. (2) To calculate the real phase distance of the two cells, the starting point of one cell (green square) was fixed while the other one was placed at the eight other mathematically equivalent locations (magenta stars without circles). Distances from the green square to all nine magenta stars were calculated (dashed black lines from the green square to magenta stars). (3) Real phase distance of the two cells (Dtransf) was determined as the distance of the green square to the nearest magenta star, as shown with a black line.

B. An example of a ground truth dataset, testing the accuracy of identifying grid phase distances based on slice fit of 1D grid responses. Four grid cells were simultaneously recorded with tetrodes in 2D real and 1D VR environments. Their 1D responses were fitted as parallel slices in the same triangular lattice. For each cell: left top: spikes (red dots) and trajectory (gray) in a 0.5×0.5m real 2D environment. Left middle: firing rate in the 2D environment, calculated based on the spikes on top. Left bottom: autocorrelogram of the firing rate in the middle. Right top: spikes (red dots) and trajectory (gray) on multiple traversals on the 1D VR track. Right bottom: overlay of real firing rate along the track calculated from the spikes on top (black) and simulated activity of fitted slice (gray).

C. 2D and 1D phase distances of the four grid cells in B. Each dot represents phase distance of one pair of grid cells. R2 reveals the linearity of the relationship of 1D and 2D phase distances. D. 2D and 1D phase distances of additional pairs of simultaneously recorded grid cells (25 pairs in three datasets like B). Each dot represents phase distance of one pair of grid cells. R2 reveals the linearity of the relationship of 1D and 2D phase distances.

E. Errors in calculating 2D pairwise phase distances using the 1D slice fit. Each dot represents the absolute difference (error) of the 1D and 2D phase distances of one pair of cells. The absolute error is 0.08±0.01.

F. Plotting the relative anatomical location of cell pairs with different phase distances shown in Figure 4C (phase plot). (1) One cell was set as the reference cell (Ref.) and the locations of all cells were shifted so that the reference cell was at (0,0). Each cell was colored according to its phase distance to the reference cell. Here we show examples for two different reference cells, but plots for all nine reference cells were similarly generated. (2) The nine plots described in (1) were overlaid, with colors from those plots (indicating phase distances between pairs of cells) all renormalized to the same color scale. (3) The points (cell pairs) with phase distances either greater than Tlarge (e.g., 80%) or less than Tsmall (e.g., 20%) were kept in the plot. (4) For better visualization, the points with large and small phase distances were plotted in red and black, respectively.

G. Relationship between phase and physical distances shown in a group of ten cells in module 2, which has the second smallest spacing in an animal. Top left: anatomical locations of the ten module 2 cells, color coded based on their phase distance to the reference cell (Ref.). Scale bar: 25μm. Other panels: phase distances of the reference cell (bottom left) and its close (cell1) and distal (cell2) cells. Distances were determined by fitting 1D calcium responses of all cells to parallel slices in the same triangular lattice. Annotations are similar to Figures 4C and 4D.

H. Pairwise phase distances versus physical distances for the ten cells in G. Bin width: 30μm.

I. Phase plot showing relative anatomical locations of cells in G with small (below 20th percentile) and large (above 80th percentile) phase distances to reference cells, the locations of which were set at (0,0). X and Y axes correspond to the X and Y axes in G.

J. Relationship of pairwise physical and phase distances of all module 2 cells (bin width: 30μm; 1536 cell pairs in 11 module 2 datasets of five mice). Blue rectangle indicates the portion of the plot corresponding to physical distances shorter than 120μm.

K. Relationship of pairwise physical distances and percentage of module 2 cell pairs with small (black: <20th percentile, left y-axis) and large phase distances (red: >80th percentile, right y-axis). Only cell pairs physically closer than 120μm are shown. Bin width: 15μm. 716 cell pairs with small or large phase distances (308 pairs for each distance group) in 11 module 2 datasets of five mice were used.

L-M. Calculation of folding score.

L. Triangulation of a cell group in brain space (brain triangles, left) and two sets of hypothetical phases for those cells, plotted in the unit-rhombus (phase triangles, middle and right). In the brain (left), the cell group includes a center cell (C.C.) and all cells within a distance r from the center cell. Throughout all six subpanels, the same colored dot represents the same cell. The phases in Phase 1 were chosen to match the cells’ arrangement in the brain, whereas those in Phase 2 do not, as can be visualized via the corresponding triangulations in the second row.

M. Calculation of folding score. Top: the folding score for the above cell group was calculated based on the phase triangles. It was the ratio of the area of the smallest polygon that contains all the triangles to the sum of the areas of all the individual triangles. Middle: the folding score is 1 for the first phase map (Phase 1), because the triangles do not overlap. Bottom: the folding score is less than 1 for the second phase map (Phase 2), because the triangles overlap.

p values in H and J were calculated as the percentage of shuffled data points that are below (when the mean of real data ≤ the mean of shuffled data) or above real data (when the mean of real data ≥ the mean of shuffled data). *p ≤0.05. **p ≤0.01. ***p ≤0.001. Error bars: mean±SEM.

4

Figure S4. Additional methods and results for global phase arrangement, related to Figure 5.

A. Transformation of a lattice to a regular triangular lattice and calculation of grid score. Left: the original autocorrelogram of the distribution of phase clusters, shown in Figure 5B. Step 1: identifying the six vertices nearest to the center of the autocorrelogram (red circles). Step 2: fitting the six vertices in step 1 to an ellipse (white ellipse). Step 3: reshaping the lattice to a regular hexagon based on the long and short axes of the ellipse in step 2. Step 4: calculating grid scores based on the transformed regular triangular lattice in step 3.

B-D. An example of phase clusters in module 2 cells, which had the second smallest spacing in an animal.

B. Anatomical locations of 18 grid cells in module 2 with different phases. Cells with similar phase (phase distances <15th percentile of all distances) are represented in the same color. Scale bar: 50μm.

C. Phase cluster distribution. Left: phase plot showing relative anatomical locations of cells with small phase distances (<15th percentile of all phase distances). Middle: same data on the left but spatially binned (in 20μm×20μm spatial bins). Right: autocorrelogram of the middle map and its grid score.

D. Phase plot and autocorrelogram of a shuffled dataset of C. Annotations are same as in C.

E. Two examples of multiple phase clusters in combined FOVs. For each example, left: anatomical distribution of cells in two sets of phase clusters (magenta and green). Scale bar: 50μm. Right: autocorrelogram of phase plots for cells on the left in the same set of phase clusters.

F. Comparison of grid scores of phase clusters in 29 sets of co-modular cells with those of shuffles. The red dashed line indicates 60th percentile of shuffles. Each dot represents one set of co-modular cells. Note that all the grid scores are above the 60th percentile of shuffles.

G-I. Shapes of phase cluster lattices.

G. Plotting the two shortest vectors of the phase cluster autocorrelogram. Left: original autocorrelogram of phase clusters. Middle: the vectors v1 and v2 point to the two autocorrelogram vertices (p1 and p2) nearest to the origin (excluding reflections), with ∣v1∣ < ∣v2∣. Right: v1 and v2 were transformed so that v1 was sent to (1, 0), and then v2 was reflected and translated by v1 until its y coordinate was positive and its x coordinate was between 0 and 0.5. Black: the vectors v1 and v2 after the transformation. Gray: transformed v1 and v2 for a regular triangular lattice.

H. Diagram for interpreting the shape of the phase cluster lattice from the vector plot shown in M. The v2 vectors were expected to be placed in the green zone. Gray: v1 and v2 of a regular triangular lattice. Magenta: an example of v2 of a non-regular triangular lattice. The ideal triangular lattice (black) and the lattice shape according to the magenta v2 (dotted) were plotted. Note that the dotted lattice is skewed compared to the regular triangular lattice.

I. The vectors v2, after transformation shown in M, for all 29 individual co-modular cell sets (shown in F), giving a quantification of the lattice shapes across the cells. As explained in H, all 29 lattices were skewed compared to the regular triangular lattice.

J. The relationship of physical spacings of phase clusters and spacings of grid modules determined from their spatial tuning responses. Each dot represents one module (n=29). Red dashed line is the best fit line to the data. p value of the correlation between the two sets of spacings is 3.4 × 10−5.

K. Four examples of the relative distribution of phase clusters and pyramidal clusters. Grid cells (colored dots) with similar phases are represented with the same color. Pyramidal cells are represented as white circles. Scale bar: 100μm.

L. Comparison of spacings of phase clusters and pyramidal clusters. p=9.8×10−14, Kolmogorov-Smirnov test.

M-P. Global lattice fit.

M. Cell locations in brain space and corresponding phases in the unit-rhombus.

N. Generation of candidate anatomical lattice vectors based on the autocorrelogram of phase clusters. (1) Left: autocorrelogram of phase clusters in M with six vertices nearest to the origin (red circles, three pairs of vertices are symmetric) identified. Right: Reflected vertices were excluded, producing the three vertices (p1, p2, p3) (in what follows, we define each vertex with its corresponding 2D vector, pointing to that vertex from the autocorrelogram center). (2) For each choice of two vectors from the three vectors in (1), for example p1 and p2, the two shortest vectors p~1 and p~2 generated by p1 and p2, were constructed, and we then constructed the eight shortest vectors generated by p~1 and p~2. This produced the 8 shortest vectors in the lattice L(p1, p2). (3) As candidate fit vectors for the next step, we took all pairs v1, v2 of the eight shortest vectors generated above. Here we show 4 examples of 40 total choices. Each pair of these 40 pair choices will serve as generating vectors of an anatomical lattice, as described in O below.

O. Calculation of fit score. (1) Cell locations were first mapped in an anatomical lattice by sending the vectors v1, v2bto the generating vectors in the parallelogram, as indicated, and then applying a possible shift of the parallelogram in the FOV (shift = 0 in this example). An anatomical lattice was then generated under this pair of vectors and the shift by repeating the parallelogram across the FOV (gray lattice). (2) The cell location in the parallelogram was proportionally converted to a location in a unit-rhombus. We then refer to the cell locations in the unit-rhombus under this mapping as the “anatomical phases” (green circle for cell 1), and the true phase of cells as “spatial tuning phases” (magenta cross for cell 1). (3) The fit score of the mapping was then defined to be the average over all cells of the necessary migration distance (magenta dashed line) to reach the perfect match between anatomical phases and the spatial tuning phases. We similarly generated many lattices under all pairs of vectors (described in N) and different shifts, and identified the best fit lattice, which has the lowest fit score (minimal migration distances to reach the perfect match between the anatomical and spatial tuning phases)

P. Generation of “locality preserving” shuffles. (1) Shuffles were generated by clustering phases into five clusters in the unit-rhombus and permuting the phase clusters via translation. (2) After the shuffling, while the cells stayed in their original anatomical locations, the phases of cells were changed together and therefore the autocorrelogram of the shuffled phase clusters remained similar to the true autocorrelogram of phase clusters.

***p ⩽0.001.

5

Figure S5. Noise of the anatomical phase map, related to Figure 5.

The purpose of this figure is to identify the noise of the anatomical phase map of the brain, which is defined as the level of inconsistency between the anatomical and spatial tuning phases. We modeled anatomical phase map with different levels of noise to match the current data. To simplify the illustration, we represent the anatomical phases of all cells in the same anatomical phase unit-rhombus, although the actual cells in the brain were distributed in multiple unit-parallelograms of an anatomical lattice. This representation allows us to more densely sample the unit-rhombus and reveals the overall distribution of spatial tuning phases in the brain across the anatomical lattice.

A. Modeling of anatomical phase maps with noise. (1) To represent different spatial tuning phases, the spatial tuning phase unit-rhombus was divided into nine color zones. The anatomical phase unit-rhombus was divided accordingly. (2) In the anatomical phase unit-rhombus, the location of each dot represents the anatomical phase of one cell, which is colored according to its spatial tuning phase. In the perfect case, anatomical and spatial tuning phases were perfectly consistent. In the noisy case, they were inconsistent and the difference between the anatomical phase and spatial tuning phase was termed “noise” of a grid cell. (3) When more cells were included, the color patterns in the spatial tuning and anatomical phase rhombuses were identical for the perfect case, but different for the noisy case. (4) The global lattice fit analysis generated a new anatomical lattice (gray), in which the cells could migrate at the shortest distance (on average) to reach the best match between their anatomical and spatial tuning phases. Therefore, in principle zero migration was required for the perfect case. In the real analysis, due to the limited sampling of the anatomical lattice (limited choices of lattice sizes and offsets in the brain, etc.), small migrations were still necessary. However, the fit score for the perfect case, which was equal to the average migration distance of all cells in the fitted lattice, was very low. In contrast, in the noisy case, larger migrations were necessary even in the new anatomical lattice, so the fit score was much higher compared to the perfect case. The fit score increased with the increase in noise level. Note that the fit score was the minimal cell migration required in the new optimized anatomical lattice. Therefore, the fit score was equal to the new noise in the new anatomical lattice. This new noise was generally lower than the noise of the data in the original anatomical lattice (the anatomical lattice in (2)). In the rest of this figure, we termed the original noise before the lattice fit as the “noise” of the phase map. Also note that in Figure 5M, the observed “noise” is the new noise in the new fitted lattice.

B. An example of identifying the noise level of the anatomical phase map of a set of co-modular cells based on its fit score of the global lattice fit analysis. The x axis indicates different levels of noise (original mean noise level of all cells before the global lattice fit) introduced to spatial tuning phases that perfectly match anatomical phases, as explained in A. The y axis indicates the fit scores (new noises after the global lattice fit) of the co-modular cell sets with different noise levels in the global lattice fit analysis. The corresponding noise level with the fit score of real data is the estimated original noise level of the data (red dot on the x axis).

C. Noise levels of anatomical phase maps of all 29 sets of co-modular cells. The dashed line indicates the mean noise level (0.22).

D. Comparison of the mean noise level of real data (0.22, black line) to that of 50 randomized datasets (gray histogram). Each randomized dataset was developed from the original 29 sets of co-modular cells by maintaining the anatomical locations of cells and assigning random phases to the cells (29 randomized sets). The global lattice fit analysis was then performed on the 29 randomized cell sets to estimate their noise levels, which were further averaged as the mean noise level of the randomized dataset. The histogram represents the distribution of mean noise levels of the 50 randomized datasets. Note that the real data had lower mean noise level than all randomized datasets, suggesting that the anatomical arrangement of grid phases in real data are not random. This arrangement is closer to a triangular lattice pattern than any random arrangement.

E. 2D and 1D color schemes to represent spatial tuning phases, as in Figure 5M. Spatial tuning phases can be represented in 2D by dividing the unit-rhombus into nine color zones (as in A), and in 1D by color gradients along the two axes (r1 and r2) of the unit-rhombus.

F. Distribution of spatial tuning phases in the anatomical phase unit-rhombus of real data after the global lattice fit analysis (same as in Figure 5M, n=744 from 29 sets of co-modular cells). r1, r2: the distribution of spatial tuning phases represented by the 1D color scheme along axes r1 or r2 of the unit-rhombus, as explained in E. Note that the color patterns in the two unit-rhombuses largely follow the 1D color schemes in E, indicating that grid phases form a phase lattice map in the brain. However, this map is noisy. Note that the noise observed here is the new reduced noise in the fitted lattice. In G, we provided modeled phase maps to reveal the original noise (for example, 0.22 on average, as shown in C) of the phase map before the global lattice fit.

G. The modeled anatomical phase map under the noise level of the data. The cells from all 29 sets of co-modular cells were used (n=744) to generate these modeled data. Four noise levels were modeled: (1) zero noise; (2) maximal noise (random); (3) mean noise of the data (0.22, as indicated in C); (4) each FOV with its own noise (as plotted in C). For each noise level: “Original”: for each FOV, the anatomical phases of cells were their locations in the unit-rhombus of a regular triangular lattice randomly constructed in the brain. The perfect spatial tuning phases were set to be identical to the anatomical phases. Different levels of noise were introduced to the perfect spatial tuning phases. The distribution of the noise-introduced spatial tuning phases in the anatomical phase unit-rhombus of all 29 cell sets was represented by 2D coloring (as in E), 2D tiling (2×2 tiling the anatomical unit-rhombus to better reveal the 2D color pattern of a single unit-rhombus) and 1D coloring (as in E). “Fit”: the global lattice fitting analysis was performed on cells in each FOV, which contained the modeled anatomical and spatial tuning phases with different levels of noise introduced. The optimized anatomical phases were plotted in the unit-rhombus and colored according to the spatial tuning phases (1D coloring, as in E). Note: the phase lattice maps with different noise levels were represented by the “Original” plots. While the “Original” zero-noise lattice maps show perfectly matched color patterns to those in E, and the maximal-noise lattice (random) maps show random color-patterns, the “Original” maps with mean data noise (0.22) and matched noise to each FOV show comparable color patterns. The color patterns of their “Fit” anatomical phase unit-rhombuses are similar to those of real data (as shown in F). Thus the “Original” maps with mean data noise and matched noise to each FOV represent the anatomical phase map with the noise obtained from the current data.

H. Modeled anatomical phase map without the noise introduced by 1D slice fit. The noise of the current phase lattice map has at least two sources: (a) the noise generated from the estimation of phase relationship of a pair of cells based on their 1D responses (1D noise); (b) the noise generated from the migration of cells in the brain tissue (brain noise). To reveal the phase lattice map with only the brain noise (b), we modeled the phase lattice maps by subtracting the 1D noise, which was 0.08 (Figure S3E). The two noise levels, (1) mean data noise subtracted by the 1D noise and (2) matched noise of each FOV subtracted by the 1D noise, were modeled. Note: these phase lattice maps of these two noise levels are similar and represent the phase lattice map with the noise in the brain.

I. Scale of noise level representing the noise of the phase map in mouse MEC (noise level 0.14) compared to the perfect hexagonal phase lattice (noise level 0) and purely random phase arrangement (noise level 0.34). Assuming the change of noise level is linear, the phase map in mouse MEC is closer to the perfect hexagonal phase lattice than to the purely random phase arrangement.

6

Figure S6. Global lattice fit and anatomical phase map of individual mice; co-active cells form a lattice similar to that formed by phase clusters, related to Figures 5 and 6

A. Global lattice fit results, anatomical phase maps, and noise levels of the anatomical phase map are shown for individual mice. From left to right: results of mice 1 to 6. For each mouse, from top to bottom: global lattice fit result as in Figure 5K, anatomical phase maps as in Figure 5M, noise level of the anatomical phase map as modeled in Figure S5. Note that in the global lattice analysis, four mice (1, 3, 5 and 6) showed significantly lower fit scores (shorter anatomical migration distances to reach a perfect phase lattice) compared to shuffles. The other two mice (2 and 4) showed very low p values. Exact p values (Kolmogorov-Smirnov test): mouse 1: 0.030; mouse 2: 0.071; mouse 3: 0.043; mouse 4: 0.053; mouse 5: 0.049; mouse 6: 0.041. For the anatomical phase map, all cells in the same mouse are plotted in the same unit-rhombus. Cell number in each mouse: mouse 1: 236 (10 FOVs); mouse 2: 109 (4 FOVs); mouse 3: 75 (3 FOVs); mouse 4; 58 (3 FOVs); mouse 5: 183 (6 FOVs); mouse 6: 83 (3 FOVs). The noise level of a mouse is the mean noise level of all FOVs of the same mouse.

B-D. Example group of co-modular cells showing correlation of lattices of co-active cells and phase clusters, represented by their autocorrelograms.

B. Autocorrelogram of co-active cells. Left: calcium responses of seven cells co-active within the spatial bin n in a 1000cm-long VR track, which was split into 80 bins under 12.5cm bin width. Significant spatial fields are highlighted in pink and the peak mean ΔF/F of each field is indicated by a green dot. These peak locations represent field locations. Note that all the seven cells showed fields within the range of bin n (dotted rectangular area), so they were determined as co-active cells. Top right: an image frame n was generated based on the activity in the spatial bin n. In this frame n, the areas of co-active cells were assigned to 1 and the remaining pixels were 0. An autocorrelation was then performed on the frame (step 1). The same procedure was repeated for all 80 frames (for 80 spatial bins) along the track and averaged to get a mean autocorrelogram (step 2; the autocorrelogram was smoothed with a two-dimensional Gaussian smoothing kernel with standard deviation of 10 for better visualization, same for all activity autocorrelograms in the figure). Bottom right: the calcium responses were shuffled among all cells in the group and the mean autocorrelogram of co-active cells in the shuffle dataset was similarly generated. Scale bars: 100μm.

C. Comparison of the autocorrelograms of co-active cells and phase clusters of cells in B. In the overlay figures, the autocorrelograms of co-active cells and phase clusters are shown in magenta and green, respectively. The overlaid areas of the two autocorrelelograms show white color. Scale bar: 100μm.

D. Comparison of the autocorrelograms of co-active cells and phase clusters of the shuffled dataset for cells in B.

E. Comparison of correlation coefficients between the autocorrelograms of co-active cells and phase clusters for real data in B and its shuffles, in which the calcium responses were randomly permuted among the cells (50 shuffles). The real correlation coefficient was higher than 98% of shuffled coefficients.

F. Comparisons of the autocorrelograms of co-active cells and phase clusters of three more groups of co-modular cells ((1)-(3)). Scale bars: 100μm.

G. Comparison of correlation coefficients of the autocorrelograms of co-active cells and phase clusters of cells in 16 groups of co-modular cells and their shuffles (50 shuffles for each group). The correlation coefficients were normalized so that the shuffled coefficients in each group had mean 0 and standard deviation 1. The probabilities were normalized so that the maximal probabilities of real and shuffled data were 1. p =2.4×10−11.

* p≤0.05. *** p≤0.001. Kolmogorov-Smirnov test.

7

Figure S7. Method for calculating missed-field patterns; possible mechanisms for generating grid cells in stellate cells in layer 2 of the MEC, related to Figure 7

A-B. Calculation of missed-field patterns.

A. An example of spatially-modulated calcium activity of one grid cell. Top: significant transients versus linear track position for a set of sequential runs. Each red dot represents the location of the highest peak of one significant transient. The red dots are plotted over a gray line representing the y position in each run. Middle: mean ΔF/F versus linear track position. Bottom: 1-pvalue function (1-p, dark blue) versus track position. In- and out-field periods are indicated in red and gray, respectively. Six spatial fields were identified for this cell.

B. Calculation of the missed-field pattern of the cell in A. Top left: run-by-run significant transients of the six spatial fields in A. For each field, a single red dot represents the location of the highest peak of one significant transient. The gray lines represent the y position through that field for each run. Bottom left: missed-field pattern for each field, indicating for each run whether that field contained a significant transient (show-field, white) or not (missed-field, black). Right: the missed-field patterns were converted to binary vectors (show-field =1, missed-field =0) and then averaged across all fields to obtain the missed-field pattern for the cell, which was a vector with one entry between 0 and 1 for every run. This missed-field pattern was then used to calculate the correlations between different cells.

C-E. Possible mechanisms for generating grid cells in stellate cells.

C. Two-dimensional model for path integration. Top: in the presence of surround inhibition (not shown), a focused activity bump is formed within a layer of neurons, which are recurrently connected (connections are indicated by red arrows). Bottom: during locomotion, the bump can be made to move by intermediate layers of cells that perform path integration. These cells are conjunctive for position and head-direction of the animal and positively modulated by speed. They receive position information from the bump of activity in the top cell layer, and generate information about the displacement vector (with both direction and speed information) for the future displacement of the bump. Note that there are multiple layers of cells encoding different head directions (five layers are shown, indicated by arrows), which can be mixed together in fewer real cortical layers. Modified from McNaughton et al 2006.

D. Different connectivity patterns for layer 2 stellate and pyramidal cells within the MEC. Functional cell types in each layer are indicated.

E. Two possible models for generating grid cells in stellate cells in layer 2 of the MEC. Each gray dot represents a single stellate cell in layer 2 or a single pyramidal cell in deep layers of the MEC. Gray dots with magenta or blue rings are active cells at a particular location of the environment during animal’s locomotion. Left: grid cells are locally generated within stellate cells in layer 2, which are recurrently connected (red arrows). During locomotion, activity bumps are made to move via the communication between layer 2 grid cells and cells in deep layers of the MEC (green and blue arrows), which contain grid-head direction conjunctive cells to perform path integration. Right: grid cells in layer 2 are inherited from the grid-like activity in deep layers of the MEC via feedforward excitation from deep layers to stellate cells (blue arrows).

Our current results suggest that majority of grid cells in layer 2 are stellate cells. Although substantial additional research is needed to elucidate which brain area(s), layer(s), cell type(s) primarily contribute to the grid cell population and grid formation, converging lines of evidence point to the idea that layer 2 stellate cells may play a role because of their special connectivity:

(1) Inhomogeneity of layer 2 of the MEC Compared to visual cortex and hippocampus, which exclusively consist of pyramidal neurons, layer 2 of the MEC contains two different excitatory cell types: stellate cells and pyramidal cells. These cells differ not only in their morphologies and molecular profiles, but also distinct anatomical distributions: pyramidal cells cluster into multiple hexagonally-arranged patches, while stellate cells fill the inter-patch spaces (Kitamura et al., 2014; Ray et al., 2014). Based on current literature, grid-like responses do not seem to rely on stellate cell type per se, because grid cells have also been found in deeper layers of the MEC, as well as pre- and parasubiculum, which do not contain stellate cells (Boccara et al., 2010; Sargolini et al., 2006). Instead, we propose that the separate anatomical clustering of stellate and pyramidal neurons provides the anatomical basis for different connectivity patterns, which could then lead to different fractions of grid cells in the two populations.

(2) The connectivity pattern of stellate cells is favorable for the formation of grid cells (illustrated in D) Although it is still unclear how grid cell activity emerges, models propose that it can arise through local lateral (recurrent) connections between grid cells (Burak and Fiete, 2009; Fuhs and Touretzky, 2006; McNaughton et al., 2006) which also communicate with grid-head direction conjunctive cells from different layers to perform path-integration of velocity signals as the animal moves (C). In particular, if the lateral connectivity is topographically local and Mexican-hat shaped, with strong inhibitory surrounds, then it is predicted that the neural sheet should exhibit multiple activity bumps themselves arranged in a triangular lattice pattern. Clusters of local cells should then have similar phase, with phase similarity within one locally-connected region decreasing with distance, and multiple, periodically arranged groups of cells with the same phase, similar to the patterns observed in the current study. Moreover, a model by Widloski and Fiete (Widloski and Fiete, 2014) shows that direct recurrent excitation between principal cells is important for obtaining grid-like patterning among excitatory cells while avoiding similar patterning in inhibitory cells (even though recurrent inhibition is predicted to be essential for grid patterning). Based on the above models, grid cells in layer 2 of the MEC should fulfill some of the three criteria: a) interact through a strong lateral inhibitory input, b) receive direct recurrent excitation, c) communicate with grid-head direction conjunctive cells to receive velocity signals and drive path-integration based updates of the location code in grid cells. Based on current experimental findings summarized below, stellate cells better meet these criteria and are thus better-placed to be grid cells than are pyramidal cells:

(a) Lateral inhibition:

Fast-spiking pavalbumin (PV)+ interneurons have been shown to be necessary for the maintenance of grid activity (Miao et al., 2017) and also inhibit stellate cells (Beed et al., 2013; Couey et al., 2013; Fuchs et al., 2016). A recent study particularly supported more extensive inhibition from PV+ interneurons onto stellate cells than pyramidal cells (Fuchs et al., 2016).

(b) Lateral excitatory connectivity: Recent reconstructions of local synaptic organization in the MEC show that both pyramidal and stellate cells can connect to other excitatory cells (Schmidt et al., 2017). However, within layer 2, stellate cells generally receives stronger excitatory inputs than pyramidal cells, such as the feedforward excitation from pyramidal to stellate cells (Fuchs et al., 2016; Winterer et al., 2017) and recurrent excitations between stellate cells (Winterer et al., 2017).

(c) Communication with conjunctive grid-head direction cells Unlike pyramidal cells, stellate cells appear to be more interconnected with deeper layers of the MEC, which contain head direction and grid-head direction conjunctive cells (Sargolini et al., 2006). Axons of stellate cells not only ramify greatly in layer 2, but also in deep layers of the MEC (Klink and Alonso, 1997; Tamamaki and Nojyo, 1993). Axon terminals of stellate cells, but not pyramidal cells, are enriched in layer 5 (Surmeli et al., 2015). It was also shown that dendritic bundles of layer 3 pyramidal cells only overlap with stellate area and avoid pyramidal patches (Tang et al., 2015), increasing the probability for layer 3 neurons to receive inputs from layer 2 stellate cells. On the other hand, layer 3 pyramidal neurons send strong feedforward excitation to stellate cells, but not to pyramidal cells (Winterer et al., 2017).

The following two versions of continuous attractor models (Burak and Fiete, 2009; Widloski and Fiete, 2014) therefore may explain grid cell activity generation in stellate rather than pyramidal cells, if we consider the findings from the literature described above:

(a) Grid cell activity patterning is locally generated among layer 2 stellate cells (E, left panel), and updated in accordance with animal movements based on interactions with the deeper layers: The grid-like activity bumps can be formed in recurrently connected stellate cells, in which the strength of connections between a pair of cells decays with the increase of their physical distance, with an effective net Mexican-hat interaction profile obtained by combining lateral excitation and inhibition. When the animal moves, the activity bump in layer 2 shifts through interactions with conjunctive grid-head direction cells, which are located in deep layers of the MEC: these cells receive position information from layer 2 grid cells, then shift the layer 2 state based on their velocity inputs.

(b) Grid cell activity in stellate cells in layer 2 is inherited from deeper layers of the MEC (E, right panel) Assuming that the recurrent connections between stellate cells are not enough, or other mechanisms are required for generating grid cells, grid cell activity can be possibility generated in deeper layers (e.g. layers 3 or 5) of the MEC. Stellate cells in layer 2 can then directly acquire the grid-like activity by receiving feedforward excitatory inputs from the deep layers.

KEY RESOURCES TABLE

REAGENT or RESOURCE SOURCE IDENTIFIER
Antibodies
Mouse monoclonal anti-Reelin (CR-50) MBL Life science Cat#D223-3; RRID: AB_843523
Rabbit polyclonal anti-WFS1 Proteintech Group Cat#11558-1-AP; RRID: AB_2216046
Mouse monoclonal anti-GAD67 (1G10.2) Millipore Cat# MAB5406; RRID: AB_2278725
Experimental Models: Organisms/Strains
Mouse: Thy1-GCaMP6f transgenic line GP5.3 (Dana et al., 2014) N/A
Mouse: Emx1-IRES-Cre; CaMKIIa-tTA; Ai93 (Madisen et al., 2015) N/A
Mouse: wild type C57BL/6J mice The Jackson Laboratory Stock No: 000664 ∣ Black 6
Software and Algorithms
MATLAB MathWorks http://www.mathworks.com
ImageJ National Institutes of Health https://imagej.nih.gov/ij/
ScanImage 5 Vidrio Technologies http://scanimage.vidriotechnologies.com/display/SI5/ScanImage+5
ViRMEn (Virtual Reality Mouse Engine) (Aronov and Tank, 2014) https://pni.princeton.edu/pni-software-tools/virmen-virtual-reality-matlab-engine
Motion correction (CaImAn) (Giovannucci, 2017) https://github.com/flatironinstitute/CaImAn

Acknowledgments:

We thank Yao Lu, Alex Riordan, Dr. Rong Gong, and Dr. Ben Scott for comments on the manuscript, and Dr. Gary. Laevsky for help with confocal microscopy. This work was supported by 5R37NS081242-02 and the Simons Foundation SCGB.

Footnotes

Declaration of Interests:

The authors declare no competing interests.

References:

  1. Aronov D, and Tank DW (2014). Engagement of neural circuits underlying 2D spatial navigation in a rodent virtual reality system. Neuron 84, 442–456. [DOI] [PMC free article] [PubMed] [Google Scholar]
  2. Beed P, Gundlfinger A, Schneiderbauer S, Song J, Bohm C, Burgalossi A, Brecht M, Vida I, and Schmitz D (2013). Inhibitory gradient along the dorsoventral axis in the medial entorhinal cortex. Neuron 79, 1197–1207. [DOI] [PubMed] [Google Scholar]
  3. Berens P (2009). CircStat: A MATLAB Toolbox for Circular Statistics. Journal of Statistical Software 31. [Google Scholar]
  4. Boccara CN, Sargolini F, Thoresen VH, Solstad T, Witter MP, Moser EI, and Moser MB (2010). Grid cells in pre- and parasubiculum. Nature neuroscience 13, 987–994. [DOI] [PubMed] [Google Scholar]
  5. Burak Y, and Fiete IR (2009). Accurate path integration in continuous attractor network models of grid cells. PLoS computational biology 5, e1000291. [DOI] [PMC free article] [PubMed] [Google Scholar]
  6. Chin J, Massaro CM, Palop JJ, Thwin MT, Yu GQ, Bien-Ly N, Bender A, and Mucke L (2007). Reelin depletion in the entorhinal cortex of human amyloid precursor protein transgenic mice and humans with Alzheimer’s disease. The Journal of neuroscience : the official journal of the Society for Neuroscience 27, 2727–2733. [DOI] [PMC free article] [PubMed] [Google Scholar]
  7. Couey JJ, Witoelar A, Zhang SJ, Zheng K, Ye J, Dunn B, Czajkowski R, Moser MB, Moser EI, Roudi Y, et al. (2013). Recurrent inhibitory circuitry as a mechanism for grid formation. Nature neuroscience 16, 318–324. [DOI] [PubMed] [Google Scholar]
  8. Dana H, Chen TW, Hu A, Shields BC, Guo C, Looger LL, Kim DS, and Svoboda K (2014). Thy1-GCaMP6 transgenic mice for neuronal population imaging in vivo. PloS one 9, e108697. [DOI] [PMC free article] [PubMed] [Google Scholar]
  9. Diehl GW, Hon OJ, Leutgeb S, and Leutgeb JK (2017). Grid and Nongrid Cells in Medial Entorhinal Cortex Represent Spatial Location and Environmental Features with Complementary Coding Schemes. Neuron 94, 83–92 e86. [DOI] [PMC free article] [PubMed] [Google Scholar]
  10. Dombeck DA, Harvey CD, Tian L, Looger LL, and Tank DW (2010). Functional imaging of hippocampal place cells at cellular resolution during virtual navigation. Nature neuroscience 13, 1433–1440. [DOI] [PMC free article] [PubMed] [Google Scholar]
  11. Domnisoru C, Kinkhabwala AA, and Tank DW (2013). Membrane potential dynamics of grid cells. Nature 495, 199–204. [DOI] [PMC free article] [PubMed] [Google Scholar]
  12. Fuchs EC, Neitz A, Pinna R, Melzer S, Caputi A, and Monyer H (2016). Local and Distant Input Controlling Excitation in Layer II of the Medial Entorhinal Cortex. Neuron 89, 194–208. [DOI] [PMC free article] [PubMed] [Google Scholar]
  13. Fuhs MC, and Touretzky DS (2006). A spin glass model of path integration in rat medial entorhinal cortex. The Journal of neuroscience : the official journal of the Society for Neuroscience 26, 4266–4276. [DOI] [PMC free article] [PubMed] [Google Scholar]
  14. Giovannucci A, Friedrich J, Deverett B, Staneva V, Chklovskii D, Pnevmatikakis E (2017). CaImAn: An open source toolbox for large scale calcium imaging data analysis on standalone machines In Computational and Systems Neuroscience (Salt Lake City: ). [Google Scholar]
  15. Guanella A, Kiper D, and Verschure P (2007). A model of grid cells based on a twisted torus topology. International journal of neural systems 17, 231–240. [DOI] [PubMed] [Google Scholar]
  16. Hafting T, Fyhn M, Molden S, Moser MB, and Moser EI (2005). Microstructure of a spatial map in the entorhinal cortex. Nature 436, 801–806. [DOI] [PubMed] [Google Scholar]
  17. Harvey CD, Coen P, and Tank DW (2012). Choice-specific sequences in parietal cortex during a virtual-navigation decision task. Nature 484, 62–68. [DOI] [PMC free article] [PubMed] [Google Scholar]
  18. Heys JG, Rangarajan KV, and Dombeck DA (2014). The functional micro-organization of grid cells revealed by cellular-resolution imaging. Neuron 84, 1079–1090. [DOI] [PMC free article] [PubMed] [Google Scholar]
  19. Kaas JH, Nelson RJ, Sur M, Lin CS, and Merzenich MM (1979). Multiple representations of the body within the primary somatosensory cortex of primates. Science 204, 521–523. [DOI] [PubMed] [Google Scholar]
  20. Kinkhabwala AA, Aronov D, Tank DW (2015). Visual cue-related activity of MEC cells during navigation in virtual reality In Society for Neuroscience (Chicago: ). [DOI] [PMC free article] [PubMed] [Google Scholar]
  21. Kitamura T, Pignatelli M, Suh J, Kohara K, Yoshiki A, Abe K, and Tonegawa S (2014). Island cells control temporal association memory. Science 343, 896–901. [DOI] [PMC free article] [PubMed] [Google Scholar]
  22. Kitamura T, Sun C, Martin J, Kitch LJ, Schnitzer MJ, and Tonegawa S (2015). Entorhinal Cortical Ocean Cells Encode Specific Contexts and Drive Context-Specific Fear Memory. Neuron 87, 1317–1331. [DOI] [PMC free article] [PubMed] [Google Scholar]
  23. Klink R, and Alonso A (1997). Morphological characteristics of layer II projection neurons in the rat medial entorhinal cortex. Hippocampus 7, 571–583. [DOI] [PubMed] [Google Scholar]
  24. Larson B, Abeytunge S, and Rajadhyaksha M (2011). Performance of full-pupil line-scanning reflectance confocal microscopy in human skin and oral mucosa in vivo. Biomed Opt Express 2, 2055–2067. [DOI] [PMC free article] [PubMed] [Google Scholar]
  25. Low RJ, Gu Y, and Tank DW (2014). Cellular resolution optical access to brain regions in fissures: imaging medial prefrontal cortex and grid cells in entorhinal cortex. Proceedings of the National Academy of Sciences of the United States of America 111, 18739–18744. [DOI] [PMC free article] [PubMed] [Google Scholar]
  26. Madisen L, Garner AR, Shimaoka D, Chuong AS, Klapoetke NC, Li L, van der Bourg A, Niino Y, Egolf L, Monetti C, et al. (2015). Transgenic mice for intersectional targeting of neural sensors and effectors with high specificity and performance. Neuron 85, 942–958. [DOI] [PMC free article] [PubMed] [Google Scholar]
  27. McNaughton BL, Battaglia FP, Jensen O, Moser EI, and Moser MB (2006). Path integration and the neural basis of the ‘cognitive map’. Nature reviews Neuroscience 7, 663–678. [DOI] [PubMed] [Google Scholar]
  28. Miao C, Cao Q, Moser MB, and Moser EI (2017). Parvalbumin and Somatostatin Interneurons Control Different Space-Coding Networks in the Medial Entorhinal Cortex. Cell 171, 507–521 e517. [DOI] [PMC free article] [PubMed] [Google Scholar]
  29. Mukamel EA, Nimmerjahn A, and Schnitzer MJ (2009). Automated analysis of cellular signals from large-scale calcium imaging data. Neuron 63, 747–760. [DOI] [PMC free article] [PubMed] [Google Scholar]
  30. Naumann RK, Ray S, Prokop S, Las L, Heppner FL, and Brecht M (2016). Conserved size and periodicity of pyramidal patches in layer 2 of medial/caudal entorhinal cortex. J Comp Neurol 524, 783–806. [DOI] [PMC free article] [PubMed] [Google Scholar]
  31. Pastoll H, Solanka L, van Rossum MC, and Nolan MF (2013). Feedback inhibition enables theta-nested gamma oscillations and grid firing fields. Neuron 77, 141–154. [DOI] [PubMed] [Google Scholar]
  32. Pologruto TA, Sabatini BL, and Svoboda K (2003). ScanImage: flexible software for operating laser scanning microscopes. Biomedical engineering online 2, 13. [DOI] [PMC free article] [PubMed] [Google Scholar]
  33. Purves D, Augustine GJ, Fitzpatrick D, Katz LC, LaMantia A, McNamara JO, and Williams SM (2001). Neuroscience, second edn (Sinauer Associates; ). [Google Scholar]
  34. Ray S, Naumann R, Burgalossi A, Tang Q, Schmidt H, and Brecht M (2014). Grid-layout and theta-modulation of layer 2 pyramidal neurons in medial entorhinal cortex. Science 343, 891–896. [DOI] [PubMed] [Google Scholar]
  35. Sargolini F, Fyhn M, Hafting T, McNaughton BL, Witter MP, Moser MB, and Moser EI (2006). Conjunctive representation of position, direction, and velocity in entorhinal cortex. Science 312, 758–762. [DOI] [PubMed] [Google Scholar]
  36. Schmidt H, Gour A, Straehle J, Boergens KM, Brecht M, and Helmstaedter M (2017). Axonal synapse sorting in medial entorhinal cortex. Nature 549, 469–475. [DOI] [PubMed] [Google Scholar]
  37. Schneider CA, Rasband WS, and Eliceiri KW (2012). NIH Image to ImageJ: 25 years of image analysis. Nature methods 9, 671–675. [DOI] [PMC free article] [PubMed] [Google Scholar]
  38. Seelig JD, and Jayaraman V (2015). Neural dynamics for landmark orientation and angular path integration. Nature 521, 186–191. [DOI] [PMC free article] [PubMed] [Google Scholar]
  39. Stensola H, Stensola T, Solstad T, Froland K, Moser MB, and Moser EI (2012). The entorhinal grid map is discretized. Nature 492, 72–78. [DOI] [PubMed] [Google Scholar]
  40. Sun C, Kitamura T, Yamamoto J, Martin J, Pignatelli M, Kitch LJ, Schnitzer MJ, and Tonegawa S (2015). Distinct speed dependence of entorhinal island and ocean cells, including respective grid cells. Proceedings of the National Academy of Sciences of the United States of America 112, 9466–9471. [DOI] [PMC free article] [PubMed] [Google Scholar]
  41. Surmeli G, Marcu DC, McClure C, Garden DLF, Pastoll H, and Nolan MF (2015). Molecularly Defined Circuitry Reveals Input-Output Segregation in Deep Layers of the Medial Entorhinal Cortex. Neuron 88, 1040–1053. [DOI] [PMC free article] [PubMed] [Google Scholar]
  42. Tamamaki N, and Nojyo Y (1993). Projection of the entorhinal layer II neurons in the rat as revealed by intracellular pressure-injection of neurobiotin. Hippocampus 3, 471–480. [DOI] [PubMed] [Google Scholar]
  43. Tang Q, Burgalossi A, Ebbesen CL, Ray S, Naumann R, Schmidt H, Spicher D, and Brecht M (2014). Pyramidal and stellate cell specificity of grid and border representations in layer 2 of medial entorhinal cortex. Neuron 84, 1191–1197. [DOI] [PMC free article] [PubMed] [Google Scholar]
  44. Tang Q, Ebbesen CL, Sanguinetti-Scheck JI, Preston-Ferrer P, Gundlfinger A, Winterer J, Beed P, Ray S, Naumann R, Schmitz D, et al. (2015). Anatomical Organization and Spatiotemporal Firing Patterns of Layer 3 Neurons in the Rat Medial Entorhinal Cortex. The Journal of neuroscience : the official journal of the Society for Neuroscience 35, 12346–12354. [DOI] [PMC free article] [PubMed] [Google Scholar]
  45. Tennant SA, Fischer L, Garden DLF, Gerlei KZ, Martinez-Gonzalez C, McClure C, Wood ER, and Nolan MF (2018). Stellate Cells in the Medial Entorhinal Cortex Are Required for Spatial Learning. Cell Rep 22, 1313–1324. [DOI] [PMC free article] [PubMed] [Google Scholar]
  46. Tootell RB, Silverman MS, Switkes E, and De Valois RL (1982). Deoxyglucose analysis of retinotopic organization in primate striate cortex. Science 218, 902–904. [DOI] [PubMed] [Google Scholar]
  47. Weisz N, Wienbruch C, Hoffmeister S, and Elbert T (2004). Tonotopic organization of the human auditory cortex probed with frequency-modulated tones. Hear Res 191, 49–58. [DOI] [PubMed] [Google Scholar]
  48. Widloski J, and Fiete IR (2014). A model of grid cell development through spatial exploration and spike time-dependent plasticity. Neuron 83, 481–495. [DOI] [PubMed] [Google Scholar]
  49. Winterer J, Maier N, Wozny C, Beed P, Breustedt J, Evangelista R, Peng Y, D’Albis T, Kempter R, and Schmitz D (2017). Excitatory Microcircuits within Superficial Layers of the Medial Entorhinal Cortex. Cell Rep 19, 1110–1116. [DOI] [PubMed] [Google Scholar]
  50. Yoon K, Buice MA, Barry C, Hayman R, Burgess N, and Fiete IR (2013). Specific evidence of low-dimensional continuous attractor dynamics in grid cells. Nature neuroscience 16, 1077–1084. [DOI] [PMC free article] [PubMed] [Google Scholar]
  51. Yoon K, Lewallen S, Kinkhabwala AA, Tank DW, and Fiete IR (2016). Grid Cell Responses in 1D Environments Assessed as Slices through a 2D Lattice. Neuron 89, 1086–1099. [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

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

Supplementary Materials

1

Figure S1. Cellular-resolution two-photon imaging of grid cells in layer 2 of the mouse MEC during virtual navigation, related to Figure 2.

A. Microprism implant placement for cellular-resolution imaging of the MEC.

B. Strategy for chronic cellular-resolution optical access to the MEC using a 1.5mm right angle microprism inserted into the transverse fissure.

C. Parasagittal slice of the MEC from a GP5.3 mouse stained with Wfs1 and reelin antibodies. Region between the two dashed yellow curves is layer 2, in which GCaMP6f was highly expressed in stellate (reelin+) and pyramidal cells (Wfs1+, wolframin ER transmembrane glycoprotein 1).

D: dorsal; V: ventral; P: posterior; A: anterior. Same in all figures. Scale bar: 100μm. D. Parasagittal slice showing expression of GCaMP6f in reelin+ neurons, which included stellate cells and reelin+ interneurons in layer 2 (the region between the two dashed yellow curves) of the MEC in GP5.3 mice. Interneurons were stained with GAD67 antibody. Scale bar: 50μm.

E. Percentage of different reelin+ neurons expressing GCaMP6f. First two columns show percentages of GCaMP6f+ stellate cells and reelin+ interneurons. Last column shows percentage of reelin+ interneurons among all reelin+ neurons. Intnr: interneuron.

F. Fluorescence intensity of GCaMP6f, which was quantified by mean gray value, in stellate cells and reelin+ interneurons. Intnr: interneuron.

G. Percentages of stellate (Ste) and pyramidal (Pyr) cells that expressed GCaMP6f. Note: since only 3.32 ±1.1% of reelin+ neurons were interneurons (D and E), contamination in reelin+ stellate cells by interneurons was negligible and all the observed reelin+ neurons were considered to be stellate cells.

H. In vivo two-photon image of GCaMP6f-labeled cell bodies in layer 2 of the MEC in GP5.3 mice. Scale bar: 50μm.

I. Pyramidal and stellate cells in layer 2 of the MEC (the region between the two dashed yellow curves) had different cell body diameters in in vitro brain slices (parasagittal). Left panels, from left to right: expression of GCaMP6f in layer 2 neurons of the MEC; Wfs1 staining reveals pyramidal cells; reelin staining reveals stellate cells. Middle panels: overlay of GCaMP6f with Wfs1 (left) or reelin (right). Right panel: diameters of cell bodies. Each dot represents the COM of one cell with a color representing the diameter of its cell body. Scale bar: 50μm.

J. Cell body diameters of GCaMP6f+ layer 2 neurons in the MEC measured in in vitro brain slices. Left: diameters of individual cells. Magenta and green dots represent pyramidal and stellate cells, respectively. Right: distribution of cell diameters of all GCaMP6f+ layer 2 cells in vitro is shown by both a histogram (bars) and a kernel density estimate (red curve).

K. Identification of pyramidal and stellate cells based on their diameters. Magenta and green dots represent real pyramidal and stellate cells, respectively.

L. Cell body diameters of pyramidal and stellate cells in vivo. Left: layer 2 neurons in the MEC in vivo imaged using a two-photon microscope. Middle: diameters of cells in vivo. Each dot represents the COM of one cell with a color showing the diameter of its cell body. Right: identified pyramidal (magenta) and stellate (green) cells based on their cell body diameters. Scale bar: 50μm.

M. Cell body diameters of GCaMP6f+ layer 2 neurons of the MEC in vivo. Top: diameters of individual cells. Each dot represents one cell. Bottom: the distribution of all cell diameters shown by a histogram (bars) and a kernel density estimate (red curve).

N. Distributions of pyramidal and stellate cells identified in vivo in two mice (left and right examples). Green and magenta dots represent the COMs of stellate and pyramidal cells, respectively. Scaler bar: 100μm. D: dorsal. V: ventral. M: medial. L: lateral. Same in all following figures.

O. Schematic diagram of experimental apparatus, consisting of an air-supported spherical treadmill, axle positioned to constrain treadmill rotation to the forward/backward direction, visual display system for VR (RM, reflecting mirror; AAM, angular amplification mirror, toroidal screen, a megapixel camera to record treadmill rotation, PC running ViRMEn software), custom two-photon microscope with rotatable objective, headpost (headplate was mounted only on the right side of the animal), and a water-reward delivery system.

P. Schematic of a 1000-cm virtual linear track used for navigation during imaging of neurons in the MEC. Blue light was displayed to reduce detection of projected light by the microscope.

Q. Spatial dependence of calcium transients of an imaged grid cell. Top: heat plot of ΔF/F versus linear track position for a set of sequential traversals (Runs). Middle: mean ΔF/F versus linear track position, Bottom: 1-pvalue function (1-p, dark blue) along the track, indicating statistical significance of the calcium signals in each spatial bin compared to shuffled data. In- and out-of-field periods (red and gray blocks) were identified based on the 1-pvalue within the periods.

R. Example of schematic response of a cue cell that matches the distribution of salient cues along the virtual track. From top to bottom: side view of a 1000-cm long VR track; the cue template of the track showing the distribution of salient cues; 1D response of a cue cell on the track.

S. To calculate the cue score, the 1D response of a cue cell was shifted according to its correlation to the cue template. Top: cross-correlation between the cue cell response and cue template under spatial shifts (lags) up to 300 cm in both directions. Middle: cue template. Bottom: 1D response of the cue cell was shifted by the amount of the lag, at which the correlation was maximal.

T. Cue score was calculated as the mean correlation between each cue and the 1D response around the cue. Five cues were involved in the calculation for this example. The last cue, which was located at the very end of the track (indicated in S), was removed from the analysis. Cells with cue scores above the 95th percentile of shuffles were identified as cue cells.

U. Tetrode-recorded cue cells and grid cells on a VR track. Each cell was recorded in a real 2D environment and 1D VR track. For each cell: left top: spikes (red dots) and trajectory (gray trace) in a 0.5×0.5m real 2D environment. Left middle: firing rate in the 2D environment, calculated based on the spikes on top. Left bottom: autocorrelogram of the firing rate in the middle. Right top: spikes (red dots) and trajectory (gray trace) on multiple traversals of the 1D VR track. Right middle: firing rate along the track calculated from the spikes on top. Right bottom: overlay of cue template (C.T., in red) and shifted firing rate (F.R., in gray) according to the lag.

V. Imaged cue cells and grid cells on a VR track. Cells were only imaged on 1D VR tracks and classified based on the grid cell classifier and their cue scores. For each cell: top: heat plot of ΔF/F versus linear track position for a set of sequential traversals. Middle: mean ΔF/F versus linear track position. Bottom: overlay of cue template (C.T., in red) and shifted mean ΔF/F (M. ΔF/F, in gray) according to the lag.

A, B and O were modified from Low et al, 2014.

2

Figure S2. Properties of pyramidal and stellate cells in virtual navigation; assigning grid modules based on their 1D responses, related to Figures 2 and 3

A. Percentages of imaged cue cells that were classified as stellate (SteC) and pyramidal cells (PyrC). p=4.6×10−3.

B. Pairwise distances between cue cells versus those between cue and grid cells.

C. An example of the distribution of cue and grid cells among stellate and pyramidal cells. Scale bar: 50μm.

D. Amplitudes (left) and frequencies (right) of significant transients of stellate and pyramidal cells (517 stellate cells and 408 pyramidal cells in 18 FOVs of six mice). p =2.7×10−9 and 1.1×10−9 for amplitudes and frequencies, respectively.

E. Amplitudes (left) and frequencies (right) of significant transients of stellate grid cells (G-S) and pyramidal grid cells (G-P) (75 pyramidal grid cells and 219 stellate grid cells in 18 FOVs of six mice).

F. Example showing frequencies and amplitudes of significant transients of pyramidal cells within a patch. Top left: GCaMP6f+ pyramidal cells imaged in vivo. Top right: white dots: COMs of identified pyramidal cells from the left. Red square: center of the patch. Bottom: pyramidal cells color-coded by frequency (Freq., left) and amplitude (Amp., right) of significant transients. Scale bar: 50μm.

G. Relationship between frequencies (left) or amplitudes (right) of significant transients of pyramidal cells and their distances to patch centers. Dark gray dots: individual cells. Curves: frequencies (left) or amplitudes (right) for real (black) and shuffle data (light gray, 100 shuffles) at different distances from patch centers. Bin width: 15μm. Frequencies and amplitudes positively correlate with the distances (p=1.36×10−6 and 2.07×10−5, respectively).

H. Parasagittal slice of the MEC from an Emx1-IRES-Cre; CaMKIIa-tTA; Ai93 (Ai) mouse stained with Wfs1 antibody. The region between the two dashed yellow curves is layer 2, in which GCaMP6f was highly expressed in pyramidal cells (Wfs1+). Scale bar: 50μm.

I. Comparison of percentages of pyramidal cells (Pyr) in Ai mice, stellate (Ste) and pyramidal (Pyr) cells in GP 5.3 mice that expressed GCaMP6f.

J. Fluorescence intensity in cell bodies of pyramidal cells (Pyr) in Ai mice, stellate (Ste) and pyramidal (Pyr) cells in GP 5.3 mice that expressed GCaMP6f. The fluorescence intensity is represented as mean gray value, which was measured in vivo under two-photon microscope with comparable laser powers used in different mice.

K. In vivo two-photon image of GCaMP6f-labeled cell bodies in layer 2 of the MEC in Ai mouse. Scale bar: 50μm. Note that the labeled cell bodies cluster in a patch, consistent with the immunohistochemistry results that most labeled cells were pyramidal cells.

L. Spatial dependence of calcium transients of an imaged grid cell in an Ai mouse on a 1000 cm-VR track. Annotations are similar to Figure S1Q.

M. Percentage of grid cells in GCaMP6f+ pyramidal cells (Pyr) in Ai mice, GCaMP6f+ stellate (Ste) and pyramidal (Pyr) cells in GP 5.3 mice (2216 pyramidal cells in 37 FOVs of three Ai mice, 517 stellate and 408 pyramidal cells in 18 FOVs of six GP 5.3 mice).

N. Percentage of pyramidal grid cells at different distances from centers of pyramidal patches in Ai mice (1863 pyramidal cells in 37 FOVs of three mice). Curves: real data (magenta) and 100 shuffles (gray). Bin width: 15μm.

O. An example of a ground truth dataset, in which grid cells were recorded using tetrodes in both a 2D real and two 1D virtual environments. These grid cells were clustered into two modules based on their 2D scales.

P. Clustering of the four parameters (1D field widths and spacings on two VR tracks, as shown in Figure 3A) of the 1D response of all grid cells in O.

Q. Comparison of module assignment of cells in O using 1D and 2D responses. The accuracy is 100% for this dataset.

R-T. Module assignment for another ground truth dataset. Annotations are the same as in O-Q. Accuracy is 98% for this dataset.

U. Fitting quality of co-modular grid cells assigned based on their 1D calcium responses. Co-modular cells were simultaneously fit as parallel slices in the same triangular lattice. Each dot represents the percentile of the fitting score of cells in one module compared to those of 100 shuffled datasets. Red dashed line marks the 75th percentile of the shuffled fitting scores.

V. Ratios of 2D grid scales of successive modules, which were the 2D spacings of their fitted 2D triangular lattices. Each dot represents the spacing ratio of a pair of successive modules. Red dashed line marks the average ratio (1.51) of all pairs of modules. *p ≤0.05. **p ≤0.01. ***p ≤0.001. n.s. p > 0.5. Student’s t-test. Error bars: mean±SEM.

3

Figure S3. Methods for calculating phase distances; additional methods and results for local phase arrangement, related to Figure 4.

A. Calculation of phase distance of a pair of grid cells based on fitted slices of their 1D responses. (1) Starting points of fitted 1D slices of two co-modular grid cells (green square and circled magenta star) are shown in the same unit-rhombus (red). The four points of the rhombus are mathematically equal and also equal to other surrounding points of the lattice (gray dots). “s” is the spacing of the lattice. Coordinates of each dot are labeled next to it. Original phase distances of the two cells (Dorig) are marked with a black line. (2) To calculate the real phase distance of the two cells, the starting point of one cell (green square) was fixed while the other one was placed at the eight other mathematically equivalent locations (magenta stars without circles). Distances from the green square to all nine magenta stars were calculated (dashed black lines from the green square to magenta stars). (3) Real phase distance of the two cells (Dtransf) was determined as the distance of the green square to the nearest magenta star, as shown with a black line.

B. An example of a ground truth dataset, testing the accuracy of identifying grid phase distances based on slice fit of 1D grid responses. Four grid cells were simultaneously recorded with tetrodes in 2D real and 1D VR environments. Their 1D responses were fitted as parallel slices in the same triangular lattice. For each cell: left top: spikes (red dots) and trajectory (gray) in a 0.5×0.5m real 2D environment. Left middle: firing rate in the 2D environment, calculated based on the spikes on top. Left bottom: autocorrelogram of the firing rate in the middle. Right top: spikes (red dots) and trajectory (gray) on multiple traversals on the 1D VR track. Right bottom: overlay of real firing rate along the track calculated from the spikes on top (black) and simulated activity of fitted slice (gray).

C. 2D and 1D phase distances of the four grid cells in B. Each dot represents phase distance of one pair of grid cells. R2 reveals the linearity of the relationship of 1D and 2D phase distances. D. 2D and 1D phase distances of additional pairs of simultaneously recorded grid cells (25 pairs in three datasets like B). Each dot represents phase distance of one pair of grid cells. R2 reveals the linearity of the relationship of 1D and 2D phase distances.

E. Errors in calculating 2D pairwise phase distances using the 1D slice fit. Each dot represents the absolute difference (error) of the 1D and 2D phase distances of one pair of cells. The absolute error is 0.08±0.01.

F. Plotting the relative anatomical location of cell pairs with different phase distances shown in Figure 4C (phase plot). (1) One cell was set as the reference cell (Ref.) and the locations of all cells were shifted so that the reference cell was at (0,0). Each cell was colored according to its phase distance to the reference cell. Here we show examples for two different reference cells, but plots for all nine reference cells were similarly generated. (2) The nine plots described in (1) were overlaid, with colors from those plots (indicating phase distances between pairs of cells) all renormalized to the same color scale. (3) The points (cell pairs) with phase distances either greater than Tlarge (e.g., 80%) or less than Tsmall (e.g., 20%) were kept in the plot. (4) For better visualization, the points with large and small phase distances were plotted in red and black, respectively.

G. Relationship between phase and physical distances shown in a group of ten cells in module 2, which has the second smallest spacing in an animal. Top left: anatomical locations of the ten module 2 cells, color coded based on their phase distance to the reference cell (Ref.). Scale bar: 25μm. Other panels: phase distances of the reference cell (bottom left) and its close (cell1) and distal (cell2) cells. Distances were determined by fitting 1D calcium responses of all cells to parallel slices in the same triangular lattice. Annotations are similar to Figures 4C and 4D.

H. Pairwise phase distances versus physical distances for the ten cells in G. Bin width: 30μm.

I. Phase plot showing relative anatomical locations of cells in G with small (below 20th percentile) and large (above 80th percentile) phase distances to reference cells, the locations of which were set at (0,0). X and Y axes correspond to the X and Y axes in G.

J. Relationship of pairwise physical and phase distances of all module 2 cells (bin width: 30μm; 1536 cell pairs in 11 module 2 datasets of five mice). Blue rectangle indicates the portion of the plot corresponding to physical distances shorter than 120μm.

K. Relationship of pairwise physical distances and percentage of module 2 cell pairs with small (black: <20th percentile, left y-axis) and large phase distances (red: >80th percentile, right y-axis). Only cell pairs physically closer than 120μm are shown. Bin width: 15μm. 716 cell pairs with small or large phase distances (308 pairs for each distance group) in 11 module 2 datasets of five mice were used.

L-M. Calculation of folding score.

L. Triangulation of a cell group in brain space (brain triangles, left) and two sets of hypothetical phases for those cells, plotted in the unit-rhombus (phase triangles, middle and right). In the brain (left), the cell group includes a center cell (C.C.) and all cells within a distance r from the center cell. Throughout all six subpanels, the same colored dot represents the same cell. The phases in Phase 1 were chosen to match the cells’ arrangement in the brain, whereas those in Phase 2 do not, as can be visualized via the corresponding triangulations in the second row.

M. Calculation of folding score. Top: the folding score for the above cell group was calculated based on the phase triangles. It was the ratio of the area of the smallest polygon that contains all the triangles to the sum of the areas of all the individual triangles. Middle: the folding score is 1 for the first phase map (Phase 1), because the triangles do not overlap. Bottom: the folding score is less than 1 for the second phase map (Phase 2), because the triangles overlap.

p values in H and J were calculated as the percentage of shuffled data points that are below (when the mean of real data ≤ the mean of shuffled data) or above real data (when the mean of real data ≥ the mean of shuffled data). *p ≤0.05. **p ≤0.01. ***p ≤0.001. Error bars: mean±SEM.

4

Figure S4. Additional methods and results for global phase arrangement, related to Figure 5.

A. Transformation of a lattice to a regular triangular lattice and calculation of grid score. Left: the original autocorrelogram of the distribution of phase clusters, shown in Figure 5B. Step 1: identifying the six vertices nearest to the center of the autocorrelogram (red circles). Step 2: fitting the six vertices in step 1 to an ellipse (white ellipse). Step 3: reshaping the lattice to a regular hexagon based on the long and short axes of the ellipse in step 2. Step 4: calculating grid scores based on the transformed regular triangular lattice in step 3.

B-D. An example of phase clusters in module 2 cells, which had the second smallest spacing in an animal.

B. Anatomical locations of 18 grid cells in module 2 with different phases. Cells with similar phase (phase distances <15th percentile of all distances) are represented in the same color. Scale bar: 50μm.

C. Phase cluster distribution. Left: phase plot showing relative anatomical locations of cells with small phase distances (<15th percentile of all phase distances). Middle: same data on the left but spatially binned (in 20μm×20μm spatial bins). Right: autocorrelogram of the middle map and its grid score.

D. Phase plot and autocorrelogram of a shuffled dataset of C. Annotations are same as in C.

E. Two examples of multiple phase clusters in combined FOVs. For each example, left: anatomical distribution of cells in two sets of phase clusters (magenta and green). Scale bar: 50μm. Right: autocorrelogram of phase plots for cells on the left in the same set of phase clusters.

F. Comparison of grid scores of phase clusters in 29 sets of co-modular cells with those of shuffles. The red dashed line indicates 60th percentile of shuffles. Each dot represents one set of co-modular cells. Note that all the grid scores are above the 60th percentile of shuffles.

G-I. Shapes of phase cluster lattices.

G. Plotting the two shortest vectors of the phase cluster autocorrelogram. Left: original autocorrelogram of phase clusters. Middle: the vectors v1 and v2 point to the two autocorrelogram vertices (p1 and p2) nearest to the origin (excluding reflections), with ∣v1∣ < ∣v2∣. Right: v1 and v2 were transformed so that v1 was sent to (1, 0), and then v2 was reflected and translated by v1 until its y coordinate was positive and its x coordinate was between 0 and 0.5. Black: the vectors v1 and v2 after the transformation. Gray: transformed v1 and v2 for a regular triangular lattice.

H. Diagram for interpreting the shape of the phase cluster lattice from the vector plot shown in M. The v2 vectors were expected to be placed in the green zone. Gray: v1 and v2 of a regular triangular lattice. Magenta: an example of v2 of a non-regular triangular lattice. The ideal triangular lattice (black) and the lattice shape according to the magenta v2 (dotted) were plotted. Note that the dotted lattice is skewed compared to the regular triangular lattice.

I. The vectors v2, after transformation shown in M, for all 29 individual co-modular cell sets (shown in F), giving a quantification of the lattice shapes across the cells. As explained in H, all 29 lattices were skewed compared to the regular triangular lattice.

J. The relationship of physical spacings of phase clusters and spacings of grid modules determined from their spatial tuning responses. Each dot represents one module (n=29). Red dashed line is the best fit line to the data. p value of the correlation between the two sets of spacings is 3.4 × 10−5.

K. Four examples of the relative distribution of phase clusters and pyramidal clusters. Grid cells (colored dots) with similar phases are represented with the same color. Pyramidal cells are represented as white circles. Scale bar: 100μm.

L. Comparison of spacings of phase clusters and pyramidal clusters. p=9.8×10−14, Kolmogorov-Smirnov test.

M-P. Global lattice fit.

M. Cell locations in brain space and corresponding phases in the unit-rhombus.

N. Generation of candidate anatomical lattice vectors based on the autocorrelogram of phase clusters. (1) Left: autocorrelogram of phase clusters in M with six vertices nearest to the origin (red circles, three pairs of vertices are symmetric) identified. Right: Reflected vertices were excluded, producing the three vertices (p1, p2, p3) (in what follows, we define each vertex with its corresponding 2D vector, pointing to that vertex from the autocorrelogram center). (2) For each choice of two vectors from the three vectors in (1), for example p1 and p2, the two shortest vectors p~1 and p~2 generated by p1 and p2, were constructed, and we then constructed the eight shortest vectors generated by p~1 and p~2. This produced the 8 shortest vectors in the lattice L(p1, p2). (3) As candidate fit vectors for the next step, we took all pairs v1, v2 of the eight shortest vectors generated above. Here we show 4 examples of 40 total choices. Each pair of these 40 pair choices will serve as generating vectors of an anatomical lattice, as described in O below.

O. Calculation of fit score. (1) Cell locations were first mapped in an anatomical lattice by sending the vectors v1, v2bto the generating vectors in the parallelogram, as indicated, and then applying a possible shift of the parallelogram in the FOV (shift = 0 in this example). An anatomical lattice was then generated under this pair of vectors and the shift by repeating the parallelogram across the FOV (gray lattice). (2) The cell location in the parallelogram was proportionally converted to a location in a unit-rhombus. We then refer to the cell locations in the unit-rhombus under this mapping as the “anatomical phases” (green circle for cell 1), and the true phase of cells as “spatial tuning phases” (magenta cross for cell 1). (3) The fit score of the mapping was then defined to be the average over all cells of the necessary migration distance (magenta dashed line) to reach the perfect match between anatomical phases and the spatial tuning phases. We similarly generated many lattices under all pairs of vectors (described in N) and different shifts, and identified the best fit lattice, which has the lowest fit score (minimal migration distances to reach the perfect match between the anatomical and spatial tuning phases)

P. Generation of “locality preserving” shuffles. (1) Shuffles were generated by clustering phases into five clusters in the unit-rhombus and permuting the phase clusters via translation. (2) After the shuffling, while the cells stayed in their original anatomical locations, the phases of cells were changed together and therefore the autocorrelogram of the shuffled phase clusters remained similar to the true autocorrelogram of phase clusters.

***p ⩽0.001.

5

Figure S5. Noise of the anatomical phase map, related to Figure 5.

The purpose of this figure is to identify the noise of the anatomical phase map of the brain, which is defined as the level of inconsistency between the anatomical and spatial tuning phases. We modeled anatomical phase map with different levels of noise to match the current data. To simplify the illustration, we represent the anatomical phases of all cells in the same anatomical phase unit-rhombus, although the actual cells in the brain were distributed in multiple unit-parallelograms of an anatomical lattice. This representation allows us to more densely sample the unit-rhombus and reveals the overall distribution of spatial tuning phases in the brain across the anatomical lattice.

A. Modeling of anatomical phase maps with noise. (1) To represent different spatial tuning phases, the spatial tuning phase unit-rhombus was divided into nine color zones. The anatomical phase unit-rhombus was divided accordingly. (2) In the anatomical phase unit-rhombus, the location of each dot represents the anatomical phase of one cell, which is colored according to its spatial tuning phase. In the perfect case, anatomical and spatial tuning phases were perfectly consistent. In the noisy case, they were inconsistent and the difference between the anatomical phase and spatial tuning phase was termed “noise” of a grid cell. (3) When more cells were included, the color patterns in the spatial tuning and anatomical phase rhombuses were identical for the perfect case, but different for the noisy case. (4) The global lattice fit analysis generated a new anatomical lattice (gray), in which the cells could migrate at the shortest distance (on average) to reach the best match between their anatomical and spatial tuning phases. Therefore, in principle zero migration was required for the perfect case. In the real analysis, due to the limited sampling of the anatomical lattice (limited choices of lattice sizes and offsets in the brain, etc.), small migrations were still necessary. However, the fit score for the perfect case, which was equal to the average migration distance of all cells in the fitted lattice, was very low. In contrast, in the noisy case, larger migrations were necessary even in the new anatomical lattice, so the fit score was much higher compared to the perfect case. The fit score increased with the increase in noise level. Note that the fit score was the minimal cell migration required in the new optimized anatomical lattice. Therefore, the fit score was equal to the new noise in the new anatomical lattice. This new noise was generally lower than the noise of the data in the original anatomical lattice (the anatomical lattice in (2)). In the rest of this figure, we termed the original noise before the lattice fit as the “noise” of the phase map. Also note that in Figure 5M, the observed “noise” is the new noise in the new fitted lattice.

B. An example of identifying the noise level of the anatomical phase map of a set of co-modular cells based on its fit score of the global lattice fit analysis. The x axis indicates different levels of noise (original mean noise level of all cells before the global lattice fit) introduced to spatial tuning phases that perfectly match anatomical phases, as explained in A. The y axis indicates the fit scores (new noises after the global lattice fit) of the co-modular cell sets with different noise levels in the global lattice fit analysis. The corresponding noise level with the fit score of real data is the estimated original noise level of the data (red dot on the x axis).

C. Noise levels of anatomical phase maps of all 29 sets of co-modular cells. The dashed line indicates the mean noise level (0.22).

D. Comparison of the mean noise level of real data (0.22, black line) to that of 50 randomized datasets (gray histogram). Each randomized dataset was developed from the original 29 sets of co-modular cells by maintaining the anatomical locations of cells and assigning random phases to the cells (29 randomized sets). The global lattice fit analysis was then performed on the 29 randomized cell sets to estimate their noise levels, which were further averaged as the mean noise level of the randomized dataset. The histogram represents the distribution of mean noise levels of the 50 randomized datasets. Note that the real data had lower mean noise level than all randomized datasets, suggesting that the anatomical arrangement of grid phases in real data are not random. This arrangement is closer to a triangular lattice pattern than any random arrangement.

E. 2D and 1D color schemes to represent spatial tuning phases, as in Figure 5M. Spatial tuning phases can be represented in 2D by dividing the unit-rhombus into nine color zones (as in A), and in 1D by color gradients along the two axes (r1 and r2) of the unit-rhombus.

F. Distribution of spatial tuning phases in the anatomical phase unit-rhombus of real data after the global lattice fit analysis (same as in Figure 5M, n=744 from 29 sets of co-modular cells). r1, r2: the distribution of spatial tuning phases represented by the 1D color scheme along axes r1 or r2 of the unit-rhombus, as explained in E. Note that the color patterns in the two unit-rhombuses largely follow the 1D color schemes in E, indicating that grid phases form a phase lattice map in the brain. However, this map is noisy. Note that the noise observed here is the new reduced noise in the fitted lattice. In G, we provided modeled phase maps to reveal the original noise (for example, 0.22 on average, as shown in C) of the phase map before the global lattice fit.

G. The modeled anatomical phase map under the noise level of the data. The cells from all 29 sets of co-modular cells were used (n=744) to generate these modeled data. Four noise levels were modeled: (1) zero noise; (2) maximal noise (random); (3) mean noise of the data (0.22, as indicated in C); (4) each FOV with its own noise (as plotted in C). For each noise level: “Original”: for each FOV, the anatomical phases of cells were their locations in the unit-rhombus of a regular triangular lattice randomly constructed in the brain. The perfect spatial tuning phases were set to be identical to the anatomical phases. Different levels of noise were introduced to the perfect spatial tuning phases. The distribution of the noise-introduced spatial tuning phases in the anatomical phase unit-rhombus of all 29 cell sets was represented by 2D coloring (as in E), 2D tiling (2×2 tiling the anatomical unit-rhombus to better reveal the 2D color pattern of a single unit-rhombus) and 1D coloring (as in E). “Fit”: the global lattice fitting analysis was performed on cells in each FOV, which contained the modeled anatomical and spatial tuning phases with different levels of noise introduced. The optimized anatomical phases were plotted in the unit-rhombus and colored according to the spatial tuning phases (1D coloring, as in E). Note: the phase lattice maps with different noise levels were represented by the “Original” plots. While the “Original” zero-noise lattice maps show perfectly matched color patterns to those in E, and the maximal-noise lattice (random) maps show random color-patterns, the “Original” maps with mean data noise (0.22) and matched noise to each FOV show comparable color patterns. The color patterns of their “Fit” anatomical phase unit-rhombuses are similar to those of real data (as shown in F). Thus the “Original” maps with mean data noise and matched noise to each FOV represent the anatomical phase map with the noise obtained from the current data.

H. Modeled anatomical phase map without the noise introduced by 1D slice fit. The noise of the current phase lattice map has at least two sources: (a) the noise generated from the estimation of phase relationship of a pair of cells based on their 1D responses (1D noise); (b) the noise generated from the migration of cells in the brain tissue (brain noise). To reveal the phase lattice map with only the brain noise (b), we modeled the phase lattice maps by subtracting the 1D noise, which was 0.08 (Figure S3E). The two noise levels, (1) mean data noise subtracted by the 1D noise and (2) matched noise of each FOV subtracted by the 1D noise, were modeled. Note: these phase lattice maps of these two noise levels are similar and represent the phase lattice map with the noise in the brain.

I. Scale of noise level representing the noise of the phase map in mouse MEC (noise level 0.14) compared to the perfect hexagonal phase lattice (noise level 0) and purely random phase arrangement (noise level 0.34). Assuming the change of noise level is linear, the phase map in mouse MEC is closer to the perfect hexagonal phase lattice than to the purely random phase arrangement.

6

Figure S6. Global lattice fit and anatomical phase map of individual mice; co-active cells form a lattice similar to that formed by phase clusters, related to Figures 5 and 6

A. Global lattice fit results, anatomical phase maps, and noise levels of the anatomical phase map are shown for individual mice. From left to right: results of mice 1 to 6. For each mouse, from top to bottom: global lattice fit result as in Figure 5K, anatomical phase maps as in Figure 5M, noise level of the anatomical phase map as modeled in Figure S5. Note that in the global lattice analysis, four mice (1, 3, 5 and 6) showed significantly lower fit scores (shorter anatomical migration distances to reach a perfect phase lattice) compared to shuffles. The other two mice (2 and 4) showed very low p values. Exact p values (Kolmogorov-Smirnov test): mouse 1: 0.030; mouse 2: 0.071; mouse 3: 0.043; mouse 4: 0.053; mouse 5: 0.049; mouse 6: 0.041. For the anatomical phase map, all cells in the same mouse are plotted in the same unit-rhombus. Cell number in each mouse: mouse 1: 236 (10 FOVs); mouse 2: 109 (4 FOVs); mouse 3: 75 (3 FOVs); mouse 4; 58 (3 FOVs); mouse 5: 183 (6 FOVs); mouse 6: 83 (3 FOVs). The noise level of a mouse is the mean noise level of all FOVs of the same mouse.

B-D. Example group of co-modular cells showing correlation of lattices of co-active cells and phase clusters, represented by their autocorrelograms.

B. Autocorrelogram of co-active cells. Left: calcium responses of seven cells co-active within the spatial bin n in a 1000cm-long VR track, which was split into 80 bins under 12.5cm bin width. Significant spatial fields are highlighted in pink and the peak mean ΔF/F of each field is indicated by a green dot. These peak locations represent field locations. Note that all the seven cells showed fields within the range of bin n (dotted rectangular area), so they were determined as co-active cells. Top right: an image frame n was generated based on the activity in the spatial bin n. In this frame n, the areas of co-active cells were assigned to 1 and the remaining pixels were 0. An autocorrelation was then performed on the frame (step 1). The same procedure was repeated for all 80 frames (for 80 spatial bins) along the track and averaged to get a mean autocorrelogram (step 2; the autocorrelogram was smoothed with a two-dimensional Gaussian smoothing kernel with standard deviation of 10 for better visualization, same for all activity autocorrelograms in the figure). Bottom right: the calcium responses were shuffled among all cells in the group and the mean autocorrelogram of co-active cells in the shuffle dataset was similarly generated. Scale bars: 100μm.

C. Comparison of the autocorrelograms of co-active cells and phase clusters of cells in B. In the overlay figures, the autocorrelograms of co-active cells and phase clusters are shown in magenta and green, respectively. The overlaid areas of the two autocorrelelograms show white color. Scale bar: 100μm.

D. Comparison of the autocorrelograms of co-active cells and phase clusters of the shuffled dataset for cells in B.

E. Comparison of correlation coefficients between the autocorrelograms of co-active cells and phase clusters for real data in B and its shuffles, in which the calcium responses were randomly permuted among the cells (50 shuffles). The real correlation coefficient was higher than 98% of shuffled coefficients.

F. Comparisons of the autocorrelograms of co-active cells and phase clusters of three more groups of co-modular cells ((1)-(3)). Scale bars: 100μm.

G. Comparison of correlation coefficients of the autocorrelograms of co-active cells and phase clusters of cells in 16 groups of co-modular cells and their shuffles (50 shuffles for each group). The correlation coefficients were normalized so that the shuffled coefficients in each group had mean 0 and standard deviation 1. The probabilities were normalized so that the maximal probabilities of real and shuffled data were 1. p =2.4×10−11.

* p≤0.05. *** p≤0.001. Kolmogorov-Smirnov test.

7

Figure S7. Method for calculating missed-field patterns; possible mechanisms for generating grid cells in stellate cells in layer 2 of the MEC, related to Figure 7

A-B. Calculation of missed-field patterns.

A. An example of spatially-modulated calcium activity of one grid cell. Top: significant transients versus linear track position for a set of sequential runs. Each red dot represents the location of the highest peak of one significant transient. The red dots are plotted over a gray line representing the y position in each run. Middle: mean ΔF/F versus linear track position. Bottom: 1-pvalue function (1-p, dark blue) versus track position. In- and out-field periods are indicated in red and gray, respectively. Six spatial fields were identified for this cell.

B. Calculation of the missed-field pattern of the cell in A. Top left: run-by-run significant transients of the six spatial fields in A. For each field, a single red dot represents the location of the highest peak of one significant transient. The gray lines represent the y position through that field for each run. Bottom left: missed-field pattern for each field, indicating for each run whether that field contained a significant transient (show-field, white) or not (missed-field, black). Right: the missed-field patterns were converted to binary vectors (show-field =1, missed-field =0) and then averaged across all fields to obtain the missed-field pattern for the cell, which was a vector with one entry between 0 and 1 for every run. This missed-field pattern was then used to calculate the correlations between different cells.

C-E. Possible mechanisms for generating grid cells in stellate cells.

C. Two-dimensional model for path integration. Top: in the presence of surround inhibition (not shown), a focused activity bump is formed within a layer of neurons, which are recurrently connected (connections are indicated by red arrows). Bottom: during locomotion, the bump can be made to move by intermediate layers of cells that perform path integration. These cells are conjunctive for position and head-direction of the animal and positively modulated by speed. They receive position information from the bump of activity in the top cell layer, and generate information about the displacement vector (with both direction and speed information) for the future displacement of the bump. Note that there are multiple layers of cells encoding different head directions (five layers are shown, indicated by arrows), which can be mixed together in fewer real cortical layers. Modified from McNaughton et al 2006.

D. Different connectivity patterns for layer 2 stellate and pyramidal cells within the MEC. Functional cell types in each layer are indicated.

E. Two possible models for generating grid cells in stellate cells in layer 2 of the MEC. Each gray dot represents a single stellate cell in layer 2 or a single pyramidal cell in deep layers of the MEC. Gray dots with magenta or blue rings are active cells at a particular location of the environment during animal’s locomotion. Left: grid cells are locally generated within stellate cells in layer 2, which are recurrently connected (red arrows). During locomotion, activity bumps are made to move via the communication between layer 2 grid cells and cells in deep layers of the MEC (green and blue arrows), which contain grid-head direction conjunctive cells to perform path integration. Right: grid cells in layer 2 are inherited from the grid-like activity in deep layers of the MEC via feedforward excitation from deep layers to stellate cells (blue arrows).

Our current results suggest that majority of grid cells in layer 2 are stellate cells. Although substantial additional research is needed to elucidate which brain area(s), layer(s), cell type(s) primarily contribute to the grid cell population and grid formation, converging lines of evidence point to the idea that layer 2 stellate cells may play a role because of their special connectivity:

(1) Inhomogeneity of layer 2 of the MEC Compared to visual cortex and hippocampus, which exclusively consist of pyramidal neurons, layer 2 of the MEC contains two different excitatory cell types: stellate cells and pyramidal cells. These cells differ not only in their morphologies and molecular profiles, but also distinct anatomical distributions: pyramidal cells cluster into multiple hexagonally-arranged patches, while stellate cells fill the inter-patch spaces (Kitamura et al., 2014; Ray et al., 2014). Based on current literature, grid-like responses do not seem to rely on stellate cell type per se, because grid cells have also been found in deeper layers of the MEC, as well as pre- and parasubiculum, which do not contain stellate cells (Boccara et al., 2010; Sargolini et al., 2006). Instead, we propose that the separate anatomical clustering of stellate and pyramidal neurons provides the anatomical basis for different connectivity patterns, which could then lead to different fractions of grid cells in the two populations.

(2) The connectivity pattern of stellate cells is favorable for the formation of grid cells (illustrated in D) Although it is still unclear how grid cell activity emerges, models propose that it can arise through local lateral (recurrent) connections between grid cells (Burak and Fiete, 2009; Fuhs and Touretzky, 2006; McNaughton et al., 2006) which also communicate with grid-head direction conjunctive cells from different layers to perform path-integration of velocity signals as the animal moves (C). In particular, if the lateral connectivity is topographically local and Mexican-hat shaped, with strong inhibitory surrounds, then it is predicted that the neural sheet should exhibit multiple activity bumps themselves arranged in a triangular lattice pattern. Clusters of local cells should then have similar phase, with phase similarity within one locally-connected region decreasing with distance, and multiple, periodically arranged groups of cells with the same phase, similar to the patterns observed in the current study. Moreover, a model by Widloski and Fiete (Widloski and Fiete, 2014) shows that direct recurrent excitation between principal cells is important for obtaining grid-like patterning among excitatory cells while avoiding similar patterning in inhibitory cells (even though recurrent inhibition is predicted to be essential for grid patterning). Based on the above models, grid cells in layer 2 of the MEC should fulfill some of the three criteria: a) interact through a strong lateral inhibitory input, b) receive direct recurrent excitation, c) communicate with grid-head direction conjunctive cells to receive velocity signals and drive path-integration based updates of the location code in grid cells. Based on current experimental findings summarized below, stellate cells better meet these criteria and are thus better-placed to be grid cells than are pyramidal cells:

(a) Lateral inhibition:

Fast-spiking pavalbumin (PV)+ interneurons have been shown to be necessary for the maintenance of grid activity (Miao et al., 2017) and also inhibit stellate cells (Beed et al., 2013; Couey et al., 2013; Fuchs et al., 2016). A recent study particularly supported more extensive inhibition from PV+ interneurons onto stellate cells than pyramidal cells (Fuchs et al., 2016).

(b) Lateral excitatory connectivity: Recent reconstructions of local synaptic organization in the MEC show that both pyramidal and stellate cells can connect to other excitatory cells (Schmidt et al., 2017). However, within layer 2, stellate cells generally receives stronger excitatory inputs than pyramidal cells, such as the feedforward excitation from pyramidal to stellate cells (Fuchs et al., 2016; Winterer et al., 2017) and recurrent excitations between stellate cells (Winterer et al., 2017).

(c) Communication with conjunctive grid-head direction cells Unlike pyramidal cells, stellate cells appear to be more interconnected with deeper layers of the MEC, which contain head direction and grid-head direction conjunctive cells (Sargolini et al., 2006). Axons of stellate cells not only ramify greatly in layer 2, but also in deep layers of the MEC (Klink and Alonso, 1997; Tamamaki and Nojyo, 1993). Axon terminals of stellate cells, but not pyramidal cells, are enriched in layer 5 (Surmeli et al., 2015). It was also shown that dendritic bundles of layer 3 pyramidal cells only overlap with stellate area and avoid pyramidal patches (Tang et al., 2015), increasing the probability for layer 3 neurons to receive inputs from layer 2 stellate cells. On the other hand, layer 3 pyramidal neurons send strong feedforward excitation to stellate cells, but not to pyramidal cells (Winterer et al., 2017).

The following two versions of continuous attractor models (Burak and Fiete, 2009; Widloski and Fiete, 2014) therefore may explain grid cell activity generation in stellate rather than pyramidal cells, if we consider the findings from the literature described above:

(a) Grid cell activity patterning is locally generated among layer 2 stellate cells (E, left panel), and updated in accordance with animal movements based on interactions with the deeper layers: The grid-like activity bumps can be formed in recurrently connected stellate cells, in which the strength of connections between a pair of cells decays with the increase of their physical distance, with an effective net Mexican-hat interaction profile obtained by combining lateral excitation and inhibition. When the animal moves, the activity bump in layer 2 shifts through interactions with conjunctive grid-head direction cells, which are located in deep layers of the MEC: these cells receive position information from layer 2 grid cells, then shift the layer 2 state based on their velocity inputs.

(b) Grid cell activity in stellate cells in layer 2 is inherited from deeper layers of the MEC (E, right panel) Assuming that the recurrent connections between stellate cells are not enough, or other mechanisms are required for generating grid cells, grid cell activity can be possibility generated in deeper layers (e.g. layers 3 or 5) of the MEC. Stellate cells in layer 2 can then directly acquire the grid-like activity by receiving feedforward excitatory inputs from the deep layers.

Data Availability Statement

Data and custom MATLAB codes will be available upon request to the Lead Contact.

RESOURCES