Main

Consolidation of remote memories reflects dynamic neural processes spanning time and space. Fear conditioning is a well-established model of learning and memory, whose neural basis has been studied extensively both at the time of learning and during memory retrieval occurring hours or days later. However, the mechanisms of remote memory are less well-understood. In the hours after fear learning, a cascade of molecular changes leads to synaptic strengthening in regions including the amygdala and hippocampus1. Over weeks, new brain regions and neural pathways are recruited to support memory retrieval2,3. In line with the systems consolidation hypothesis, dependence on the hippocampus for retrieval of contextual fear memories degrades with time and cortical structures become more important2. Recent work also supports time-dependent reorganization of circuits underlying memories of cued fear conditioning3. For instance, while the amygdala remains required for cued memory retrieval4, there is time-dependent turnover of participating amygdala ensembles, and high order sensory and association cortices are selectively recruited at remote timepoints5,6.

The prelimbic (PL) cortex, a subregion of the medial prefrontal cortex, is required for the expression of cued and contextual fear memories from hours after learning until weeks later7,8,9,10,11. However, while some studies suggested that prefrontal cortical neurons active during learning are required for memory retrieval11,12,13, others provided evidence for ongoing circuit reorganization during memory consolidation from a day to a month after learning9,14,15. It has been difficult to causally relate the activity of cortical neurons during learning or recent memory retrieval to their function in remote memory, in part due to a lack of tools16. Furthermore, although the PL cortex projects broadly to many cortical and subcortical brain regions involved in fear learning and memory17,18, most studies have focused on interactions between the PL cortex, the amygdala, and the hippocampus during fear memory consolidation and retrieval19,20,21,22. Therefore, it remains unclear how the PL cortex influences downstream activity in many of its target regions during memory retrieval.

To interrogate the connectivity and function of neurons activated during behavior, we recently developed a new version of ‘targeted recombination in active populations’23 (TRAP2)24. Here we report a detailed characterization of TRAP2. We demonstrate that it has enhanced efficiency over the previous version, providing brain-wide access to neurons activated by a particular experience. We use TRAP2 to ask: to what extent do PL neurons activated during learning or recent memory retrieval contribute to remote memory? How specific is their function for the learned association? How do PL neurons coordinate activity in their many downstream target regions to contribute to memory-guided behavior?

Results

Characterization of TRAP2

TRAP allows permanent genetic access to neurons activated by a specific experience23. The TRAP system uses an immediate early gene locus to drive the expression of tamoxifen-inducible Cre recombinase (CreER), along with a transgenic or virally-delivered Cre-dependent effector. When a neuron is active in the presence of tamoxifen, CreER can enter the nucleus to catalyze recombination, resulting in permanent expression of the effector (Fig. 1a). Because the original FosTRAP (TRAP1) disrupts endogenous Fos23 and does not efficiently access many brain regions, we developed a new mouse line, TRAP224, that preserves endogenous Fos, including the highly conserved first intron25 and the 3′ untranslated region critical for mRNA destabilization26 (Fig. 1b and Supplementary Fig. 1). Furthermore, we replaced the original Cre with a codon-optimized iCre for improved expression27.

Fig. 1: TRAP2 design and characterization.
figure 1

a, Schematic of TRAP2. b, Comparison of FosTRAP (TRAP1) and TRAP2 targeting alleles. Protein coding exons of Fos are in gray. c, 100-μm optical z-stacks showing tdTomato+ TRAPed cells labeled with an anti-RFP antibody using the iDISCO+ protocol. Scale bar, 100 µm. d, TRAP+ cell count differences in brain regions from fear conditioning (FC, n = 4) and non-shocked (NS,  n = 4) groups. Stars represent P values from multiple t tests (two-tailed) adjusted for multiple comparisons with the Benjamini, Krieger, and Yekutieli false discovery rate approach (FDR = 0.1); see also Supplementary Table 1. e, Voxel-based statistics based on heatmaps of detected cell centers from ClearMap30. Colored regions label significantly different voxels between conditions (FC, n = 4; NS, n= 4) based on two-tailed t tests. BMA, basomedial amygdalar nucleus; GENd, geniculate group dorsal thalamus; GENv, geniculate group ventral thalamus; HY, hypothalamus; LAT, lateral group of the dorsal thalamus; LHA, lateral hypothalamic area; LPO, lateral preoptic area; MB, midbrain; OT, olfactory tubercle; pA, SV40 polyA; PAG, periacqueductal grey; PB, parabrachial nucleus; PH, posterior hypothalamic nucleus; prom, promoter; PVR, periventricular region; SPA, subparafascicular area; SPF, subparafascicular nucleus; TH, thalamus; VMH, ventromedial hypothalamic nucleus; ZI, zona incerta. In all plots and statistical tests, n represents biologically independent animals. Boxes represent 25–75th percentiles, whiskers represent 10–90th percentiles, lines represent median. *P< 0.05, **P< 0.01, ***P< 0.001, ****P< 0.0001.

To characterize TRAP2, we first determined the time course of TRAPing and sensitivity of TRAP2 using the tdTomato Cre reporter Ai1428. We dark adapted TRAP1;Ai14 and TRAP2;Ai14 double transgenic mice and then exposed them to 1 hour of light at different times relative to injection of 4-hydroxytamoxifen (4-OHT) (Supplementary Fig. 2a). Resultant patterns of tdTomato expression revealed that the majority of TRAPing occurred within a 6-hour window centered around the 4-OHT injection. At peak, there was a ~12-fold induction in TRAPed cells above dark controls in primary visual cortex for TRAP2, an improvement over a ~5-fold induction for TRAP1 (Supplementary Fig. 2b–g). To examine the ability of TRAP2 to capture activity in different brain regions, we injected TRAP2;Ai14 and TRAP1;Ai14 mice with 4-OHT while they explored a novel environment (Supplementary Fig. 3a). TRAP2 labeled many more cells than TRAP1 throughout the brain (Supplementary Fig. 3b–d) in a manner more consistent with endogenous Fos expression29. TRAP2;Ai14 mice that received sham injections had very few tdTomato+ cells, indicating minimal Cre-mediated recombination in the absence of 4-OHT (Supplementary Fig. 3b–d).

To test the utility of TRAP2 in interrogating neural circuits for fear learning and memory, we injected TRAP2;Ai14 mice with 4-OHT immediately after a differential auditory fear conditioning (FC) protocol in which a conditioned tone (CS+) that co-terminated with a footshock was interleaved with an unreinforced non-conditioned tone (CS) (Supplementary Fig. 4a). Subsequent iDISCO+-based whole-brain immunostaining30 revealed significant increases in the numbers of TRAPed cells above non-shocked (NS) controls in expected brain regions31, including parabrachial nucleus, periacqueductal grey, and subregions of the amygdala and hypothalamus (Fig. 1c–e and Supplementary Table 1).

