May 6, 2024
A cell-type-specific error-correction signal in the posterior parietal cortex – Nature

A cell-type-specific error-correction signal in the posterior parietal cortex – Nature

Mice

All of the experimental procedures were approved by the Harvard Medical School Institutional Animal Care and Use Committee. The following mouse lines were used: Gad2-cre (Jax, 010802), Sun1-GFP (Jax, 021039), C57Bl/6J (Jax, 000664), Sst-cre (Jax, 013044)32 and Ai14 (Jax, 007914)33. Mice were housed under a reversed 12 h–12 h light–dark light cycle. Sample sizes were chosen on the basis of previous similar experiments. Trial types were randomly interleaved. Blinding is not relevant because comparisons were made within animals or samples.

Viruses

pAAV2-Sst44-mTagBFP2 (pAAV2-2xSV40pA-Sst44-CMVminP-NLS-Flag-mTagBFP2-NLS-WPRE-SV40pA), pAAV2-A2-Sst44-mTagBFP2 (pAAV2-A2-2xSV40pA-Sst44-CMVminP-NLS-Flag-mTagBFP2-NLS-WPRE-SV40pA-A2) and pAAV2-A2-syn-jGCaMP7f (pAAV2-A2-syn-jGCaMP7f-WPRE-SV40pA-A2) were cloned in-house and verified by Sanger sequencing using Genewiz. The A2 insulator34 was added in the last two constructs to test its effect on cell type specificity, but we observed similar specificity in both cases. pAAV2-syn-DIO-ChRmine-mScarlet (pAAV2/9-hSyn-DIO-ChRmine-mScarlet-Kv2.1-WPRE-hGHpA) was made by GenScript. pAAV2-Sst44-stGtACR2-mNeonGreen (pAAV2-2xSV40pA-Sst44-CMVminP-GtACR2-mNeonGreen-ST-WPRE-SV40pA) was cloned, packaged with AAV9 and titred by Vigene. AAV9-packaged syn-jGCaMP7f was obtained from Addgene (104488). Other custom constructs were packaged with AAV9 and titred by qPCR by the Boston Children’s Hospital Viral Core. All viruses were diluted in PBS to the final titre indicated in each experiment.

Single-cell ATAC-seq

Nucleus isolation

For nucleus isolation for single-cell ATAC analysis35, we used two Gad2-cre+/−;Sun1-GFP+/− female mice to isolate inhibitory neurons expressing SUN1–GFP on the nuclear membrane. This selection yielded higher-resolution cell type information from inhibitory neurons, which are numerically underrepresented in single-nucleus isolation protocols without enrichment procedures. Nuclei were isolated as previously described6,36, with modifications for fluorescence-activate cell sorting (FACS). The posterior cortex (around 3 mm by 3 mm centred on PPC) was dissected in ice-cold choline solution (2.1 g l−1 NaHCO3, 2.16 g l−1 glucose, 0.172 g l−1 NaH2PO4·H2O, 7.5 mM MgCl2·6H2O, 2.5 mM KCl, 10 mM HEPES, 15.36 g l−1 choline chloride, 2.3 g l−1 ascorbic acid, 0.34 g l−1 pyruvic acid), and transferred to a Dounce homogenizer containing homogenization buffer (0.25 M sucrose, 25 mM KCl, 5 mM MgCl2, 20 mM Tricine-KOH, pH 7.8, 1 mM DTT, 0.15 mM spermine, 0.5 mM spermidine and protease inhibitors). The tissue was dounced with a tight pestle until it was well homogenized (10–15 strokes). IGEPAL (final 0.15%) was added, followed by 5–10 more strokes. The homogenate was passed through a 40 µm filter. Tween-20 (final 0.1%) and BSA (final 1%) were added to the filtrate. Nuclei were centrifuged at 500g for 5 min at 4 °C and resuspended in 0.5 ml wash buffer (10 mM Tris-HCl pH 7.4, 10 mM NaCl, 3 mM MgCl2, 1% BSA, 0.1% Tween-20). Nuclei from each sample were sorted by FACS (Sony, SH800Z) based on the SUN1–GFP signal into two wells in a cooled 96-well plate coated with wash buffer. We used a 96-well plate because the sorted volume was small. After sorting, the plate was centrifuged at 500g for 5 min at 4 °C, and the nuclei were resuspended in 20 µl of Wash Buffer.

Library preparation and sequencing

Approximately 15,000 nuclei from each sample were combined with the transposition mix (10x Genomics), and the manufacturer’s protocol for single-cell ATAC (10x Genomics, CG000168 Rev A) was followed, using one Chromium Controller (10x Genomics) lane per sample for cell barcoding. The libraries were sequenced on the NextSeq 500 DNA sequencer (Illumina).

Data pre-processing and analysis

Reads were mapped to the mouse genome (mm10), and cell barcodes were processed using the Cell Ranger pipeline (10x Genomics) using the default parameters. We used SnapATAC37 (v.1.0.0) to further process the data, including binning mapped reads across the genome into 5,000 bp bins, filtering barcodes on the basis of the number of unique fragments (1,000–100,000) and the fraction of reads in promoters (0.1–0.6), performing dimensionality reduction (30 dimensions) on the normalized Jaccard similarity matrix and constructing a k-nearest-neighbour graph (k = 0.5 × √(number of barcodes)) (see the SnapATAC pipeline for a complete description). Following published multiplet detection algorithms38,39, we simulated doublets, triplets and quadruplets by summing random combinations of cells and removed cells on the basis of their multiplet score, defined as the fraction of nearest neighbours that were simulated multiplets (higher multiplet score indicates higher likelihood that the cell is not a singlet). We chose a multiplet score threshold based on the trough in their distribution and based on whether cells above this threshold tended to have higher fragment counts. We repeated this process a total of two times since we observed a large fraction of multiplets in the first round, which was consistent with nucleus clumping after FACS.

After removing cells that were not inhibitory neurons based on the accessibility of marker genes, our dataset included 10,375 inhibitory neurons with an average of 12,594 fragments per cell. Although stringent, this process significantly cleaned up the data and revealed all five inhibitory neuron classes (Sst, Pvalb, Vip, Lamp5 and Sncg; Extended Data Fig. 1a), with high enough resolution to distinguish precise cell types within these classes. We repeated dimensionality reduction (n = 24) and the construction of the k-nearest neighbour graph (k = 15) after this selection. We clustered cell types using the Leiden algorithm40 (resolution = 0.7) and visualized cell type clusters with UMAP41 (default parameters within SnapATAC).

