Strange IndiaStrange India


For datasets generated in this manuscript, all procedures performed were approved by the Administrative Panel on Laboratory Animal Care at Stanford University. Mice were group housed with littermates and kept on a 12/12 h light/dark cycle and at a temperature of 20–25 °C and 30–70% humidity. Experiments were performed during the light phase on male and female mice of 3–8 months of age. C57BL/6J mice were bred in house from mice obtained from Jax (strain no. 00664). Unc5b-2A-CreERT2 mice were generously provided by J. Huang at Duke University20.

Publicly available Neuropixel recordings

Data from the Allen Brain Institute31 can be accessed using the Allen SDK ( Data from the Functional Connectivity dataset were used, which included long segments without visual stimuli (wild-type mice only: ten males aged 108–142 days, three females aged 126 to 134 days). Sessions without pupil data were excluded. Data from the Steinmetz study32 were obtained from and included ten sessions from seven mice (five females, aged 12 to 20 weeks, genotypes included tetO-G6s × CaMK-tTA, Vglut1-IRES2-Cre-D, RCL-GCaMP6f × VGlut-Cre, Snap25-GCaMP6s; two males, aged 26 to 30 weeks, genotypes included C57BL/6J and RCL-GCaMP6f × VGlut-Cre). Only sessions with electrodes intersecting the CA1 and dentate gyrus were included in the analysis. For 22 out of 23 recording sessions, the same electrode used for identifying DSs was used for ripple detection to avoid location-specific biases.

DS and SWR detection

For DS detection, the dentate gyrus was identified by first using the provided anatomical locations of each channel, which are registered to the Allen Mouse Brain Common Coordinate Framework ( and easily visualized with the QuickNII tool ( The QuickNII tool was used to generate images of electrode locations on coronal slices. Full probe tracks were visualized with the Brainrender graphical user interface ( The channel containing maximal positive spikes during immobility was identified visually and used for identifying spikes. Voltage signals from this channel were bandpass filtered (5–100 Hz) and peaks exceeding 4.5 standard deviations of this filtered signal were identified (4 s.d. was used for Moniz_2017-05-15). The timepoint at the maximum of each peak was considered the DS time and the filtered trace was used for amplitude and half-width quantification. To separate putative spikes into distinct types, we performed standard current source density (CSD) analysis ( on channels from the deepest dentate channel to the hippocampal fissure (channel with maximal theta amplitude), followed by principal components analysis on the normalized CSD profile, and then used DBSCAN to cluster the first two principal components into event types. Two clusters representing DS1 and DS2 reliably emerged with this approach. On average, 1.3 ± 0.3% detected spikes were outside these two clusters and were not investigated. Both principal components analysis and DBSCAN analysis were done using the Scikit-learn Python package (

For SWR detection, we performed detection as done previously21 and in agreement with consensus in the field37. Briefly, voltage signals from the CA1 pyramidal cell layer, determined from ripple and theta power by depth plots and visual inspection, were bandpass filtered (120–180 Hz) and the envelope was derived from the Hilbert transformation. Peaks in the envelope reaching five standard deviations and exceeding three standard deviations for at least 25 ms were included and the maximum positive value of the filtered trace is taken as the ripple time.

Neuropixel recording analysis

Timestamps for SPW-Rs, DS1 and DS2 were used to collect spiking activity of neurons from 200 ms before and after the event. The minority of events that include multiple event types within 200 ms were excluded from this analysis. Pupil diameter and locomotor speed aligned to each event type were only taken from the Allen Institute data, which permitted forwards and backwards locomotion (note the task-specific perpendicular orientation of the running wheel in the Steinmetz data) and avoided pupil-related changes due to screen illumination differences across the recording. Pupil and speed data in Fig. 1e,f are normalized to the maximum and minimum values observed across the entire session. Event rates and percentage coincidence were reported from Allen Institute data, but similar results were obtained from the Steinmetz data. For each unit, firing rates within an event were obtained by binning at 10 ms intervals over the 400 ms peri-event time, centred on DS peak or ripple envelope peak. Firing rates within an event were then standardized (z score) to each unit’s standard deviation and mean firing rate across the entire session, which was obtained from 100 ms bins and smoothed with a Gaussian filter (sigma value of five) as performed previously38. Peak firing rate changes were taken as the maximal z score from this peri-event firing rate. TORO cells were identified as previously described21. To determine the percentage of cells significantly modulated by each event type, peri-event spikes from each cell were randomly shuffled 100 times per event to generate a null distribution. Significant positive modulation was reported if the maximal firing rate bin exceeded the 99.5th percentile of the shuffled distribution. Cells exceeding this cutoff were then used to determine the relative timing of peak firing, averaged within a given brain area.

To identify time-points with high brain-wide firing rates, we binned all spiking activity, averaged across all cells, into 10 ms bins. We then collected timestamps for any peak in this averaged spiking activity that exceeded 99.9th percentile and plotted the event rates during immobility (less than 1 cm s−1) or wheel movement (greater than 1 cm s−1). We then examined the event-triggered average rate of occurrence for SPW-R, DS2 and DS1 aligned to these periods of high brain-wide firing and performed summary statistics on LFP events (that is, SPW-R, DS2 and DS1) falling within 60 ms of an identified high brain-wide firing event. TORO cells were identified as previously described.

To examine the occurrence of SPW-R, DS2 and DS1 aligned to auditory and visual stimulation, we used the Steinmetz dataset, which replayed task related auditory noises, including tone cues, white noise and clicking of the valve during reward delivery, as well as visual stimuli during a non-task period later in the session (that is, repeatedly played individually without the full behavioural paradigm and without reward to serve as a control).

To determine the percentage of each LFP event with significant increases in gaze movement, we used the Allen Institute data that reliably tracked changes in pupil position (that is, speed). For each event, we derived the change in pupil speed by subtracting the average pupil speed during and after (20 ms before to 85 ms after) from the pupil speed before the event (290 to 85 ms before). For facial movements, we performed the same analyses, but on Steinmetz data (note that there were no facial videos from Allen Institute) and used time windows of 40 to 115 ms after versus 140 to 40 ms before. Each event was randomly shuffled by ±2 s to derive a null distribution. Randomly shuffled events were pooled and the 97.5th percentile (two-sided, P < 0.05) was set as the cutoff for a significant increase in pupil or facial movements.

t-distributed stochastic neighbour embedding (t-SNE)39 was also used to visualize high-dimensional variability in spiking patterns across the brain in two-dimensional space, as it relates to facial or pupil movements. Peri-event firing rates from all cells across all events were reduced to an average firing rate (that is, averaged across the 400 ms peri-event time), normalized and embedded in t-SNE space (Perplexity 20). A change in pupil or facial movements were obtained for each event and normalized to visualize how motor movements couple to event types along the two t-SNE dimensions.

Mutual information

All data from the Steinmetz and Allen Brain Institute recordings were pooled for this analysis. Mutual information was computed using Python code adapted from the Neuroscience Information Theory Toolbox (, ref. 40). Briefly, spiking data from a ±200 ms time window around SPW-R or DS peaks were sorted into 5 ms bins and discretized into states using four uniform count bins for each brain region. The mutual information, defined by

$$\sum _{x\in {\bf{X}},\,y\in {\bf{Y}}}P(x,y){\log }_{2}\left(\frac{P(x,y)}{P(x)P(\,y)}\right),$$

where x and y represent spiking activity in different brain regions, P(x,y) is the joint distribution, and P(x) and P(y) are the marginal distributions, was then computed for each time bin. Baseline mutual information values, defined as the mean mutual information values from −200 to −100 ms relative to the event peaks, were subtracted to obtain Δmutual information for each brain region pair. Maximum Δmutual information values were used to construct the graphs using the NetworkX Python package ( To determine the significance of mutual information estimation, event trials were shuffled 5,000 times to obtain a null distribution and a Monte Carlo P value less than 0.01 was considered significant. Only brain region pairs with at least five sessions were included.

Two-photon imaging of AACs

Surgical procedures, two-photon imaging and analysis of AAC calcium were performed as described previously20. Briefly, adeno-associated viral (AAV) particles for the calcium indicators GCaMP6f (AAVDJ-CAMKII-GCaMP6f; UNC, deposited by K. Deisseroth)41 and jRGECO1a (AAV1-FLEX-jRGECO1a)42 were injected into three Unc5b-2A-CreERT2 mice (two females, one male) and surgically implanted with a 3 mm imaging cannula. pAAV.Syn.Flex.NES-jRGECO1a.WPRE.SV40 was a gift from D. Kim and the GENIE Project (Addgene viral prep no. 100853-AAV1; RRID:Addgene_100853). To induce Cre-dependent expression, mice were anaesthetized with isoflurane and injected intraperitoneally with tamoxifen (100 mg kg−1, Sigma) dissolved in corn oil (Sigma) at 20 mg ml−1 on days 2, 5 and 8 after virus injection. Following recovery, a 16-channel silicon probe (A1x16-3mm-50-177-H16_21mm, NeuroNexus) was inserted into the contralateral hemisphere under electrophysiological guidance to identify SPW-Rs and DSs during subsequent recordings. SPW-R and DS detection were performed as above (‘Neuropixel recording analysis’ section) and from voltage signals collected using the same recording system as discussed below (‘Place cell electrophysiological recordings from head-fixed mice’ section). Imaging data were collected at 15.49 frames per second on a two-photon microscope (Neurolabware) equipped with a ×16 objective (0.8 numerical aperture (NA), Nikon WI) using 1,000 nm excitation from a tuneable Ti:Sa laser (MaiTai, Spectra Physics) whereas locomotor movements were tracked with a rotary encoder equipped to a treadmill and facial movements were captured from a video camera (Mako, Allied Vision) and quantified by deriving the frame by frame motion energy map on a cropped region containing the face, as previously described20. Data were synchronized to the electrophysiological recording ( to align AAC calcium changes (jRGECO1a) and facial movements to DSs and SPW-Rs, or sensory stimulation events. In separate sessions, auditory tones (80 dB, 10 kHz, 0.35 s) and air puffs (five PSI, 0.1 s, delivered 5 cm from the face, 45° left of the nose), ten trials of each, were delivered in an alternating manner with a random interval between 15 and 45 s. Hardware delays were measured for each stimulus and used to accurately measure evoked DS latency. Motion correction was performed and regions of interest were detected using SIMA43. Unc5b-AAC regions of interest were segmented using the STICA method in SIMA43, and cells that were not detected by this step were manually added by drawing a region around the soma. Other neurons in the pyramidal layer (putative pyramidal cells) were segmented using the PlaneCA1PC method of SIMA. ΔF/F traces were computed using a third-order polynomial fit as the time-dependent baseline. Calcium changes (ΔF/F) for sensory stimulation or electrophysiological events were reported as mean z-scores across events and/or trials and cells, using the preceding 1 s of data for standardization.

Place cell electrophysiological recordings from head-fixed mice

Seven mice (five females, two males) on a C57BL/6J background were implanted with metal head bars on their skulls using Super Glue and dental cement. Two coordinates were marked with black ink on the skull for craniotomies later (−2 mm anteroposterior and ±2 mm mediolateral relative to bregma). After 1 week of recovery, mice were head restrained on a linear treadmill for at least three 10 min daily sessions until they were comfortable enough to initiate movement spontaneously on the track. On the day before the acute recording experiment, craniotomies were performed near the marked coordinates. Cranial windows were then sealed with silicone (Kwik-Cast, WPI) whenever mice were not in a recording experiment. On the day of acute recording experiment, silicone was removed from awake head-restrained mice and the exposed cranial windows were filled with saline. Micromanipulators (MPC-200, Sutter Instruments) were used to slowly lower silicon probes with 32 (A1x32-6mm-50-177, NeuroNexus) or 128 channels (128J, UCLA probe44 into the right dentate gyrus and left CA1, respectively. The recording sites were confirmed by the presence of DS and SPW-R. Raw signals were amplified and digitized at 30 kHz by Intan headstages connected to an open ephys acquisition system ( Spikes from single units were sorted using Kilosort (, followed by manual curation in Phy2 ( Treadmill movement was determined by a quadrature rotary encoder on one of the axles of the two wheels supporting a fabric belt. Each lap was detected when a neodymium magnet on a fabric belt passed through a hall sensor (KY-003, MXRS) fixed on a treadmill. Rotations and magnetic signals were recorded by analogue to digital converters and synchronized with electrophysiological recordings. In three mice, random air puff or tone presentations, as in the ‘Two-photon imaging of AACs’ section, were delivered at 10 s intervals.

Bilateral SPW-R and DS recordings

Surgical procedures, as in the ‘Place cell electrophysiological recordings from head-fixed mice’ section, were performed on five mice (three females, two males). Two linear probes (A1x32-6mm-50-177, NeuroNexus) were slowly inserted into each hippocampus until DSs were visually identified. Then 30 min recordings were obtained from mice as they behaved on a floating Styrofoam ball. Bilaterally occurring SPW-Rs and DSs were considered synchronous if they occurred within 100 ms. The reference probe was the probe with fewer SPW-Rs or DSs. A subsequent 10 min recording was obtained during random air puff or tone presentation, as in the ‘Two-photon imaging of AACs’ section, at 10 s intervals. Movement of the Styrofoam ball as previously described38 was used to identify periods of locomotion and immobility (0.5 cm s−1 cutoff) by taking the average ball speed 1 s before tone and/or puff onset.

Bayesian decoding of position

A Bayesian decoding algorithm was implemented to translate ensemble spiking activity near SPW-R and DS2 into angular positions on the treadmill45. Position information on the 120-cm-long treadmill was discretized into 5 cm bins. The probability of a mouse being at location x, given the number of spikes from each unit recorded in a 20 ms time window, was estimated by Bayes’ rule: P(x|n) = (P(n|x) × P(x))/(P(n)), where P(n|x) was approximated from the position tuning of each place unit under the assumption that the number of spikes from each unit followed a Poisson distribution and the position tuning of individual units was statistically independent. Previous knowledge of position, P(x), was set to 1 to prevent decoding bias to any position on the treadmill. The normalizing constant, P(n), was set to ensure the sum of posterior probability, or P(x|n), equal to 1. The position bin with the highest probability was taken as the decoded position. A decoding error was the distance between decoded and actual positions. To determine whether any decoding error bin was over-represented, decoded positions were circularly shifted with random values drawn from −60 to 60 for 1,000 times. From each shuffling iteration, the maximum proportion of decoding error distribution was taken to determine global significance level. Any decoding error bins with proportion above the 97.5th percentile of the shuffled maximum proportions (7.7 and 8.4% for SPW-R and DS2, respectively) were considered over-represented. To detect candidate replay sequence events during SPW-R and DS, smoothed multi-unit activity (MUA) in successive 1 ms time window had to exceed mean MUA. MUA was smoothed by convolving the raw spike count with a 21 ms Hanning window. To remove smoothing artefact, event boundary was adjusted inwards so that at least one spike was included in the first and last time bins. Candidate events with duration less than 50 ms or more than 2 s were excluded from further analysis. Next, ensemble activity within each candidate event was decoded using the Bayesian method mentioned above in a sliding 20 ms time window that shifted 5 ms at each step. Slopes of decoded trajectories were estimated by performing a circular-linear regression on the posterior probability distribution46. Slopes with goodness-of-fit (R2) values of less than 0.3 were excluded. Bayesian decoding analyses were performed using custom codes written in Python.

Decoding of stimulus identity for evoked DS2

A perceptron was trained to classify DS2 events (evoked versus spontaneous or tone versus air puff) on the basis of firing rate vectors of place cells using Scikit-learn Python package ( Stratified tenfold cross validation (‘StratifiedKFold’ function) was performed on the dataset. To evaluate the significance of an accuracy score for the original data, a permutation test (‘permutation_test_score’ function) shuffling the identity of sensory stimuli for 1,000 times was used to generate a null distribution of accuracy scores. An empirical P value was then calculated as the percentage of permutations for which the score obtained was greater that the score obtained using the original data.

Similarity analysis of brain-wide ensembles during DS2

Population activity vectors were defined by the number of action potentials from each unit within a 200 ms time window centred at the peak of each DS2 event and normalized by the maximum number of action potentials within each unit. Units with mean firing rate above 5 Hz or without any action potentials during DS2 were excluded from this analysis. Pearson’s correlation coefficients and cosine similarity were then computed for all pairs of normalized population vectors during DS2. To arrange units and DS2 events on the basis of similarity of their activity pattern, agglomerative hierarchical clustering algorithm with a Euclidean distance metric and the Ward variance minimization linkage method was implemented using Scipy Python package ( Statistical significances of Pearson’s correlation coefficients and cosine similarity between pairs of population vectors were assessed by shuffling DS2 indices within each unit.

Real-time place preference task

Twenty C57BL6/J mice (nine females, 11 males) with ages ranging from 3 to 4 months old were used at the time of behavioural testing. To broadly silence network activity, we targeted an excitatory opsin to GABAergic cells. To this end, mice first received stereotactic injection of 400 nl of pAAV-mDlx-ChR2-mCherry bilaterally (−2.3 mm anteroposterior, ±1.5 mm mediolateral, −2 mm dorsoventral relative to bregma), followed by implantation of 200-μm-core-diameter optic fibres (−2.3 mm anteroposterior, ±1.5 mm mediolateral, −1.6 mm dorsoventral relative to bregma). The implanted mice were given at least 2 weeks for recovery and virus expression. To acclimate mice to movement with overhanging fibres before behaviour testing, they were trained to freely explore a clear acrylic behaviour box (32 × 22.5 × 22.5 cm) with optic fibres attached for at least three 20 min daily sessions. On the day of behaviour testing, mice were placed in a white opaque acrylic behaviour box (31 × 24.5 × 22 cm) with a black opaque barrier (21.5 × 19 × 3 cm) partially separating the box into two compartments. To make the two compartments visually distinctive, one compartment’s side wall was decorated with vertical stripes using black tape and the other compartment’s side wall was left blank. To establish a baseline preference for each compartment, mice were free to explore both compartments without any experimental intervention for the first 10 min. During the subsequent 10 min, a loud tone (80 dB, 10 kHz, 350 ms) was played from a niobium speaker (Power Acoustik) placed in the behaviour box every 10 s whenever mice entered the stimulation compartment. A blue laser (5 mW, 80 ms, 430–490 nm) was delivered following the onsets of tones with time delays of 0 and 250 ms for mice in the experimental and control groups, respectively. The head position of mice was tracked in real-time using an overhead web camera (Logitech, 30 frames per s) running custom scripts on Bonsai ( with a pretrained model from DeepLabCut ( Once the mouse’s head entered the stimulation compartment, the custom Bonsai program delivered transistor–transistor logic (TTL) signals to an Arduino microcontroller ( to trigger tones and the laser. In separate experiments, three more mice underwent procedures similar to Bilateral SPW-R and DS recordings, but an optrode (A1x32-Poly3-10mm-50-177 with 105-μm-core-diameter optical fibre from Neuronexus) was lowered into the hippocampus instead of a linear probe. Light was delivered as above to determine whether evoked DS2 could be silenced.

Electrophysiological recordings from head-fixed mice during silencing of evoked DS2

Surgical procedures described in the ‘Real-time place preference task’ section were performed on five female mice, except only the left hemisphere received optic fibre implant targeting the dentate gyrus. Furthermore, dentate gyrus (−2.3 mm anteroposterior, +1.5 mm mediolateral relative to bregma) and M2 (+0.5 to +1.5 mm anteroposterior, +0.7 mm mediolateral relative to bregma) coordinates were marked for subsequent acute recordings. A four-shanks NeuroNexus silicon probe with a 200 μm core and 0.5 NA optic fibre attached (A4x32-Poly2-5mm-20s-150-160-OAC128) was inserted into dentate gyrus or M2 in separated recording sessions when the mice were head restrained on a cued linear treadmill. A loud tone (80 dB, 10 kHz, 0.35 s) or air puff (five PSI, 0.5 s) directed to each mouse’s body was presented with or without blue laser (5 mW, 80 ms, 430–490 nm) delivered to both hemispheres at 0.1 Hz. Spike sorting was performed as described in the ‘Place cell electrophysiological recordings from head-fixed mice’ section. Probe locations were verified post hoc by Dil staining on 60 μm coronal brain sections.


All statistical tests were performed using Python and can be found in the figure legends, unless otherwise stated. For analysis of variance (ANOVA), post hoc P values were adjusted for multiple comparisons.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

Source link


Leave a Reply

Your email address will not be published. Required fields are marked *