PL neurons TRAPed during memory retrieval change over time

While the PL cortex is required for fear memory retrieval, it remains unclear as to what extent PL ensembles supporting memory are stable or dynamic over time (Fig. 2a). We used TRAP2 and Fos immunostaining to ask what proportion of PL neurons TRAPed during an earlier memory experience were reactivated during remote retrieval. To ensure that the targeting allele in TRAP2 mice did not disrupt endogenous Fos, we first compared Fos expression following remote memory retrieval in wild-type and TRAP2 mice. We observed no differences between groups when we quantified Fos in six relevant brain regions (Supplementary Fig. 5).

Fig. 2: PL activation patterns during fear learning and memory retrieval over time.
figure 2

a, Potential relationships between PL neurons activated during learning (FC) and remote memory retrieval. Pink circles represent activated neurons, and white circles represent nonactivated neurons. b, Experimental design to test models. Circles represent an experience. Filled circles represent experiences paired with 4-OHT injection (TRAPed experience). For simplicity, we depict NS controls as having a retrieval on day 1; however, NS controls were balanced across groups with retrievals occurring on days 1, 7, or 14. c, Example confocal images of TRAPed (left), Fos+ (middle), and TRAP + Fos double-labeled (right) PL neurons from a 7d TRAP2;Ai14 mouse. d,e, Quantification of percentage of Fos+ neurons that are TRAPed (d, F(4,41) = 13.03, P< 0.0001) and percentage of TRAPed neurons that are Fos+ (e, F(4,41) = 5.45, P= 0.0013). n= 15, 8, 8, 8, 8 for NS, FC, 1d, 7d, 14d, respectively; one-way ANOVA with Holm–Sidak post hoc test. Example confocal images and quantifications of TRAPed and Fos+ cells from 1d- and 14d-TRAPed brains in DG (f, Double+Fos+: P = 0.87, t9 = 0.17; double+TRAPed: P = 0.46, t9 = 0.77; n= 6, 5 for 1d and 14d, respectively, based on two-tailed unpaired t test) and BLA (g, Double+Fos+: P = 0.0595, t11 = 2.10; Double+TRAPed: P = 0.0527, t11 = 2.17; n = 8, 5 for 1d and 14d, respectively, based on two-tailed unpaired t test). Scale bars, 100 µm. In all plots and statistical tests, n represents biologically independent animals. Summary graphs show mean ± s.e.m. *P< 0.05, **P< 0.01, ***P< 0.001, ****P< 0.0001.

We subjected four groups of TRAP2;Ai14 mice to the auditory fear conditioning protocol described above. TRAPing occurred immediately after FC, or after memory retrieval 1 day (1d), 7 days (7d), or 14 days (14d) after learning, respectively. Control animals were not shocked (NS), and thus did not undergo associative learning. Twenty-eight days after fear conditioning, all groups underwent a remote memory retrieval session and were sacrificed one hour later for Fos immunostaining (Fig. 2b,c). We quantified freezing behavior as an expression of fear. Mice froze preferentially during presentations of the conditioned tone (CS+) (Supplementary Fig. 4a). Furthermore, all fear-conditioned groups exhibited comparable levels of conditioned freezing, while NS animals did not freeze (Supplementary Fig. 4b).

We found that 7d- and 14d-TRAPed PL neurons were significantly more likely to be reactivated (TRAPed and Fos+) during remote memory retrieval compared to NS, FC, and 1d conditions, when measured as a fraction of total Fos+ neurons (Fig. 2d) or total TRAPed neurons (Fig. 2e). This is despite the fact that the numbers of TRAPed and Fos+ neurons were mostly similar across groups (Supplementary Fig. 4c,d). Most TRAPed PL neurons were located in deep layers, and activated neurons in later retrievals had a larger proportion of TRAPed neurons in layer 6 at the expense of layers 2/3 compared with the 1d group (Supplementary Fig. 6). Together, these data suggest that new PL neurons are recruited to the remote memory trace over time after initial learning. As controls, we observed no time-dependent changes in Fos expression in piriform cortex (Supplementary Fig. 7) or in non-TRAPed PL neurons (Supplementary Fig. 4e). However, in all groups, TRAPed cells were more likely to be reactivated than non-TRAPed cells. Thus, a proportion of TRAPed PL neurons may stably encode features of the environment, while another subset undergoes memory-dependent reorganization.

Using the same approach, we examined time-dependent changes in dentate gyrus (DG) and basolateral amygdala (BLA), which have established roles in contextual and cued fear memory consolidation32. We did not observe time-dependent changes in TRAP/Fos overlap in DG (Fig. 2f), consistent with studies showing that the hippocampus is involved in recent but not remote memory33. We observed a trending time-dependent increase in the fraction of TRAPed BLA neurons that were Fos+ following remote memory retrieval (Fig. 2g, Double+/Fos+: P= 0.06; Double+/TRAPed: P= 0.05, student’s t-test), consistent with work showing that BLA plays a continual role in cued fear memory4 and that memory-related BLA populations turn over throughout at least a week after learning5.

TRAPed PL neurons promote remote memory in a time-dependent manner

To test the behavioral function of TRAPed neurons, we expressed channelrhodopsin (ChR2)34 in PL neurons TRAPed at different timepoints and optogenetically stimulated them during remote memory retrieval (Fig. 3a). In the absence of tones, reactivating TRAPed PL cells increased freezing above baseline levels in all fear conditioned groups (Fig. 3b). However, despite having similar numbers of TRAPed neurons in most groups (Supplementary Fig. 4c), the extent to which TRAPed neurons drove freezing was time-dependent, such that stimulating PL ensembles TRAPed later produced more freezing (Fig. 3c; FInteraction(3,57) = 3.55, P = 0.019, 2-way repeated measures ANOVA). These data indicate that reactivating PL neurons TRAPed during earlier memory events promotes freezing in the conditioning context at remote times, and that the functional contribution of TRAPed PL neurons to remote memory retrieval increases during the first two weeks after learning.

Fig. 3: Temporal changes in the causal role of TRAPed PL neurons in remote fear memory retrieval.
figure 3