Imaging native fluorescence with in situ RNA hybridization

Surgeries

We injected four C57BL/6J mice bilaterally for a total of eight injected hemispheres. In each hemisphere, four injections were made 0.5 mm apart in a grid in the PPC (centred at 1.7 mm lateral and 2.0 mm posterior to bregma) at depths of 0.20 and 0.70 mm below the dura. Each injection was approximately 65 nl of AAV2/9-Sst44-mTagBFP2 diluted to 5 × 1011 GC per ml in PBS. We considered each unilateral grid of injections to be one replicate.

Sample preparation

Mice were perfused with PBS and 4% paraformadehyde (PFA) approximately 2 weeks (13–16 days) after injections. The brains were post-fixed in 4% PFA at 4 °C overnight before sectioning 50 µm coronal slices on a vibratome (Leica, VT1000S). The slices were stored in antifreeze solution (40% 1× PBS, 30% ethylene glycol, 30% glycerol) at −20 °C for up to 2 months.

Dual imaging of native fluorescence and RNA hybridization overview

To combine mTagBFP242 and RNAScope (ACDBio) imaging, we first imaged mTagBFP2 native fluorescence, then performed RNAScope analysis of the same slices, and imaged the RNA signal in the same area. This protocol enabled us to combine native fluorescence and RNA labelling, as the RNA labelling protocol involves a protein-degradation step.

Imaging native fluorescence

Slices were washed three times with 0.3% Triton X-100 in PBS (PBS-T) to permeabilize cell membranes before applying DRAQ7 (Abcam, ab109202) nuclear stain 1:500 in PBS-T for 7 min at room temperature. Slices containing injection sites were washed in PBS and then mounted onto Superfrost Plus glass slides (Thermo Fisher Scientific, 12-550-15) with a glass coverslip secured using ProLong Gold Antifade Mountant (Invitrogen, P36934).

Images of the injection sites were acquired using the Olympus FV1000 Confocal Microscope with a 0.4 NA ×10 air objective (Harvard Medical School Neurobiology Imaging Facility) and encompassed an area of 1,272 µm by 1,272 µm. The slides were stored in 5× saline sodium citrate at room temperature overnight.

In situ hybridization using RNAScope

After gently sliding off the coverslips in 5× saline sodium citrate, the slides were washed in PBS then dried thoroughly. Tissue pretreatment and in situ hybridization was performed according to the protocol delineated by RNAScope Fluorescent Multiplex Reagent Kit v2 (ACDBio, 323110) for fixed-frozen tissue with the following modifications. After baking, the slices were fixed in 4% PFA in PBS for 30 min at 4 °C. To minimize tissue warping, hydrogen peroxide (ACDBio, 322381) incubation was limited to 5 min and target retrieval (ACDBio, 322000) was brought to a boil but then allowed to cool until boiling had stopped before submerging the slides for 15 min. Finally, the slices were incubated with Protease IV (ACDBio, 322336) for 15 min at 40 °C.

We used the following RNA probes manufactured by ACDBio: Sst (404631-C3), Hpse (412251-C2), Chodl (450211-C2), Calb2 (313641) and Crh (316091-C2). The fluorophores Cyanine 3 Amplification Reagent (FP1170) and Fluorescein Amplification Reagent (FP1168) from PerkinElmer were diluted in TSA Buffer (ACDBio, 322810) at the following concentrations: Fluorescein 1:1,500 for Sst; Cyanine 3 1:375 for Hpse, Chodl and Calb2; and Cyanine 3 1:190 for Crh. We also performed experiments using the Nr2f2 probe and other gene markers for the Nr2f2+ Sst cell cluster but could not extract a reliable signal, and therefore do not show these results here.

After in situ hybridization, the slices were incubated with DRAQ7 1:25 in PBS-T for 10 min at room temperature and washed briefly in distilled water. Excess liquid was removed from the slides before securing the coverslips with ProLong Gold Antifade Mountant. Images were taken of the same area as the native fluorescence image by aligning the two using the DRAQ7 nuclear dye.

Image registration and processing

A registration matrix was computed based on the common DRAQ7 nuclear channels taken before and after RNAScope analysis of each slice using either the ACDBio HiPlex Registration software or by manually selecting control points (25–70 pairs) to compute a local weighted mean transformation in MATLAB. These registration matrices were applied to each channel in the RNAScope images.

We trained two Cellpose43 models to segment NLS–mTagBFP2-labelled nuclei and Sst-RNA-labelled cells. Masks generated by these Cellpose models were excluded from analysis if they had an area of less than 75 pixels for BFP masks and less than 100 pixels for Sst masks to eliminate the background noise, and if they were located below cortex. We also excluded BFP masks in regions that did not overlap with the RNAScope image. BFP and Sst masks with a Pearson’s spatial correlation of less than 0.16 between DRAQ7 nuclear channels in images taken before and after RNAScope for an area of 50 × 50 pixels around the centre of the masks were also excluded from the analysis.

We used Fiji44 to generate the images in each figure.

Analysis of cell types and depth distribution

To define Sst-positive BFP-labelled cells, we mapped BFP masks to Sst masks. A BFP mask was assigned as an Sst cell if it had at least 50% overlap with that Sst mask.

We used the Sst masks to define the intensity of each Sst subtype marker, calculated as the mean intensity inside the Sst mask. Cells were considered to be positive if the intensity was greater than 1.5× the 5th percentile of cell means (used as an estimate of background intensity) in each image.

Cells were considered to be BFP+ if the BFP intensity was greater than 15% of the average intensity of the three brightest BFP masks from each image. For determining the percentage of subtype cells that are BFP+, images were used only if they contained at least ten BFP+ cells. For the percentage of BFP+ cells that were subtype positive, injections (which could include multiple images) were only used if they contained at least ten BFP+ cells across slices.

A line along the pia was drawn manually in Fiji ImageJ for each image. Cell depth was defined as the vertical distance from this line to the centre of a BFP or Sst mask.

To analyse the specificity of the Sst-cre line in the PPC, we counted the overlap between Sst-cre cells expressing tdTomato and the Sst probe using RNAScope.

Surgeries for in vivo experiments