a, Experimental design. Circles represent an experience. Filled circles represent experiences paired with 4-OHT injection (TRAPed experience). For simplicity, we depict NS controls as having a retrieval on day 1; however, NS controls were balanced across groups with retrievals occurring on days 1, 7, or 14. Ret, retrieval. b, Quantification of contextual freezing with or without (±) ChR2 activation (NS, P= 0.480, t14 = 0.73, n= 15; FC, P= 0.083, t17 = 1.85, n= 18; 1d, P= 0.0026, t18 = 3.50, n= 19; 7d, P< 0.0001, t13 = 8.59, n= 14; 14d, P = 0.0004, t9 = 5.55, n = 10; based on two-tailed paired t tests). c, Summary of contextual freezing for b (FInteraction(3,57) = 3.55, P = 0.019; FLaser(1,57) = 68.27, P < 0.0001; n = 18, 19, 14, 10 for FC, 1d, 7d, and 14d conditions, respectively). d, Summary of CS+ tone-evoked freezing ± ChR2 activation (FInteraction (3, 57) = 1.86, P = 0.148; FLaser(1,57) = 1.48, P = 0.229, n = 18,19,14,10 for FC, 1d, 7d and 14d conditions, respectively). e, Summary of CS tone-evoked freezing ±ChR2 activation (FInteraction (3, 40) = 0.495, P = 0.688; FLaser(1,40) = 1.61, P = 0.212, n = 11, 13, 10, 10 for FC, 1d, 7d, and 14d conditions, respectively). f, Summary of tone-discrimination [(CS+ – CS)/(CS+ + CS)] during 28d retrieval (FInteraction (3, 40) = 0.199, P = 0.896; FLaser(1,40) = 1.9, P = 0.176, n = 11, 13, 10, 10 for FC, 1d, 7d, and 14d conditions, respectively). g, Summary of freezing in altered context ± ChR2 activation (FInteraction(3,39) = 0.632, P = 0.599; FLaser(1,39) = 17.11, P = 0.003, n = 11, 13, 10, 10 for FC, 1d, 7d, and 14d conditions, respectively). h, Summary of CS+ tone-evoked freezing in altered context ± ChR2 activation (FInteraction(3,33) = 2.255, P = 0.100; FLaser(1,33) = 0.296, P = 0.590, n = 9, 10, 10, 8 for FC, 1d, 7d, and 14d conditions, respectively). Statistics in c–h reflect two-way repeated-measures ANOVA with multiple comparisons using post hoc Sidak correction. See also Supplementary Fig. 8d–h for plots showing individual data points for d–h. In all plots and statistical tests, n represents biologically independent animals. Summary graphs show mean ± s.e.m. *P< 0.05, **P< 0.01, ***P< 0.001, ****P< 0.0001.

To further elucidate the functional contributions of TRAPed PL neurons during remote memory, we performed additional optogenetic experiments to investigate their specificity for the conditioned tone and context. Reactivating TRAPed PL cells during presentations of the CS+ was not sufficient to increase freezing above the level of the tones (Fig. 3d,h), suggesting that their function may be occluded by the tone. Furthermore, reactivating TRAPed PL neurons did not impact freezing during the CS (Fig. 3e), nor the behavioral discrimination between CS+ and CS (Fig. 3f). Reactivating TRAPed neurons in an altered context in the absence of tones (Day 29, Fig. 3a) caused only a modest increase in freezing (Fig. 3g), suggesting that contextual information facilitates the ability of TRAPed PL neurons to enhance fear memory35.

In further support of the behavioral specificity of fear memory-TRAPed neurons, photoactivating NS-TRAPed ensembles did not cause freezing (Fig. 3b), even though similar numbers of neurons were TRAPed (Supplementary Fig. 4c). To test whether the NS-TRAPed ensembles, which likely represent the neutral tone and context (Supplementary Fig. 4e), could contribute to a newly formed fear memory, we fear-conditioned the NS mice on Day 32 to generate the NS/FC group. The following day, we performed a memory retrieval session during which we photostimulated the NS PL ensembles that had been TRAPed on Day 0 (Supplementary Fig. 8a). Although ChR2 was highly expressed (Supplementary Fig. 9), reactivating NS-TRAPed cells did not reliably drive contextual or tone-evoked freezing (Supplementary Fig. 8b,c), suggesting that TRAPed PL neurons must be linked to the fearconditioning event to participate in the memory trace. While we cannot definitively rule out the possibility of nonspecific effects on freezing induced by light, optogenetic stimulation did not significantly impact contextual freezing levels in mice that were fear conditioned after TRAPing (Supplementary Fig. 8b), suggesting that light alone is not sufficient to produce the previously observed behavioral effects. Finally, we observed no significant aversion to photoactivation of TRAPed neurons in a real-time place aversion task (Supplementary Fig. 10), suggesting that the observed effects on freezing reflect a modulation of responses to conditioned stimuli rather than general aversion.

Testing the requirement of PL activity in remote memory retrieval

To test whether activity in TRAPed neurons is required for remote memory retrieval, we injected an AAV expressing a Cre-dependent light-activated chloride channel iC++36 into the PL cortex. We injected 4-OHT after 1d or 14d memory retrieval, and photoinhibited TRAPed PL neurons during presentations of the conditioned tone on Day 28 (Fig. 4a and Supplementary Fig. 11). Inhibiting 1d-TRAPed cells did not reliably impair remote memory retrieval (Fig. 4b), whereas inhibiting 14d-TRAPed cells significantly reduced freezing to the conditioned tone (Fig. 4c). Interestingly, neither manipulation directly impacted CS-evoked freezing, but inhibiting 14d-TRAPed cells specifically impaired discrimination between the CS+ and CS (Fig. 4c). In addition, neither manipulation impacted contextual freezing (Fig. 4b,c), which may be due to the floor effects of already low levels of contextual freezing in the absence of photostimulation. Thus, 14d-TRAPed cells but not 1d-TRAPed cells were required for the full tone fear memory and tone discrimination during remote memory retrieval. These results support dynamic changes in PL ensembles that promote remote memory retrieval.

Fig. 4: Effects of inhibiting PL neurons on remote memory retrieval.
figure 4

a, Experimental protocol for optogenetic inhibition of TRAPed PL neurons. b,c, Quantification of contextual, CS+, and CS-evoked freezing and tone discrimination ((CS+ – CS)/(CS+ + CS)) ± iC++ inhibition for (b) 1d-TRAPed (context, P = 0.334, t6 = 1.05, n= 7; CS+, P = 0.113, t6 = 1.85, n= 7; CS, P= 0.556, t5 = 0.63, n= 6; tone discrimination, P= 0.337, t5 = 1.06, n= 6; based on two-tailed paired t tests) and (c) 14d-TRAPed mice (context, P = 0.161, t6 = 0.99, n= 7; CS+, P = 0.0035, t6 = 4.84, n= 7; CS, P= 0.548, t6 = 0.66, n= 7; tone discrimination, P= 0.048; t6 = 2.47, n = 7, based on two-tailed paired t tests). d, Experimental protocol for chemogenetic silencing with hM4D during learning and subsequent TRAPing and memory retrieval. e, Confocal image of dual virus injection. Filled arrows represent double-labeled cells, open arrow represents an eYFP-only cell. Scale bar, 500 µm. f,g, Behavioral data on contextual (f) and tone (g) fear memory. Blue bars represent ChR2 activation. Statistics for f: FInteraction(1,15) = 20.2, P = 0.0004; FLaser(1,15) = 31.58, P < 0.0001; for g: FInteraction(1,30) = 0.011, P = 0.916; FLaser(1,30) = 0.158, P = 0.694; n= 6 (–hM4D) and n= 11 (+hM4D), based on two-way repeated measures ANOVA with multiple comparisons corrected with post hoc Holm–Sidak test. In all plots and statistical tests, n represents biologically independent animals. Summary graphs show mean ± s.e.m. *P< 0.05, **P< 0.01, ***P< 0.001, ****P< 0.0001.

Despite making a small contribution to the remote memory trace, PL neurons activated during fear conditioning could nevertheless play a critical role in initiating a dynamic process that recruits new PL neurons to the memory trace over time11,12,37. To test this hypothesis, we injected AAVs (adeno-associated viruses) expressing non-conditional chemogenetic silencer hM4D38 bilaterally, and Cre-conditional ChR2-eYFP unilaterally into the PL cortex of the same animal, observing substantial overlap between ChR2- and hM4D-expressing cells in the PL cortex (Fig. 4e). Mice received clozapine-N-oxide (CNO) 30 minutes before fear conditioning on Day 0, were TRAPed during 14d-memory retrieval, and were tested on Day 28 as before (Fig. 4d,e). In control animals lacking hM4D, photoactivating TRAPed PL neurons significantly increased freezing in the conditioning context as before (Fig. 3b); however, photoactivating TRAPed cells in hM4D+ mice no longer increased freezing levels in the majority of the animals tested (Fig. 4f). Furthermore, reducing PL activity during FC had no impact on memory strength in the absence of photoactivation (Fig. 4f,g), consistent with previous results9. Thus, while other regions may compensate for PL inhibition during learning to support remote memory formation, PL activity during learning or early stages of consolidation is essential to establish the ensemble of PL neurons that supports remote memory retrieval.

Brain regions whose TRAPing patterns co-vary with the PL

In a final set of experiments, we interfaced TRAP2 with whole-brain analyses to generate hypotheses about how PL interacts with its many downstream targets to influence memory retrieval over time. First, we leveraged variability in TRAPing patterns of individual animals to identify brain regions that co-vary with PL cortex (Fig. 5a,b). Using iDISCO+ and ClearMap30, we counted brain-wide TRAPed cells in seven 1d- and nine 14d-TRAPed mice. We performed unbiased clustering of brain regions based on numbers of TRAPed cells and visualized their relationships with t-distributed stochastic neighbor embedding (tSNE)39. In both cohorts, brain regions segregated into three clusters (Fig. 5c). For both 1d- and 14d-TRAPed animals, the PL cortex was housed in a cluster with many other cortical areas including anterior cingulate, temporal association, ectorhinal, auditory, and entorhinal areas, all of which have known roles in remote memory40,41,42 (Fig. 5c,d and Supplementary Table 2). We also observed several time-dependent changes in cluster membership. Notably, basolateral amygdala, basomedial amygdala, central amygdala, midline thalamic nuclei, and some high-order visual areas clustered with the PL cortex at 1d but not 14d memory retrieval, indicating that the relationship between the PL cortex and these regions may change with time.

Fig. 5: Relating whole-brain TRAPing patterns to memory-guided behavior.
figure 5

a, Experimental design. b, Analysis pipeline. c, tSNE representation of brain areas across replica mice (1d, n = 7; 14d, n = 9 biologically independent animals), where each dot represents a single brain area and distance in tSNE space reflects similarity in counts of TRAPed neurons for that particular brain area across all mice. A subset of brain areas that belong to the PL cluster in 1d and 14d TRAP is indicated. d, List of brain regions by assigned cluster for 1d- and 14d-TRAPed brains sorted by 1d TRAP condition. e–h, Pearson correlations of regional TRAP counts (1d, n = 7; 14d, n = 9 biologically independent animals) with tone discrimination ((CS+ – CS)/(CS+ + CS)) color mapped onto tSNE clusters (as shown in c), or onto coronal sections from a standard brain for 1d-TRAP (e,f) and 14d-TRAP (g,h) brains (see also Supplementary Table 2). ACA, anterior cingulate area; AI, agranular insular area; AUDpo, posterior auditory area; AUDv, ventral auditory area; CEA, central amygdalar nucleus; CTXsp; cortical supbplate; ECT, ectorhinal area; ENTl, entorhinal area lateral part; ENTm, entorhinal area medial part; HB, hindbrain; HPF, hippocampal formation; Isoctx, isocortex; MED, medial group of the dorsal thalamus; MOB, main olfactory bulb; MTN, midline group of the dorsal thalamus; OLF, olfactory areas; P-mot, pons, motor-related ; POST, postsubiculum; STR, striatum; TeA, temporal association areas; VIS, visual areas; VISC, visceral area.

To understand how activity in these regions relates to memory retrieval, we examined correlations between TRAP patterns and behavioral characteristics of individual animals. For each brain region, we correlated numbers of TRAPed cells with tone discrimination (differential freezing between CS+ and CS; Fig. 5e–h), CS+-evoked freezing, and contextual freezing (Supplementary Fig. 12). In general, areas with high correlation with freezing measures tended to fall within the same cluster, suggesting TRAPing patterns in the PL and its associated regions are linked to memory-guided behavior. In 1d-TRAPed brains, correlations with contextual and CS+-evoked freezing were higher in hippocampus and central amygdala, while in 14d brains, correlations with these metrics were higher in the PL cortex (Supplementary Fig. 12). Interestingly, 14d-TRAPed brains had the highest correlations with tone discrimination, particularly in cortical association areas including PL, anterior cingulate, ventral auditory, temporal association, ectorhinal and entorhinal areas that also clustered together (Fig. 5e–h). Together, these data suggest that the PL cortex interacts with distinct sets of regions to contribute to memory retrieval at different points in time and, furthermore, that cortical association areas likely contribute more to memory specificity during remote memory retrieval.

PL ensembles TRAPed later preferentially recruit cortical targets

To determine which relationships identified in the tSNE analysis likely reflect direct PL cortex targets, we examined the projections of TRAPed PL neurons. The PL cortex is connected with many regions critical for fear learning and memory17,18,43,44, but the specific projections of neurons activated during memory retrieval have not been globally mapped. We used iDISCO+ and a custom axon analysis pipeline (Methods) to quantify the brain-wide axonal projections of 1d- and 14d-TRAPed PL neurons expressing membrane-tagged GFP (Fig. 6a,b). TRAPed PL neurons projected broadly, with particularly dense innervation in cortical association areas, amygdala, and hypothalamus, and some innervation in ventral striatum and pallidum (Fig. 6c,d and Supplementary Table 3). Importantly, regions identified in the PL-containing cluster (Fig. 5c) were some of the most densely innervated, suggesting that co-variance in TRAPing patterns does indeed reflect direct connectivity. However, the global projections of 1d- and 14d-TRAPed neurons were indistinguishable at this level (Fig. 6b–d). This could be because neurons participating in memory retrieval across time derive from the same broad class of projection neurons, or because TRAPed neurons also include those that stably encode features of the environment as discussed earlier.