Surgeries were performed at 8–12 weeks old. Mice were injected with dexamethasone (2 mg per kg) 1–6 h before surgery. A titanium headplate was fixed to the skull with dental cement (Metabond, Parkell) mixed with carbon powder to prevent light contamination, centred on (−1.7, −2 mm, medial–lateral (ML) and anterior–posterior (AP) axes, respectively, from bregma), on the left side. A 3.5 mm diameter craniotomy was performed centred on (−1.7 (ML), −2 mm (AP)). Virus was injected at nine sites, at 0.25 mm below the dura: four centred on (−1.7 (ML), −2 mm (AP)) spaced by 0.3–0.4 mm targeting the PPC, two centred on (−0.8 (ML), −2 mm (AP)) spaced along the anterior–posterior axis by 0.3–0.4 mm targeting the RSC, and three at (−2.3 (ML), −2.6 mm (AP)), (−1.9 (ML), −2.6 mm (AP)) and (−2.7 (ML), −3 mm (AP)) targeting the visual cortex and the surrounding visual areas. The last three injections were used only for retinotopic mapping. For each injection, a bevelled glass pipette was inserted 50 µm past the desired depth, and then retreated to the correct depth. Approximately 65 nl was injected over 3 min, after which we waited 3 min to allow the pressure to equilibrate before retracting the pipette. After a durotomy, a cranial window, consisting of two 3-mm-diameter coverslips and one 4-mm-diameter coverslip (#1 thickness, Warner Instruments) bonded using ultraviolet-curable optical adhesive (Norland Optics, NOA81), was inserted. An aluminium ring was cemented onto the titanium headplate as an adapter for preventing light contamination.

The headplate was mounted approximately parallel to the tangent plane of the left PPC. This meant that the mouse’s head was tilted slightly to the right for all of the experiments. This tilt probably contributes to the behavioural bias of the mice to have more course corrections for rightward deviations (Extended Data Fig. 7j,k).

For imaging experiments, we used Sst-cre+/−;Ai14+/− male mice to label Sst cells with tdTomato. We injected and trained five cohorts of mice. Imaging cohort 1 (7 mice) was used for imaging activity in the PPC (3, 4, 5, 7, 3, 3, 2 sessions per animal, 27 sessions total) and the RSC (4, 2, 4, 6, 3, 1, 3 sessions per animal, 23 sessions total). Imaging cohort 2 (8 mice) was used for imaging activity in the PPC during heading perturbations (2, 2, 3, 2, 2, 1, 2, 2 sessions per animal, 16 sessions total). We used 2 mice from cohorts 1 and 2 (4 mice total, 1, 1, 2, 2 sessions per mouse, 6 sessions total) for the reward-omission experiments. Imaging cohort 3 (6 mice) was used for imaging activity in the PPC during training before high-accuracy performance (2, 2, 2, 2, 2, 1 sessions per animal, 11 sessions total). Imaging cohort 4 (7 mice) was used for training on the cue switch (6, 5, 6, 6, 8, 7, 7 sessions per animal, 45 sessions total). Imaging cohort 5 (5 mice) was trained on a linear maze, which we used for the playback experiments (3, 3, 3, 4, 3 sessions per animal, 16 sessions total). The virus mixture consisted of AAV2/9-syn-jGCaMP7f (6.25 × 1011 GC per ml) and AAV2/9-Sst44-mTagBFP2 (5 × 1011 GC per ml) in all mice, except one mouse in cohort 1, in which we injected a mixture of AAV2/9-A2-syn-jGCaMP7f (9.4 × 1011 GC per ml) and AAV2/9-A2-Sst44-mTagBFP2 (1 × 1011 GC per ml). The only difference here is the addition of the A2 insulator34, which we added to test its effect on specificity. Given that we did not observe a difference in specificity (Fig. 2d), we pooled the data together.

For photostimulation experiments, we injected and trained Sst-cre+/− male mice (Sst-cre+/+ crossed to C57Bl/6J; 4 mice; 5, 3, 7, 5 sessions per mouse, 20 sessions total). The virus mixture consisted of AAV2/9-syn-jGCaMP7f (6.25 × 1011 GC per ml), AAV2/9-Sst44-mTagBFP2 (5 × 1011 GC per ml) and AAV2/9-syn-DIO-ChRmine-mScarlet (5 × 1011 GC per ml).

Behavioural training

Behavioural set-up

We used a miniaturized virtual reality system, as described previously45. Head-fixed mice ran on an air-supported 8-inch-diameter Styrofoam ball. Ball velocities were tracked by two optical sensors (ADNS-9800, Avago Technologies) and digitized (USB-6003, National Instruments). The ball’s pitch and yaw velocity were used to control the mouse’s forward movement and heading velocity (view angle), respectively, in a virtual environment that was projected on a parabolic screen covering ~180°. Light exiting the laser projector (PicoBit laser projector, 60 Hz, Celluon) was dimmed with a neutral density filter (NE10B-A, Thorlabs) and short-pass filtered (550 nm cut-off, FES0550, Thorlabs), which helped to improve the mouse’s behaviour and minimize light contamination during imaging. The rewards were delivered through a metal spout, controlled by a solenoid valve, and consisted of 0.15 g per 100 ml acesulfame potassium (Prescribed For Life; an artificial sweetener) in tap water.

We constructed two training rigs, plus one rig that was used for imaging, and one rig that was used for photostimulation experiments. The rigs were made to be as identical as possible to each other. The head plate was positioned 1 inch behind the centre of the ball, with a distance 1 inch above the ball, and at the horizontal and vertical centre of the visual display. Mice were typically initially trained on the training rigs and then transferred to either the imaging or photostimulation rig.

Virtual environment and training

Starting 3 days before training, mice were given 1 ml total water per day, including rewards received during training. We monitored their body weight, and further supplemented with water to ensure it was above 75% of their pre-training weight. The virtual environment was generated by Virtual Reality Mouse Engine (ViRMEn)46 in MATLAB (MathWorks). The environment consisted of a T-maze with a white or black cue on the walls, as previously described1. Once the mouse entered 9 cm into either arm, the trial ended. The mouse was then rewarded for turning left if a black cue was presented, and for turning right if a white cue was presented. After the trial ended, we displayed a dark screen during an intertrial interval of 3 s for correct trials and 7 s for incorrect trials, after which the mouse started at the start of a new, randomly chosen T-maze. Mice started in a short maze (~64 cm long, or 1 ball rotation) in which a tower at the end of the maze indicated the location of the reward, in addition to the cue on the walls. Once mice started to perform well on this maze, they were advanced to longer mazes (113 cm and 225 cm) that required better ball control for them to smoothly navigate to the end. Once they performed with high accuracy, a tower was added on both sides at the end of the T-maze, such that the mice could no longer run towards the tower but had to navigate based on the cue on the walls. We included crutch trials, in which one reward-locating tower was still present, as mice transitioned to this maze. Once proficient on the maze with two towers, a delay maze segment was added in between the cue and the T-junction. The delay maze segment was grey and had a different texture than the reward-associated white or black cue. The delay was introduced as a short segment at the end of the maze and was gradually lengthened to 27% or 50% of the maze length. If the mice displayed a strong bias for turning left or right, we implemented bias correction by setting the probability of a right-rewarded maze as one minus the fraction of trials where the mouse turned right on the last 20 trials.

For the heading perturbation experiments, we added a bias to the mouse’s virtual heading velocity triggered when the mouse passed the halfway mark in the maze, on 30% of trials. Left and right virtual rotations occurred with 50% probability each. The added bias varied with a Gaussian profile (mu = 1.5 s, sigma = 0.375 s, peak = 0.03 rad s−1), resulting in a rotation of 103° over 3 s (peak velocity at 1.5 s) if the mouse did not correct. Note that this perturbation does not result in a pure open loop rotation but, rather, adds a bias on top of the normal closed-loop configuration. In other words, the mouse can still compensate for the perturbation by turning on the ball. We also note that we initially tried jumping the mouse’s heading instantaneously, rather than in this smooth manner, but this tended to activate the entire circuit in a cell-type-independent manner, which made it more difficult to isolate the Sst44-cell-specific response.

For training mice on the cue-switch experiments, we first trained mice to perform the T-maze with the delay with high accuracy (>85% correct trials). We then imaged mice in a T-maze where on 50% of trials, the visual cue was changed at the halfway point in the maze (for one mouse, we changed the cue in the last quarter of the maze; data are always aligned to the cue switch location), either from black to white or from white to black. The change in cue was visible as the mouse approached it. The rewarded location changed along with the cue. Thus, the mice had to learn to change trajectory based on the second cue to receive a reward. The other 50% of trials were control trials in which the cue was constant, as in the original maze. There was no delay on any trial for this experiment.

For training mice on a linear track, the linear track consisted of a corridor of the same length as the first training T-maze (64 cm long). Mice received a reward at the end of the maze. Trials were also separated by an intertrial interval during which we displayed a dark screen. We trained the mice until they performed at least one trial per minute before performing open-loop playback experiments.

Widefield imaging for retinotopic mapping

We performed widefield epifluorescence imaging of jGCaMP7f47 to generate a retinotopic map that was used to determine the two-photon imaging field of view for the PPC as previously described48. In brief, we excited jGCaMP7f with blue light (452–486 nm band-pass filtered, Thorlabs) and filtered green emitted light (505–545 nm band-pass filtered, Thorlabs) that was imaged with a CMOS camera (acA1920-155um, Basler) with a field of view covering the entire cranial window. Mice were anaesthetized under 1% isoflurane. Visual stimuli were coded with Psychtoolbox (MATLAB, MathWorks), presented on a 27 inch monitor, and consisted of a spherically corrected bar 12.5° in width moving at 10° s−1 horizontally or vertically in either direction. The bar was patterned with a 3 Hz alternating black and white checkered pattern. Data were processed as previously described49,50 using a temporal Fourier transform to extract responses to horizontal and vertical bar positions (since visual stimuli were presented periodically in time), creating horizontal and vertical response maps. The field sign was computed as the sine of the angle between the gradient of the horizontal and vertical maps. Fields of view for the PPC were centred approximately at (−1.7 (ML), −2 mm (AP) from bregma) as in previous studies48,51.

Two-photon imaging

Microscope design

We collected in vivo imaging data on a custom built two-photon scanning microscope with a ×16/0.8 NA water-immersion objective with a 3 mm working distance (Nikon) and a tunable femtosecond-pulsed laser (Chameleon Vision S, Coherent). The beam was scanned with a resonant and galvanometric mirror pair (Cambridge Technology) relayed with two scan lenses, scanning a 650 µm by 650 µm field of view at a resolution of 512 × 512 pixels at 30 frames per second for one plane (see the acquisition parameters specific to each experiment below). We imaged layer 2/3 at a depth of 100–250 µm below the pia. Green and red light were split with a 580 nm dichroic beamsplitter (FF580-FDi01-55×73, Semrock), and band-pass filtered (green, 500–550 nm, FF03-5525/50-50, Semrock; red, 604–679 nm, FF01-641/75-50, Semrock). Blue and green light were split with a 484 nm dichroic beamsplitter (FF484-FDi01-55×73, Semrock), and band-pass filtered (blue, 425–465 nm, FF01-445/40-50, Semrock; green, 500–550 nm, FF03-5525/50-50, Semrock). Emitted light was detected with GaAsP photomultiplier tubes (Hamamatsu). The microscope was controlled with ScanImage 2018b (Vidrio). The mouse and ball set-up were placed onto a three-axis stage (Dover) to position the mouse and the field of view. We shielded light leak from the arena and other sources with a cutout black rubber balloon sealing the objective with the aluminium ring mounted onto the headplate.

Data acquisition

Imaging data were acquired using ScanImage. Virtual environment data were acquired using ViRMEn. ScanImage and ViRMEn data were synchronized by acquiring triggers on a Digidata analogue to digital converter (Axon Instruments), which was also used to collect raw ball velocities. ViRMEn data were downsampled to the imaging volume rate using the nearest point in time.

For each session, we collected a reference image at the surface of the brain to align across days along the anterior–posterior and medial–lateral axis. We collected a second reference image to align in depth, both across days and to compensate for axial drift over the course of the session. We collected continuous imaging data over the entire behavioural session, typically lasting 50 min.

For imaging experiments, we collected volumes of three planes spaced by 30 µm at 7.5 Hz (one frame blank for flyback), by scanning the objective with a piezo motor (Physik Instrumente). We collected imaging data from the same volume over days for each region in each mouse. jGCaMP7f47 and tdTomato were imaged together during the behavioural session with 920 nm or 950 nm excitation (40–70 mW). After an imaging session, mTagBFP242 and jGCaMP7f were imaged with 850 nm excitation (60 mW).

For photostimulation experiments, we collected data from a single plane at 30 Hz. For each field of view (including different depths), we collected a paired dataset of imaging only on the first day and photostimulation on the second day. We imaged jGCaMP7f alone at 920 nm excitation (40 mW), to minimize excitation of ChRmine52. ChRmine-mScarlet53 intensity was too weak to image under these conditions, so after the session we took a second image of jGCaMP7f and ChRmine-mScarlet with 980–1,000 nm excitation (40 mW), and a third image of jGCaMP7f and mTagBFP2 with 850 nm excitation (60 mW).

Imaging data preprocessing

Frames were motion-corrected as previously described23, the code for which is available at GitHub (https://github.com/HarveyLab/Acquisition2P_class). Raw fluorescence from sources was extracted with Suite2p54. Fluorescence traces were baseline-subtracted, with the baseline estimated on a rolling basis (Suite2p baseline=maximin, win_baseline=60, sig_baseline=10), and deconvolved with OASIS55 (decay constant initialized to 0.8 s and optimized for each source) as previously described23.

For each channel, we computed the mean image after motion correction. All channels were registered to a common reference image using the green channel in the main imaging session. As the blue channel was dim, and sometimes contained bleed through from the green channel, we demixed the blue channel by estimating the baseline contribution from the green channel. We selected pixels with a green value that was greater than 50% of the maximum green value, and from these selected pixels in the lower 50th percentile of blue values, to select pixels with baseline blue values and extreme green values. After adding in zeros (20% of points) to estimate a line going through the origin, we performed a linear regression on these points, and subtracted this regression from the blue values. We performed the same process to demix green bleed through from the red channel in photostimulation experiments, where the red intensity was relatively low.

We used Fiji44 to generate the images in each figure.

Two-photon photostimulation

Microscope design

Influence mapping experiments were performed as the mouse performed the T-maze task with a delay on a microscope separate from the imaging experiments that was also equipped with a virtual reality set-up. The imaging path was as described in ‘Two-photon imaging’. An independent photostimulation path with a spatial light modulator (SLM) in series with two galvos was used to excite ChRmine using a 1,060 nm laser (repetition rate, 2 MHz, Spark). The power was modulated using a Pockels cell (M350-105BK-02 DRY with 1,060 nm AR coatings for high power, Conoptics). A reflective SLM (HSP-1920-1064) was installed, and the beam was expanded to fill its short axis. Beam polarization was rotated using a half-wave plate (WPH10M-1064, Thorlabs) to maximize diffraction efficiency. The surface of the SLM was imaged onto a 3 mm galvo (6210H, Cambridge) using a telescope (ACT508-400-B and ACT508-100-B, Thorlabs), and the zero-order beam was blocked at the focus of the first lens in the telescope using a piece of aluminium foil glued to a coverglass. Galvo scanners were optically conjugated using a pair of scan lenses (SL50-2P2, Thorlabs) and imaged onto the back aperture of the objective (CFI75, Nikon) using a scan lens (55-S30-16T, Special Optics) and tube lens (MXA20696, Nikon). The imaging and stimulation paths were combined with a 1,000 nm dichroic filter and aligned in ScanImage while imaging a fluorescent pollen slide. To target multiple neurons for stimulation, we used the Gerchberg–Saxton algorithm to compute a phase mask and wrote this to the SLM. Spots were scanned in a spiral pattern as described below. We estimated the diffraction efficiency of the SLM by imaging a fluorescent slide with the SLM and compensated for this difference in efficiency using the weighted Gerchberg–Saxton algorithm.

Photostimulation protocol

Spots were manually defined targeting 4–10 Sst44+ChRmine+ cells, or an equivalent number of control sites that did not overlap with ChRmine+ cells. These spots were scanned in a spiral pattern with a 6.6 µm radius over 32 ms (one frame) to excite the entire cell. We used 3–5 mW average power per spot. We found that lower powers (1–2 mW) did not produce robust photostimulation with our virus and photostimulation parameters. We also found that, at the minimum power level that produced robust photostimulation, the effectiveness of photostimulation (the degree to which targeted cells were activated) tended to decrease past approximately 100 photostimulation trials. These parameters may represent a limited dynamic range within which this cell type can be photostimulated. We therefore limited our analyses to the first 200 trials (half of which were control trials), which represented the typical number of trials in a behavioural session. Photostimulation occurred on alternating frames (30 Hz frame rate, 15 Hz stimulation rate, 50% duty cycle) and lasted 1 s. Photostimulation was triggered as the mouse performed the task on each behavioural trial just before the T-junction. Sst44-cell-targeting (target) and control trials were randomly interleaved. Furthermore, on each trial we omitted one Sst44 cell from the photostimulation group (in other words, if five cells were chosen per target and control group, four were randomly selected out of that group to be photostimulated on each trial). We chose this design to also measure the influence on cells that were part of the targeted group; however, in the end, these cells were omitted because we selected for cells with a certain number of trials to omit low-confidence influence values.

Of the cells that we targeted, 78% were significantly activated relative to control trials (Wilcoxon signed-rank test, P < 0.01 after Bonferroni correction for 137 targets). Of the cells that were significantly activated, our stimulation success rate (change in deconvolved activity above 10% of each cell’s 99th percentile of activation) was 75%.

For determining the resolution of photostimulation, we chose isolated ChRmine+jGCaMP7f+ cells and chose photostimulation targets directly over that cell, and at different distances. In this case, we did not apply a phase mask to the SLM and scanned a single spot at these different distances using the galvanometric mirrors.

Slice electrophysiology

Viral Injections

We injected the Sst44-mTagBFP2 virus into mice at postnatal day 14–15 to allow for at least 10 days of viral expression before the experiment. Virus was injected targeting the PPC at four sites on each side, centred on (−1.7 mm (ML), −2 mm (AP) from bregma) spaced by 0.4–0.5 mm, at 0.25 mm below the dura. Nine mice were used for slice electrophysiology. A separate set of three mice were used for cell fills.

Acute slice preparation

Coronal cortical slices were prepared from postnatal day 24–29. Mice were anaesthetized with isofluorane and transcardially perfused with ice-cold choline-based artificial cerebrospinal fluid (choline ACSF: 110 mM choline chloride, 25 mM NaHCO3, 1.25 mM NaH2PO4, 2.5 mM KCl, 7 mM MgCl2, 0.5 mM CaCl2, 25 mM glucose, 11.6 mM sodium-l-ascorbate and 3.1 mM sodium pyruvate, 320–330 mOsm) equilibrated with 95% O2/5% CO2. After perfusion, the brain was rapidly dissected and blocked in ice-cold equilibrated choline ACSF. Tissue was then transferred to a cutting chamber containing ice-cold equilibrated choline ACSF and cut on a Leica VT1200S (300 µm thickness, 0.10 mm s−1, 1 mm amplitude, 85 Hz). The slices were then collected in a holding chamber containing ACSF (127 mM NaCl, 25 mM NaHCO3, 1.25 mM NaH2PO4, 2.5 mM KCl, 1 mM MgCl2, 2 mM CaCl2 and 10 mM glucose, 300–310 mOsm). The slices were recovered at 32 °C for 20 min and then maintained at room temperature (22 °C) for 20 min before the start of recordings. AAV infection was assessed by epifluorescence. We recorded from Sst44 cell pairs that were less than 100 µm apart, and less than 400 µm from the pia to target layer 2/3 cells. Experiments were performed within 6 h after cutting.

Ex vivo slice electrophysiology

For whole-cell current-clamp recordings, patch pipettes made with borosilicate glass with filament (Sutter BF150-86-7.5) with 3–6 MΩ resistance were filled with a K+-based internal solution (142 mM K-gluconate, 4 mM KCl, 10 mM HEPES, 4 mM MgATP, 0.3 mM NaGTP, 10 mM Na2-phosphocreatine, 1.1 mM EGTA, pH 7.2, 280 mOsm). Recordings were made on an upright Olympus BX51 W1 microscope with an infrared CCD camera (Dage-MTI IR-1000) and a ×60 water-immersion objective (Olympus Lumplan FI/IR 60Å~/0.90 NA). Neuronal tissue was visualized with infrared differential interference contrast. mTagBFP2-expressing Sst44 neurons were identified by epifluorescence driven by a light-emitting diode (Excelitas XCite LED120).

Connectivity measurements were made in current clamp. We injected a hyperpolarizing current into one cell (the driver cell) and measured the resulting change in the membrane voltage of the second cell (the follower cell). For each driver cell, we tuned the hyperpolarizing current (range of −30 to −180 pA) to achieve an approximately −30 mV (range of −19 to −37 mV) deflection in the driver cell. The current step lasted for 600 ms. In total, 20–40 sweeps were collected from each cell pair. This procedure was then repeated in the other direction, injecting current into the second cell and measuring from the first. We initially injected both positive and negative current steps, but then focused on injecting negative current steps to test specifically for gap junctions. Before and after current-clamp recordings to measure connectivity, we measured series resistances in voltage clamp, holding cells at −70 mV and applying a 200 ms −5 pA current step 10 times. If a connection was observed, slices were perfused with a cocktail of synaptic transmission blockers consisting of 10 µM NBQX (Tocris, 1044), 50 µM AP-5 (Tocris, 0106), 10 µM gabazine (Tocris, 1262) to test whether the connection was dependent on synaptic transmission. We perfused the slice with the cocktail for 10 min before measuring the connectivity.

Cell fills

In experiments separate from our paired patch recordings, we used a patch pipette loaded with internal solution containing 250 µM Alexa Fluor488 (Life Technologies, A10436) to label single Sst44 cells. After forming a seal and breaking through the cell membrane, cells were held for 15–30 min. Over several minutes, we then slowly retracted the pipette to detach it from the cell body. We then imaged the cell without fixation under a two-photon microscope (see the ‘Two-photon imaging’ section), taking a stack with 2–5 µm steps. Cell processes were traced by hand in Fiji over a maximum z-projection image with guidance from the full z-stack.

Data acquisition

We used an Axon Multiclamp700B to perform voltage and current clamp and low-pass filtering at 4 kHz. Data were sampled at 10 kHz with the Axon Digidata 1440A system. Both instruments were controlled using Clampex10.6 (Molecular Devices). The recorded traces were analysed with Stimfit0.15 and example traces were extracted using Clampfit10.6 (Molecular Devices). All statistical analysis were performed using Prism 9 (GraphPad).

Analysis

We measured the connectivity strength as the change in membrane potential in the follower cell (cell without current injection) divided by the change in membrane potential in the driver cell (cell with current injection). The change in membrane potential was defined as the average membrane potential during hyperpolarization (600 ms duration) minus the average membrane potential during a baseline period (60 to 10 ms before current pulse onset). Most cells did not spike at the baseline. For those cells that did spike, sweeps containing action potentials were excluded from analysis of that cell. Significantly connected cells were defined using the Wilcoxon signed-rank test (P < 0.01, adjusted post hoc using the Benjamini–Hochberg method). Data were collected from nine mice.

To compute the delay between the follower and driver cell, we selected connections for which the deflection in the membrane potential of the follower cell was greater than 3 mV. To compute the probability of a connection (Fig. 4e), we excluded pairs if either cell had a series resistance higher than 45 MΩ. In the reciprocal connectivity analysis (Fig. 4f), we excluded pairs with a series resistance that differed by more than 30%. For the analysis of synaptic blockers (Fig. 4g,h), we excluded pairs if the series resistance changed by more than 30% after adding synaptic blockers.

To measure the time delay of the connection between Sst44 cells, for each cell, we computed the P value (one-sided Wilcoxon rank-sum test) at each timepoint by comparing a sliding 2 ms window to an equivalent window centred at 1.5 ms before the pulse onset, and computed the average time delay between the log[P] curves (between natural log[P] values of −5 and −10). Note that any analysis is limited by the signal to noise ratio, which can be significant when analysing small deviations in membrane voltage. We therefore chose recordings in which the deflection in the follower cell was greater than 3 mV. Owing to this noise limitation, the delays reported here should be interpreted as an upper bound.

Targeting optogenetic inhibition to Sst44 cells during behaviour

Characterization with extracellular electrophysiology

We injected an AAV with stGtACR256 driven by the Sst44 enhancer in two C57Bl/6J male mice at 2–3 sites spaced anterior-posterior by 0.4 mm centred on (−1.7 mm (ML), −2.0 mm (AP) from bregma, 0.3 mm below the dura, 70 nl per site, 1 × 1012 GC per ml in PBS). The injection pipette was inserted through a small craniotomy and was angled at 30° from the horizontal such that the injection site was under the bone. For recordings, we removed the bone above the injection sites. On a rig in which the mouse was head-fixed and awake, we inserted a 32-channel silicon probe coupled to an optic fibre (A1x32-Poly2-5mm-50s-177-OA32LP, Neuronexus) near the injection sites, and advanced the probe such that the optic fibre was touching the dura. After insertion, we added 2% agarose in PBS to stabilize the brain. Recordings were amplified using a headstage amplifier (RHD2132, Intan Technologies) and digitized at 20 kHz (512ch recording controller, Intan Technologies) operated using the Intan RHX Data Acquisition Software (v.3.1.0). We used Kilosort (v.2.5)57 with the default parameters to detect spikes. We pooled spikes from all of the channels without sorting as a measure of overall circuit activity.

Unfortunately, we did not have a way to test the direct effect of stGtACR2 activation on Sst44 cell spiking because we could not identify Sst44 cells using this method (with an excitatory opsin, one can identify time-locked, short-latency responding cells, but with an inhibitory opsin, one needs a high baseline firing rate to identify cells that are inhibited with a short latency). We therefore instead measured the effect of stGtACR2 activation in Sst44 cells on spiking in the entire population of neurons recorded on the multichannel electrode. As Sst cells are inhibitory, we expect that inhibiting these cells will disinhibit the circuit. As expected, we observed an increase in the population activity when we delivered blue light. This experiment indicates that the stGtACR2 activation worked to some degree. However, as we were unable to measure Sst44 cell spiking directly, it remains unclear whether these cells were completely silenced or just experienced reduced spiking. Moreover, we did not measure the effect on Sst44 cell spiking during error-correction events when these cells are driven very strongly, and when it would be more difficult to fully inhibit these cells. In particular, as these cells have electrical coupling to one another, it may be hard to silence them, especially if the whole, gap-junction-coupled population is not sufficiently silenced through direct optogenetic silencing. For example, it remains possible that some Sst44 cells were not transduced with the virus or had low expression of stGtACR2. Thus, despite our efforts to develop and validate this approach, we remain uncertain of the extent of inhibition of Sst44 cell activity by stGtACR2, especially during behaviour.

Optogenetic inhibition of Sst44 cells during behaviour

We injected Sst44-stGtACR2 AAV bilaterally in the PPC (four sites spaced by 0.5 mm centred on 1.7 mm (ML), −2.0 mm (AP) from bregma, 0.3 mm below the dura, 70 nl per site, 1 × 1012 GC per ml in PBS) in 6 C57Bl/6J male mice. We replaced the skull above the injection sites with two glass windows (one on each hemisphere) to allow light to enter the brain. After training the mice to perform the T-maze task in which the cue was omitted in the second half of the maze (delay task), we performed bilateral inhibition experiments during heading pulse perturbations as described in Fig. 6, and on interleaved control trials without a heading perturbation. We focused on the heading perturbation because the mouse must course-correct during these times, and because we expect Sst44 activity to be strong during these error corrections. We used a 470 nm laser (LRD-0470-PFR-00200, Laserglow Technologies) to deliver blue light and directed the laser beam (1 mm in diameter at the brain surface) using a galvanometric mirror pair (6210H, Cambridge Technology) as previously described48 to either the PPC (1.7 mm (ML), −2 mm (AP) from bregma), or control sites on the dental cement, alternating each side at 40 Hz with a 50% duty cycle. We used twice the average power density as in our electrophysiology experiments to help to ensure that the opsin was activated, as we often observe dura growth under the window after significant periods of time, such as after months of training. On 50% of trials, we started photoinhibition halfway through the maze, which was when the delay period started, and was also when the heading pulse was triggered on a random subset of trials (30%). We terminated photoinhibition after 5 s or once the mouse reached the intertrial interval.

This experiment aims to test whether Sst44 cell activity is required for the mouse to execute a course correction. The outcome of these experiments is that we did not observe a difference in the mouse’s behaviour on trials in which we targeted the blue laser light to the PPC compared with interleaved trials in which we targeted the laser to control sites. It is possible to interpret this negative result in several ways, some of which result to technical challenges and other to biological interpretations. A first possible interpretation is that we did not inhibit Sst44 cell spiking sufficiently (see more details above). A second possibility is that Sst44 cells in the PPC contribute to the execution of course corrections, but that other cells in other cortical or subcortical regions can also drive this behaviour. That is, there may be redundancy across brain areas and, therefore, silencing only the PPC’s Sst44 cells might not have silenced the entire relevant population. Relatedly, it is possible that the silencing of Sst44 cells was heterogeneous in the PPC itself. For example, Sst44 cells in deeper layers may not have been as strongly inhibited given that we expect there to be less light delivered to deeper layers. If not all Sst44 cells were adequately silenced, the remaining active population may be sufficient to carry out the behaviour. A third possibility presents an interesting biological interpretation: that Sst44 cells are not required to perform the error corrections after they have been learned and that instead these cells serve a function in learning to correctly navigate towards the reward. This latter possibility was not tested in our optogenetics experiments as we focused only on well-trained mice. Further experiments will help to distinguish between these possibilities.

Activity analysis

Data analysis was performed using Python 3. Imaging and behaviour data from each session were imported into the anndata object58. Although designed for single-cell sequencing data, this data structure was convenient for imaging data. We used the ‘X’ central matrix to hold the session activity for each cell, the ‘var’ matrix to carry metadata for each cell (that is, channel values, cell type and so on) and the ‘obs’ matrix to carry time-varying information, including behavioural and task variables. The ‘uns’ dictionary carried metadata and other unstructured information.

Data inclusion criteria

Sources were classified as cells or non-cells with a three-layer convolutional neural network trained on manually labelled sources that has been previously described28. Moreover, we excluded sources for which raw fluorescence values exceeded 95% of the digitized dynamic range (to ensure values were not saturated and cells were not over-expressing jGCaMP7f), and sources that were near to the edge of the field of view.

For imaging experiments, we included sessions in which the mice performed the task with >85% correct trials. In imaging cohort 1 (7 mice), this resulted in 27 sessions for the PPC (17,254 cells total), and 24 sessions for the RSC (23,717 cells total). In imaging cohort 2 (8 mice), this resulted in 16 sessions for the PPC (7,940 cells total). For reward-omission experiments, this resulted in 6 sessions from 4 mice (2 mice from each imaging cohort) in the PPC (3,045 cells total). Total cells represent the total cell count across all sessions, not independently sampled cells, as we imaged activity from the same field of view for a given region in each mouse.

For photostimulation experiments, we included sessions in which mice performed the task with >80% correct trials. This resulted in 20 sessions across 4 mice in the PPC (6,793 cells total). These cells were independently sampled.

Classifying cell types

For each cell, we computed the background-subtracted intensity for each channel by taking the mean intensity within that cell’s spatial mask and subtracting the mean intensity in a two-pixel outline around the mask. Cell types were called on a relative basis. Blue cells (Sst44+) were defined as having a background-subtracted intensity of greater than 15% of the maximum blue value, defined as the mean of the top three cells. Red cells (SstCre+) were defined in the same way, except we also included cells that had a spatial correlation of >0.7 with the closest cell mask defined by Cellpose (v.0.0.2.8, default cyto model). For photostimulation experiments, we used a slightly more lenient threshold of 10% the maximum red value (defined again as the mean of the top 3 cells) and 0.6 for the spatial correlation with Cellpose masks, and then manually removed negative cells (~10%) as, in this case, we observed false-positives from sparse neuropil-expressing soma membrane-localized ChRmine-mScarlet.

Activity normalization and smoothing

Different cells expressed different levels of jGCaMP7f, resulting in different absolute changes in fluorescence for each cell. We therefore normalized deconvolved activity by dividing by the 99th percentile of activity within the session for each cell. Unless indicated, all analyses were computed on these normalized activity values, including the mean activities for each cell type. In some cases, indicated in each analysis, we also smoothed each cell’s activity over time with a 0.25 s Gaussian filter.

Correlation analysis

We computed the Pearson correlation between the smoothed activity of each cell, generating a correlation matrix. We then computed the average correlation between cells of different cell types (excluding the diagonal for self-correlations). In Extended Data Fig. 2b,c, instead of computing the correlation between individual cells, we computed the correlation between population means, to assess whether Sst44 cell activity was correlated to overall circuit activity.

UMAP analysis

UMAP projections41 were computed on the smoothed activity of each cell. Note that, because the features here are activity measurements at different points in time, we cannot project cells from different sessions together using this method. UMAP parameters were as follows: Version=0.5.1, n_neighbors=10, min_dist=0.1, metric=‘euclidean’.

Nearest-neighbour analysis

We computed a nearest neighbour graph (k = 10) using the smoothed activity of each cell (smoothed deconvolved session activity, not the UMAP projection). We then computed for each cell the fraction of nearest neighbours that were Sst44+ and averaged this fraction over cells from each cell type.

Clustering analysis

To assess what fraction of Sst44Sst+ cells co-clustered with Sst44 cells, we clustered all cells on the basis of their activity using the Leiden community clustering algorithm (resolution=6, n_neighbors=5), selected the cluster that was most populated by Sst44 cells and examined how many of the Sst44Sst+ neurons fell into that cluster. We performed this analysis for one PPC session from each mouse.

Influence analysis

We analysed cells that were >40 µm from the nearest photostimulation site. From these, we also removed cells that overlapped with pixels contiguous with target sites in the binarized image of ChRmine-mScarlet, to remove cells with ChRmine-expressing proximal dendrites that overlapped with a photostimulation site. We also removed cells that overlapped with pixels contiguous with target sites in the binarized photostimulation triggered dF/F image on target relative to control trials, removing cells that overlapped with the dendrites of directly stimulated cells. Finally, we also chose cells with >20 trials from which to compute influence. Following previous work23, we computed influence as the mean change in deconvolved activity on target trials minus the mean change in deconvolved activity on control trials, divided by the s.d. in deconvolved activity on control trials. We computed the mean change in deconvolved activity as the mean after photostimulation (0.5 to 1.0 s relative to the start of photostimulation, where we observed maximum influence) minus the mean before photostimulation (−1.0 to 0 s relative the start of photostimulation).

Computing heading deviation

To compute the mouse’s heading deviation, we computed the difference between its heading at each timepoint and its heading at the same point along its mean smooth trajectory. To estimate the mean smooth trajectory, we selected the shortest 25% of trials for each world (black–left or white–right) in each session. From these trials, we computed the median position, and the circular mean heading of the mouse at binned distances from the reward zone. We used 15 bins that evenly tiled the log-transformed distance from the reward zone. We used the log-transformed distance because this approach produces more bins at the end of the maze near the T-intersection where there are large changes in heading. We linearly interpolated this coarse trajectory at a resolution of 0.75 cm and aligned each session timepoint to the nearest point along the interpolated trajectory to assign to each timepoint the heading under a smooth trajectory. In a small number of sessions, the mean smooth trajectory included bins where the mouse was facing away from the reward zone at the end of the T-arms (sometimes the mouse would turn too much and overshoot, even on its shortest trials). We assigned to these bins the last heading that was facing towards the reward zone.

Triggered analyses

We triggered either on activity or behavioural events by identifying the rise time of when a variable exceeded a threshold defined in each analysis. We omitted events that were separated by less than 5 s, before plotting each metric with a 5 s window before and after. We also omitted events for which the rise time fell within the intertrial interval. We smoothed the turning acceleration and mean activity signals with a 0.25 s Gaussian filter for triggering and selecting trials. Raw signals are plotted.

We pooled trials across sessions for these triggered analyses. Note that, although cells were not independent for trials from different sessions from the same mouse, the same is also true for trials within the same session. To compare more data, we therefore compiled trials across sessions, conceptually treating trials in the same and different sessions as equivalent.

When triggering on Sst44 cell activity, we triggered on the average activity of Sst44 neurons imaged in a given session (smoothed Sst44 cell activity < 0.4).

When triggering on entering the T-junction, we triggered on the position (y = 225 cm) at which the maze widens slightly (y = 225–229 cm) before entering the maze arms (y = 229–231 cm). When splitting these events on the basis of heading deviation (Fig. 5h), a large deviation was defined as >π/6 and a small deviation as <π/12 at +1.5 s after the trigger. When splitting high-deviation trials by turning acceleration (Fig. 5i), a strong correction was defined as >1 rad s−2 in the opposite direction as the heading deviation, and a weak correction as <0.5 rad s−2, at +1.5 s after the trigger.

When triggering on turning accelerations (Fig. 5j), we triggered on turning accelerations (>1 rad s−2), with a high turning velocity (>0.5 rad s−1) to match the turning profile across conditions, and split by large (>π/6) and small (<π/12) heading deviations at 0 s.

When triggering on heading perturbations (Fig. 6), strong corrections were defined as >1 rad s−2 in the opposite direction as the perturbation, and weak corrections as <0.5 rad s−2 at +2 s after the trigger.

When triggering on heading deviations, we used a 0.3 s delay to parse trials based on turning acceleration (we also used this method to define course-correction rates in Extended Data Fig. 5 and Extended Data Fig. 7j,k). We used this delay to account for the average delay in turning acceleration when triggering on heading deviation with the threshold of π/6 used in these analyses. Note that the heading deviation continues to increase after this point and, on average, peaks approximately with the peak in turning acceleration. We therefore do not use this delay when parsing triggered data in other analyses. For analyses without heading perturbations, we selected sessions with >85% correct trials to increase the likelihood that the mouse was attempting to follow a desired trajectory towards the reward zone. The heading perturbation was triggered at the halfway point in the maze (y = 113 cm). We triggered at the same position on control trials interleaved with heading perturbations.

Statistics

Statistics are indicated in each figure and are all two-sided unless otherwise noted.

Reporting summary

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

Source link