Fig. 6: Whole-brain analyses of network involving TRAPed PL neurons.
figure 6

a–d, Projection mapping of 1d- and 14d-TRAPed PL neurons. a, Experimental design. b, Coronal 100-μm optical stacks showing iDISCO+ labeling of GFP+ axons from TRAPed PL neurons in representative brains. Scale bars, 200 µm. c, Probability maps showing 1d- and 14d-TRAPed PL axon innervation by region from representative brains overlaid onto a standard brain. Scale bars, 1 mm. d, Heatmap showing axon innervation by region for TRAPed axons (1d, n = 5; 14d, n = 3 biologically independent animals; see also Supplementary Table 3 for statistical comparisons). e–g, Whole-brain Fos patterns in response to activating 1d- and 14d-TRAPed PL neurons. e, Experimental design. f, Locations of individual mice projected in principal component (PC) space defined by the first two PCs (arbitrary PC units, 1d, n = 5; 14d, n = 4 biologically independent animals). g, Loadings for PC2 (arbitrary PC weight units). h, Visualization of regions with differential Fos expression in 1d- and 14d-TRAPed brains (1d, n = 5; 14d, n = 4 biologically independent animals; see also Supplementary Table 4). i, Working model showing that PL ensembles involved in the memory trace are recruited over time and that despite having similar projection patterns, PL cells involved in remote memory more strongly recruit cortical targets. ACB, nucleus accumbens; ATN, anterior group of the dorsal thalamus; AUDd, dorsal auditory area; AUDp, primary auditory area; CB, cerebellum; CLA, claustrum; CNU, cerebral nuclei; CP, caudoputamen; D, dorsal; EP, endopiriform nucleus; ME, median eminance; MEA, medial amygdala; NLOT, nucleus of the lateral olfactory tract; P, posterior; PALc, pallidum caudal region; PIR, piriform area; PTLp, posterior parietal areas; PVT, paraventricular nucleus of the thalamus; RSP, retrosplenial area; SSs, supplemental somatosensory area; TT, taenia tecta; TU, tuberal nucleus; VISa, anterior visual area; VISal, anterolateral visual area; VISpm, posteromedial visual area.

Although the structural projections of 1d- and 14d-TRAPed neurons were similar, they could still elicit different functional effects in target regions through time-dependent changes in connection strength or target cell response properties. To test this hypothesis at the whole-brain level, we used the same 1d- and 14d-TRAPed animals from our behavioral analyses (Fig. 3). We photostimulated TRAPed PL neurons expressing ChR2 while animals were in the home-cage, and sacrificed the mice one hour later to examine resultant Fos induction throughout the brain using iDISCO+ and ClearMap30 (Fig. 6e). Principal components analysis (PCA) on the Fos+ cell counts in 1d- and 14d-TRAPed groups revealed that mice from the two groups segregated along PC2 (Fig. 6f). Examining the PC loadings indicated that sensory and association cortical areas, central amygdala, and tuberal nucleus largely explained the variance along PC2, with cortical areas higher in the 14d condition, and subcortical regions contributing more strongly towards the 1d condition (Fig. 6g). To further explore group-level differences in Fos induction, we analyzed normalized Fos levels by region and observed 21 regions with differential Fos expression between 1d- and 14d-TRAPed animals (Supplementary Table 4). Again, regions with higher Fos in the 14d condition tended to be in the neocortex, including high-order auditory, visual, and somatosensory areas, while regions with higher Fos in the 1d condition were largely subcortical, including nuclei in the hypothalamus, thalamus, striatum, and pallidum (Fig. 6h). Interestingly, several cortical areas higher in the 14d condition are highly innervated by TRAPed PL axons, belong to PL’s cluster in our co-variation analysis above, and are highly correlated with memory-guided behaviors. Together, these data suggest that dynamic changes in PL manifest as increasing functional recruitment of cortical targets with time (Fig. 6i).

Discussion

Using TRAP2, we accessed PL neurons activated during fear conditioning or 1-, 7-, or 14-day memory retrieval, and assessed their contributions to 28-day remote memory. We found that PL neurons TRAPed at later retrieval times were more likely to be reactivated during remote memory retrieval, more effectively promoted remote memory retrieval, and were required for the full remote cued fear memory. Furthermore, reducing PL activity during learning blunted the ability of TRAPed PL neurons to promote remote memory retrieval. Finally, unbiased whole-brain analyses identified a set of cortical regions whose activity co-varied with the PL cortex and correlated with memory specificity. Many of these regions were densely innervated by and preferentially activated by PL neurons TRAPed during 14-day retrieval. These findings support a model in which PL ensembles underlying remote memory undergo dynamic changes during the first two weeks after learning, which manifest as increased functional recruitment of cortical targets (Fig. 6i).

Characterization of TRAP2

We have provided a detailed characterization of TRAP2, demonstrating that it has several advantages over the previous version. While both versions have a similar TRAPing window of ~6 hours surrounding a 4-OHT injection, TRAP2 has enhanced labeling efficiency and provides improved genetic access throughout the brain, particularly in subcortical regions including the striatum, amygdala, hypothalamus, and midbrain structures. By using a bicistronic cassette in the targeting allele, we preserved expression of endogenous Fos so that TRAP2 animals are viable as homozygotes. To validate that the targeting allele did not interfere with endogenous Fos expression, we showed that Fos induction in TRAP2 mice is indistinguishable from wild-type mice following remote fear memory retrieval. With improved access throughout the brain, permanent labeling, a short labeling window, compatibility with whole brain analysis tools, and a modular design that meshes with existing Cre-dependent effectors, TRAP2 offers many advantages over existing activity-dependent tools16. Here we leveraged its unique features to identify dynamic changes in cortical circuits that promote remote fear memory retrieval. Permanent labeling gave us the ability to track the same neurons across a month so we could causally relate their activity during learning or recent memory to their function during remote memory. We recently reported that TRAP2 could efficiently access dehydration-activated hypothalamic neurons to investigate neural basis of thirst motivation24. We expect that TRAP2 can be used for whole-brain mapping of the circuits and activity patterns underlying diverse behaviors.

Dynamic changes in PL ensembles underlying memory retrieval over time

While memories reorganize over time at the systems level2,3, the precise nature of this reorganization at the level of individual cortical neurons was unclear. Focusing on the PL cortex, a prefrontal subregion required for fear memory retrieval over time, we provide compelling evidence that the PL ensembles that support remote memory undergo dynamic changes during consolidation. A recent study demonstrated that PL neurons activated during contextual fear conditioning are required for memory retrieval two weeks later, that hippocampal activity supports their functional maturation, and that BLA-PL interactions have a selective role in remote memory11. Using a cued fear conditioning paradigm to examine PL memory circuits a month after learning, we extend these findings in several ways. By TRAPing at different times after conditioning, we demonstrate that while FC-TRAPed neurons make a small contribution, neurons TRAPed during later memory retrieval have greater influence over remote memory. We interpret these dynamic changes to reflect different neurons being recruited to the PL memory trace with time, in line with recent work showing dynamic turnover in task-relevant neural ensembles in the hippocampus45, amygdala5, and parietal cortex46. However, our observations are also consistent with changes in activity patterns10,47 that could push neurons above or below the TRAPing threshold. Either way, these changes may reflect shifting demands on PL circuits during memory retrieval over time7,11,48.

What drives these dynamic changes in PL? We provide evidence that activity of PL neurons during learning influences recruitment of neurons to the memory trace. Previous work showed that pharmacologically silencing PL cortex during fear conditioning did not impair memory9, but these studies did not examine the impact on the causal function of PL during subsequent memory retrieval. Here we find that while reducing PL activity during FC did not impact memory retrieval at the behavioral level, it impaired the ability of 14d-TRAPed PL neurons to enhance remote memory retrieval. We propose that PL neurons activated during learning, along with long-range input44 from amygdala32, hippocampus49 and entorhinal cortex11, initiate a process of local changes within PL circuits during memory consolidation, which underlies the temporal evolution of PL ensembles for remote memory retrieval we observed (Fig. 6i).

Whole-brain analyses of PL circuits underlying memory retrieval over time

The systems consolidation hypothesis posits that remote memories are stored in a distributed cortical network2, although only a few studies have examined the brain-wide memory network at the cellular level15,48, and the role of the PL cortex in shaping downstream activity patterns remained unclear. Our analyses revealed that even though 1d- and 14d-TRAPed neurons had similar structural projections, a set of high-order sensory and association cortices had preferentially increased Fos induction following photoactivation of 14d-TRAPed PL neurons. Thus, TRAPed populations may contain distinct subclasses of projection neurons that are enriched at different times. Alternatively, members of the same large projection class with differential target-dependent plasticity may be recruited to the memory trace over time. Additional analyses of whole-brain TRAPing patterns highlighted a set of frontal, temporal, and parietal cortical association areas that reliably clustered with the PL cortex and correlated with cued freezing behavior, while several subcortical regions only clustered with the PL cortex during 1d memory retrieval, and their correlations with freezing behavior degraded with time. Thus, though systems consolidation has been better-studied for contextual memory, our data support its central tenet in our paradigm that includes contextual and cued fear memory. As PL and other cortical association areas from the same tSNE cluster were highly correlated with tone discrimination specifically in 14d TRAPed brains, and silencing 14d- (but not 1d-) TRAPed PL neurons reduced tone discrimination during remote memory retrieval, PL cortex and associated cortical regions recruited at remote timepoints might contribute to memory specificity. Furthermore, regions in other clusters became anti-correlated with tone discrimination over time, suggesting that bidirectional changes in coordinated activity patterns may underlie memory retrieval over time.

Overall, our whole-brain analyses converged on a partially overlapping set of cortical areas, including auditory, temporal association, ectorhinal, and entorhinal areas (Fig. 6i), which have demonstrated roles in remote fear memory retrieval6,41,42. Together, our data indicate that changes in PL ensembles promoting remote memory may reflect a time-dependent recruitment of cortical targets whose function could underlie the specificity of the retrieved memory. These studies will guide future work examining the dynamics of interactions between PL cortex and identified target regions during memory retrieval.

Methods

All animal procedures followed animal care guidelines approved by Stanford University’s Administrative Panel on Laboratory Animal Care (APLAC). TRAP2 mice were generated in a 129Sv/SvJ background. For behavior experiments, they were backcrossed to C57Bl6/J for 3 generations. See accompanying Life Sciences Reporting Summary for additional details about experimental design and reagents.

Mouse genetics

Generation of the Fos2A-iCreER/+ (TRAP2) mice24 and FosTRAP (TRAP1)23 were previously described. We have deposited TRAP2 mice to Jackson Labs (stock #030323). Homozygous Fos2A-iCreER/2A-iCreER mice are viable. R26AI14/+ (AI14) mice28 were obtained from Jackson Labs (stock #007914). TRAP2 mice were crossed to AI14 mice to obtain the double heterozygous (TRAP2;Ai14) mice used in many experiments described in this study. Genotyping for AI14 was performed using the standard PCR protocol provided by Jackson Labs. Genotyping for the Fos2A-iCreER alleles was performed using iCre primers (Fwd: GTGCAAGCTGAACAACAGGA, Rev: ATCAGCATTCTCCCACCATC) that produce a 420 bp band.

Drug preparation

4-hydroxytamoxifen (4-OHT; Sigma, Cat# H6278) was dissolved at 20 mg mL–1 in ethanol by shaking at 37°C for 15 min and was then aliquoted and stored at –20°C for up to several weeks. Before use, 4-OHT was redissolved in ethanol by shaking at 37°C for 15 min, a 1:4 mixture of castor oil:sunflower seed oil (Sigma, Cat #s 259853 and S5007) was added to give a final concentration of 10 mg mL–1 4-OHT, and the ethanol was evaporated by vacuum under centrifugation. The final 10 mg mL–1 4-OHT solutions were always used on the day they were prepared. All injections were delivered intraperitoneally (i.p.).

Visual stimulation

TRAP1 or TRAP2 mice were singly housed in a light-proof box for 48 h. On the TRAPing day, mice were exposed to 1 h of light inside the box and i.p. injected with 50 mg kg–1 4-OHT under infrared light either 6 (TRAP2 group only) or 3 h before light exposure, or 0 or 3 h after light exposure. Mice were returned to the dark box for an additional 2 days and then returned to their home-cage until the time of sacrifice 7 days after TRAPing. Animals were randomly assigned to experimental groups, and animals assigned to different experimental conditions were run in parallel.

Novel environment

TRAP1 or TRAP2 mice were either placed in a novel environment (a clean rat cage with tunnels and a running wheel), or in their home-cage in the same room, for 2 h. Halfway through the 2-h period, mice were i.p. injected with 50 mg kg–1 4-OHT. Mice then returned to their home-cage until the time of sacrifice 7 days after TRAPing. Animals were randomly assigned to experimental groups, and animals assigned to different experimental conditions were run in parallel.

Fear conditioning

TRAP2;Ai14 mice were habituated to the conditioning chamber and tones for 15 min per day for 3 days. On the fourth day (Day 0), they were either fear conditioned (FC, 1d, 7d, 14d groups) or presented with the same number of tones but no shocks in the conditioning chamber (NS group). The fear-conditioning chamber consisted of a square cage (18 × 18 × 30 cm) with a grid floor wired to a shock generator and a scrambler, surrounded by an acoustic chamber (Coulbourn Instruments). We used two tones in a differential auditory fear conditioning protocol (CS+: 4 kHz, 30 s, ~75 dB and CS: white noise, 30 s, ~75 dB). Our fear conditioning protocol consisted of 4 baseline tones (2CS+, 2CS, interleaved), followed by interleaved presentations of 8 × CS+, which co-terminated with a 1 s, 0.5 mA footshock, and 5× CS, which were not paired with a shock. During a 1d memory retrieval session, FC and 1d animals returned to the conditioning chamber and after a 1-min contextual baseline were presented with interleaved 8× CS+ and 4× CS. 7d or 14d after training, the 7d or 14d group returned to the conditioning chamber for an identical retrieval session. NS controls were balanced across groups, with the 1st retrieval occurring on day 1, 7, or 14. Twenty-eight days after fear conditioning, all 5 groups returned to the conditioning chamber for an identical remote memory retrieval session. In optogenetic experiments, after a baseline period of 1 min, mice were presented with two photstimulation periods in the absence of tones, and 6× CS+ and 6× CS, half of which were paired with photostimulation. These mice underwent a third retrieval session on day 29 in the same chamber, except the shock floor was replaced with a thin wire grid floor. Following a 1-min baseline and two photostimulation periods in the absence of tones, mice were presented with 6 × CS+, half of which were paired with photostimulation. Freezing was automatically quantified using FreezeFrame software, except for optogenetic stimulation experiments during which the patch-cable interfered with automatic detection of freezing. These videos were scored manually by a blind observer. Groups represent pooled results from multiple, independently-run behavioral cohorts (NS: 8, FC: 5, 1d: 7, 7d: 8, 14d: 4 cohorts). Four animals were excluded from the study due to mistargeted optical fibers. Animals were randomly assigned to experimental groups, animals assigned to different experimental conditions were run in parallel, and there was no randomization in the organization of stimulus presentations.

Histology and immunostaining

Animals were perfused transcardially with phosphate buffered saline (PBS) followed by 4% paraformaldehyde (PFA). Brains were dissected, post-fixed in 4% PFA for 12–24 h and placed in 30% sucrose for 24–48 h. They were then embedded in Optimum Cutting Temperature (OCT, Tissue Tek) and stored at −80°C until sectioning. 60-μm floating sections were collected into PBS. For Fos immunostaining, sections were incubated in 0.3% PBST and 10% donkey serum for 1 h and then stained with rabbit anti-Fos (Synaptic Systems 226-003, 1:10,000) and chicken anti-GFP (for brains that received AAV-DIO-ChR2-eYFP, AVES Labs GFP 1020, 1:2000) for five nights at 4°C in 0.3% PBST and 3% donkey serum. All sections were washed 3 × 10 min in PBS and additionally stained with Donkey anti-Rabbit Alexa 647 (Jackson Immunoresearch 711-605-152, 1:1000) and Donkey anti-Chicken Alexa 488 (Jackson Immunoresearch 702-545-155, 1:1000) in 0.3% PBST and 5% donkey serum for 2 h at room temperature and then washed once 1 × 10 min in PBS, then with PBS containing DAPI (1:10,000 of 5 mg mL–1, Sigma-Aldrich) in PBS for 10–15 min, and then washed once more with PBS prior to mounting onto Superfrost Plus slides and coverslipping with Fluorogel (Electron Microscopy Sciences). Confocal images were obtained with a Zeiss LSM 780 by a blind experimenter and Fos+ nuclei were quantified in a semi-automated fashion using a custom ImageJ macro. Layer analysis was done using custom MatLab software as described previously44.

Virus injections and fiber implants

For optogenetic activation experiments, we used an AAV-DJ containing EF1a-DIO-ChR2-eYFP34 (2 × 1011 genomic copies (GC) mL–1) produced by the Stanford Viral Vector Core. During surgery, animals were anesthetized with 1–2% isoflourane (VetOne). To target PL, the needle was placed 1.8 mm anterior, 0.45 mm lateral, and 2.3 mm ventral to bregma50. 0.4 μl of ChR2 virus was injected into the left hemisphere of 5–6 week old mice using a stereotactic apparatus (KOPF). After injecting the ChR2 virus, a chronic fiber (ThorLabs CFMLC22L01 Fiber Optic Cannula, Ø1.25 mm Ceramic Ferrule, Ø200 µm Core, 0.22 NA, L = 2 mm) was implanted directly above the injection site and secured with Metabond (Parkell, S371, S398, S398). For optogenetic inhibition experiments, we used an AAV-DJ vector containing EF1a-DIO-iC++-eYFP36 (7.2 × 1013 GC mL–1) produced by the Stanford Viral Vector Core. After injecting the iC++virus, a chronic fiber (Bifurcated Fiber Bundle, Ø200 µm Core, 0.22 NA, FC/PC to Ø2.5 mm Ferrules, L = 2 mm) was implanted bilaterally above the injection sites and secured with Metabond. For axon tracing, we used an AAV vector containing CAG-FLEx-mGFP-2A-Synaptophysin-mRuby51 (5 × 1012 GC mL–1) produced by the UNC Viral Vector Core. For hM4D experiments, animals were injected bilaterally into PL with 0.4 μl AAV-DJ containing either CaMKIIa-mCherry (1.1 × 1013 GC/mL) or CaMKIIa-hM4D(Gi)-mCherry (1.5 × 1012 GC mL–1), and then unilaterally with AAV-DJ-EF1a-DIO-ChR2-eYFP as described above. After recovery, animals were housed in a regular 12 h dark/light cycle with food and water ad libitum.

Optogenetic stimulation during behavior

Optical stimulation through the fiber-optic connector was administered by delivering light through a patch-cord connected to a 473-nm laser. Stimulation was delivered at 5-Hz, 15-ms pulses (ChR2) with 8–10 mW power at the fiber tip, or continuously (iC++) with 2 mW power at the fiber tip. During fear retrieval, mice received 40-s bouts of photostimulation. Two bouts occurred in a period prior to the onset of the first tone for contextual fear memory. During the test for auditory fear memory, half of the tones coincided with photostimulation that began 10 s before the 30-s tone started. During real-time place aversion, mice were placed in a two-chambered box (25 cm by 50 cm) with behavior monitored by a webcam (Logitech). On day 1, mice were habituated to the chamber for 5 min and then a 15-min baseline was collected with the patch cord attached. The following day, mice returned to the chamber and preferred side was paired with photostimulation with the 473-nm laser (5 Hz, 15 ms, 8–10 mW). Video was acquired and the time spent in each chamber was automatically quantified using BioviewerIII software.

Chemogenetic manipulation during behavior

Clozapine-N-Oxide (CNO, ApexBio A3317) was dissolved in DMSO at a concentration of 0.1 mg µL–1 and stored at –20°C. Immediately before the experiment, the stock was dissolved in 0.9% NaCl to generate a working solution of 0.5 mg mL–1. Each animal received an intraperitoneal injection of CNO at 5 mg kg–1 30 min before fear conditioning52,53.

iDISCO+ sample processing

Modifications and continuous updates to the protocol can be found at http://www.idisco.info. Animals were perfused transcardially with PBS followed by 4% PFA. All harvested samples were post-fixed overnight at 4°C in 4% PFA in PBS, and processed with the iDISCO+ immunolabeling protocol, as detailed previously30. Samples were stained with the following primary antibodies: Fos (Synaptic Systems 226 003) at 1:500, RFP (Rockland 600-401-379) at 1:300, GFP (AVES Labs GFP 1020) at 1:2000. Alexafluor 647 or 568 secondary antibodies (ThermoFisher Scientific) were used at the same concentrations as the primary antibodies in each case.

iDISCO+ imaging

At least one day after clearing, iDISCO+ samples were imaged by a blind experimenter on a light-sheet microscope (Ultramicroscope II, LaVision Biotec) equipped with a sCMOS camera (Andor Neo) and a 2×/0.5 NA objective lens (MVPLAPO 2×) equipped with a 6 mm working distance dipping cap. Version v285 of the Imspector Microscope controller software was used. We imaged using 488-nm, 561-nm, and 640-nm lasers. The samples were scanned with a step-size of 3 µm using the continuous light-sheet scanning method with the included contrast adaptive algorithm for the 640-nm channel (20 acquisitions per plane), and without horizontal scanning for the 488-nm autofluorescence and 561-nm channels.

Image processing and analysis

Cell and axon counts were calculated blind to experimental conditions. iDISCO+ samples immunostained for Fos+ and tdTomato+ cells (in Ai14 mice) were quantified using the ClearMap cell detection module30, with cell detection parameters optimized and validated by two expert users based on the intensity and shape parameters of each antibody’s immunolabeling profile (specific values used for ClearMap’s Image Processing Modules available upon request). To analyze GFP+ axons, a two-dimensional pixel classifier was trained in Ilastik (www.Ilastik.org) using ~15 images from each of four brains. Autofluorescent fiber tracts were separated from labeled axons with a second pixel classifier. The image stack of autofluorescence in the 488 nm channel was aligned to the Allen Institute’s Common Coordinate Framework (CCF) using the Elastix toolbox and subsequently, the processed stack of axons was transformed to the same coordinates. Voxels classified as axons were equally thresholded in all brains and counted by regions as described in the 2017 CCF. Within the Allen’s hierarchy of brain areas, regions distinguished solely by layers or anatomical location were collapsed into their ‘parent’ region (or example, layers 1–6 of both dorsal and ventral anterior cingulate area are labeled as ‘anterior cingulate area’). These decisions were made prior to analysis. Resultant innervation probability maps were binarized and axon-positive voxels were then aligned using ClearMap registration toolbox30 and analyzed using custom MatLab software. Reported values of axonal labeling density for individual brain regions are normalized to region volumes.

Statistical methods

No statistical methods were used to pre-determine sample sizes, but our sample sizes are similar to those reported in previous publications (for example, ref. 7,11,44). Data distribution was assumed to be normal when we performed ANOVA and t-tests, but these were not formally tested.

Analyses of the TRAP and Fos whole-brain counts were performed in Python. In Fig. 5c–d, TRAPed cells were quantified per brain area using ClearMap30, and then visualized using tSNE39 applied to the per-mouse count data for each area. To cluster the TRAP brains, the shared-nearest-neighbor algorithm with multilevel community detection, using Jaccard similarity as a metric, was applied54. This algorithm attempted to cluster brain areas based on the amount of TRAPing within that area per mouse, and automatically determined that the brain areas were divided into three clusters. For correlation with behavioral characteristics (Fig. 5e–h and Supplementary Fig. 12), the tSNE plots were colored by Pearson correlation between counts per area and the tone discrimination index, the CS+ freezing time, and the context freezing time.

To further analyze Fos data, the number of Fos+ cells per brain area was first normalized by the volume of that area in the Allen Brain Atlas. Statistical tests between counts in 1-day and 14-day conditions were computed using a t-test, and then were false discovery rate (FDR) corrected (Fig. 6h and Supplementary Table 4). To visual the Fos data in two-dimensional space, principal components analysis was applied to these normalized, per area counts to find the axes that would capture the most variance across different brain areas. The per-animal data across all brain areas was then projected onto the first two principal components (Fig. 6f,g). All computations were performed using scikit-learn and NumPy.

Exclusion criteria are reported in Methods. Summary graphs represent mean ±SEM. The statistical tests, including post-hoc tests for multiple comparisons, are reported in the figure legends along with the definition of n. Significance was defined as alpha = 0.05 or FDR = 0.1, and statistical tests were performed in Prism (GraphPad). Paired t-tests were two-tailed.

Statistics and reproducibility

Characterization of whole-brain TRAPing patterns in FC and NS animals (Fig. 1) are based on n = 4 biologically independent animals per condition, run in parallel through iDISCO+ immunolabeling and light sheet imaging protocols, as recommended by the authors of the iDISCO+ manuscript30. Similar results for TRAP–Fos overlap were obtained in 7, 4, 3, 2, and 2 independent cohorts of animals for NS, FC, 1d, 7d, and 14d conditions, respectively (Fig. 2). Similar results for optogenetic activation with ChR2 were obtained in 5, 5, 6, and 3 independent cohorts of animals for FC, 1d, 7d, and 14d conditions, respectively (Fig. 3, Supplementary Fig. 8). Similar results for optogenetic inhibition were obtained in 2 independent cohorts of animals per condition (Fig. 4 and Supplementary Fig. 11). Similar results for correlating behavioral data with whole-brain TRAPing patterns for 4 and 3 cohorts of 1d- and 14d-TRAPed animals, respectively (Fig. 5 and Supplementary Fig. 12). Characterization of whole-brain axon innervation patterns in 1d and 14d-TRAPed animals (Fig. 6) are based on n = 5 and n = 3 biologically independent animals, respectively, run in parallel through iDISCO+ immunolabeling and light sheet imaging protocols.

Reporting Summary

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