Long-term stability of cortical ensembles
Figures

Experimental protocol.
(A) Experimental setup: a mouse with a cranial window is placed on a treadmill in front of a blue screen monitor, and it is head-fixed under the two-photon microscope for calcium imagin. (B) Static blue screen was used to record spontaneous activity during 5 min, three sessions per day, 5 min apart between them. (C) Visual stimulation protocol constituted of 50 repetitions of a 2 s single-orientation drifting gratings with a mean static screen between each of them during 1–5 s randomly to record evoked activity for 5 min, three sessions per day, 5 min apart between them. (D) Strategy to image the same neurons in the field of view on different days: (left) a single plane was carefully located in a reference recorded position (day 1), then two extra planes also were imaged separated 5 µm up and down. Three planes were imaged in a period of 81 ms. (Right) Maximum intensity projection was obtained from the three planes generating a single frame. Scale bar: 50 µm. (E left) Detection of regions of interest (ROIs; gray shapes) based on Suite2P algorithm, green ROI is used as a representative example, scale bar: 50 µm; (up right) extraction of calcium signal (ΔF/F0) with peak signal-to-noise ratio (PSNR) >18 dB; (middle right) spike inference using foopsi algorithm; (bottom right) a binary signal obtained by thresholding spike inference, which is used to represent the active frames of the neuron. (F) Raster plot built with binary signals from active neurons recorded simultaneously. Each row represents the activity of a single neuron, black dots represent the activity of the neuron. (G) Center of an example image at 4× zoom (white square on D right) recorded in the same location up to 46 days after the first day of recording. Note that image at day 46 is noisier than on the first days. Scale bar: 12.5 µm. (H) Count of active neurons in different days. The number of active neurons identified on day 1 decreased significantly on days 43–46 during spontaneous and evoked activity (p=0.023 and p=0.013, respectively). (I) Percentage of single-neuron activity, that is, percentage of frames a neuron was active. The average activity of all neurons was ~15% on all days during spontaneous and evoked activity. (J) Merge of active neuron ROIs from two sessions: first session from day 1 (green in four panels) versus a second single session from same day 1 (5 min later), one session from days 2, 10, and 46 (from left to right, respectively, magenta). The intersection of active neurons in both sessions is in gray color. Scale bar: 50 µm. (K) Percentage of active neurons between two sessions: first session from day 1 (green) versus second sessions from days 1, 2, 10, and 46 (magenta). Common active neurons (gray) in both sessions were 42% ± 2% during spontaneous and 37% ± 4% during evoked activity. There were no significant differences on common active neurons between days 1 and 2, but a significant decrease on days 10 and 43–46 during spontaneous (p=2 × 10–6 and p=4 × 10–9, respectively) and evoked activity (p=2 × 10–4 and p=4 × 10–9, respectively). Data are presented as mean ± SEM. Kruskal–Wallis test with post hoc Tukey–Kramer: *p<0.05, **p<0.01, and ***p<0.001. See Figure 1—source data 2.
-
Figure 1—source data 1
Mice and recording days.
- https://cdn.elifesciences.org/articles/64449/elife-64449-fig1-data1-v2.docx
-
Figure 1—source data 2
Neuronal activity across days.
- https://cdn.elifesciences.org/articles/64449/elife-64449-fig1-data2-v2.docx

Active neurons in different session durations.
(A) Total number of active neurons (mean ± SEM, n = 2 mice) between two sessions on the same day with equal duration, sessions started from 10 s to 10 min. An exponential function was fitted (R2 = 0.99). Note that the number of active neurons started a plateau around 5 min of recording length. (B) Percentage of common active neurons between the sessions showed in (A). An exponential function was fitted (R2 = 0.77) and started a plateau around 3 min increasing slowly as the session’s length increases.

Possible causes of the loss of neurons recorded across days.
(A) Displacement between recording days on the z-plane. (B) Average of running average across days during spontaneous or visually evoked activity. (C) Discarded neurons due to poor peak signal-to-noise ratio (PSNR <18 dB). Data are presented as mean ± SEM. Kruskal–Wallis test with post hoc Tukey–Kramer: *p<0.05.

Chronic cranial window across days.
(A) Pictures of the cranial window of every mouse across days, mice are sorted by the decrease in number of active neurons showed in (C). (B) Schematic of the location we placed the coverslip and performed the recordings (gray squares). (C) Active neurons with good signal quality (peak signal-to-noise ratio [PSNR] >18 dB) recorded across days, normalized to day 1.

Single-neuron activity and its locomotion correlation across days during spontaneous activity.
(A) Example of spontaneous activity from a GCaMP6f mouse. Common neurons from days 2 and 46 are sorted based on their linear correlation with the mouse locomotion. Shading cyan highlights the neurons with positive locomotion correlation. (B) Calcium signals of representative neurons from (A). One neuron with negative locomotion correlation (gray) and one with positive locomotion correlation (cyan). (C) Mouse locomotion on days 2 and 46. (D) Linear correlation between single-neuron activity and locomotion during days 2 (blue) and 46 (red). The change in locomotion correlation between days is represented with black lines. (E) Change in locomotion correlation between day 1 and the following days. The median of the change is near zero on all days (0.5 × 10–3, 2 × 10–3, 8 × 10–3, and 6 × 10–3 on days 1, 2, 10, and 43–46, respectively). Sign test: *p<0.05 and **p<0.01. †Two mice (5 and 6) were compared with day 2 instead of day 1.

Single-neuron tuning across days during visually evoked activity.
(A) Example of evoked activity from a GCaMP6f mouse. Common neurons from days 2 and 46 are sorted based on their linear correlation with mouse locomotion (C). Shading highlights the neurons with positive locomotion correlation (cyan), neurons tuned to the interstimulus periods (yellow), and tuned to the visual stimulus (magenta). (B) Calcium signals of representative neurons from (A) with negative locomotion correlation (gray), positive locomotion correlation (cyan), tuned to interstimulus periods (yellow), and tuned to the visual stimulation (magenta). (C) Mouse locomotion on days 2 and 46. (D) Linear correlation between neuronal activity and locomotion during days 2 (blue) and 46 (red). The change in locomotion correlation between days is represented with black lines. (E) Rate of evoked activity during visual stimulation divided by the total activity during days 2 (blue) and 46 (red). The change in rate between days is represented with black lines. (F) Change in locomotion correlation between day 1 and the following days. The median of the change was around zero on all days (2 × 10–3, 10 × 10–3, –3 × 10–3, and 10 × 10–3 on days 1, 2, 10, and 43–46, respectively). (G) Change in tuning between day 1 and the following days. The median of the change was around zero on all days (10 × 10–3, –0.9 × 10–3, 8 × 10–3, and –10 × 10–3 on days 1, 2, 10, and 43–46, respectively). Sign test: *p<0.05 and **p<0.01. †Two mice (5 and 6) were compared with day 2 instead of day 1.

Ensemble identification.
(A) Example of a raster plot from a single session from day 1 of a GCaMP6s mouse during evoked activity showing the common neurons between days 1 and 43. (B) Functional neuronal network obtained from raster in (A), where every node represents a neuron and every link represents a functional connection between neurons. The network is plotted preserving the spatial location of the neurons. (C) Method to identify a significant functional connection between neurons. Taking the activity of each pair of neurons a and b (top left), we generated 1000 surrogates by a circular shift of their activity (bottom left), in a random amount of time, to disrupt the temporal dependency. Then, a cumulative distribution probability of the surrogate coactivations for each pair of neurons is built (top right), which is used to define a threshold of the number of coactivations at 95% of chance. Then we put a functional connection between those neurons if they reach a significant number of coactivations (p<0.05), that is, a number of coactivations bigger than the threshold. (D, top) Raster (A) filtered based on functional connectivity (B). We removed activity from neurons with no significant coactivity. (Bottom) Jaccard similarity between every column vector (single frame). (E, top) Column vectors from raster in (D) sorted by hierarchical clustering using single linkage based on its Jaccard similarity (bottom). Red dotted line indicates the most similar vectors depicted by thresholding the hierarchical clustering with Jaccard similarity >2/3. (F, top) Most similar vectors in (E) sorted by hierarchical clustering using Ward linkage based on Jaccard similarity (bottom) and grouped in different ensembles (different color each) based on the contrast index. (G, top left) Same sorted vectors in (F) but here the neurons were sorted depending on their belonging ensemble (top right). (Bottom) Functional neuronal networks representing the ensembles plotted to preserve the spatial location of the neurons.

The number of functional connections of a neuron is independent of its level of activity.
(A) Percentage of time that a common neuron was active and the percentage of its functional connections during spontaneous. Functional connections were normalized to the maximum possible connections. Both measures were taken from day 1. (B) Same as (A) but during evoked activity.

Number of ensembles in spontaneous and evoked activity.
(A) Distribution of the number of ensembles found during spontaneous (top) and evoked activity (bottom) across days. No significant differences were found between day 1 and the following days during spontaneous and evoked activity (day 2, p=0.97 and p=0.86; day 10, p=0.41 and p=0.99; and days 43–46, p=0.60 and p=0.99, respectively; Kruskal–Wallis test, post hoc Tukey–Kramer).

Stable and transient ensembles across days.
(A) Example of raster plot from days 1 and 43 of a GCaMP6s mouse during evoked activity showing the common neurons between days 1 and 43. (Left) Stable ensembles activity sorted by ensemble (background colors show different ensembles) and day (color lines divide the activity from each day in each ensemble). (Middle) Transient ensembles activity sorted by day. (Right) Identity structure of the neuronal ensembles. Ensemble robustness values are at the bottom of each ensemble activity. Ensemble robustness is computed per ensemble per single session. (B) Functional networks from ensembles in (A) preserving the spatial location of the neurons. Stable (top) and transient (bottom) ensembles separated by day observed. At bottom of each ensemble are values of the number of neurons and the density of the functional connectivity within the ensemble. (C) Number of stable and transient ensembles during spontaneous (left) and evoked (right) activity on all days recorded. (D) Number of neurons per ensemble with no significant difference between stable and transient ensembles during spontaneous (left) and evoked (right) activity on all days recorded. (E) Density of functional ensemble networks had no significant difference between stable and transient ensembles during spontaneous (left) and evoked (right) activity in almost all days, with one exception from evoked activity on day 10. (F) Ensemble robustness was significantly higher in stable than transient ensembles during spontaneous activity (left) and evoked (right) activity in all days, with one exception from spontaneous activity on day 10. Mann–Whitney test: *p<0.05, **p<0.01, and ***p<0.001. See Figure 3—source data 1.
-
Figure 3—source data 1
Statistics of stable and transient ensembles.
- https://cdn.elifesciences.org/articles/64449/elife-64449-fig3-data1-v2.docx
-
Figure 3—source data 2
Mice and recording days from Allen Brain Observatory Visual Coding dataset.
- https://cdn.elifesciences.org/articles/64449/elife-64449-fig3-data2-v2.docx
-
Figure 3—source data 3
Mice from Churchland Lab dataset.
- https://cdn.elifesciences.org/articles/64449/elife-64449-fig3-data3-v2.docx

Shuffling controls.
(A) Distribution of the number of ensembles found during the real activity versus shuffled activity. (B) Distribution of the length of time the ensembles found were present during the actual activity versus the expected by chance shuffling the activity. (C) Number of ensembles found during spontaneous (top) and evoked (bottom) activity through the days compared with the shuffled version (p<0.001 for all comparisons; Mann–Whitney test). (D) Length of time the ensembles were present during spontaneous (top) and evoked (bottom) activity through the days compared with the shuffled version (p<0.001 for all comparisons; Mann–Whitney test).

Correlation of stable ensembles and locomotion across days during spontaneous activity.
(A) Linear correlation between single-ensemble activity and locomotion during day 1 (blue) and the following sessions (red). The change in locomotion correlation between days is represented with black lines. Here are all the stable ensembles found from six mice during spontaneous activity sorted by their correlation with locomotion. (B) Histogram of the values of the correlation in (A) from day 1 (blue) and the following sessions (red). (C) Change in locomotion correlation between day 1 and the following days. The median of the change is around zero on all days (14 × 10–3, –13 × 10–3, 38 × 10–3, and 7 × 10–3 on days 1, 2, 10, and 43–46, respectively). Sign test: *p<0.05 and **p<0.01. †Two mice (5 and 6) were compared with day 2 instead of day 1.

Stable ensemble tuning across days during visually evoked activity.
(A) Linear correlation between single-ensemble activity and locomotion during day 1 (blue) and the following sessions (red). The change in locomotion correlation between days is represented with black lines. Here are all the stable ensembles found on six mice during visual stimulation sorted by their evoked responses (see D). (B) Histogram of the correlation values in (A) from day 1 (blue) and the following sessions (red). (C) Change in locomotion correlation between day 1 and the following days. The median of the change is around zero on all days (4 × 10–3, 20 × 10–3, –26 × 10–3, and 5 × 10–3 on days 1, 2, 10, and 43–46, respectively). Sign test: *p<0.05 and **p<0.01. †Two mice (5 and 6) were compared with day 2 instead of day 1. (D) Rate of evoked activity during visual stimulation divided by the total activity between day 1 (blue) and the following sessions (red). The change in rate between days is represented with black lines. (E) Histogram of the activity rate from (D) from day 1 (blue) and the following sessions on days 1, 2, 10, and 43–46 (red). (F) Change in tuning between day 1 and the following sessions across days. The median of the change was around zero on all days (13 × 10–3, –12 × 10–3, 46 × 10–3, and 0 × 10–3 on days 1, 2, 10, and 43–46, respectively). Sign test: *p<0.05 and **p<0.01. †Two mice (5 and 6) were compared with day 2 instead of day 1.

Ensemble stability analysis varying the threshold to define stable ensembles.
(A) Number of stable and transient ensembles during spontaneous (left) and evoked (right) activity on all days recorded using different threshold to define stability. Colors from blue to green represent the increment of the threshold, and red represents the data used in the main Figure 3. (B) Count of neurons per ensemble of stable and transient ensembles during spontaneous (left) and evoked (right) activity on all days recorded. (C) Density of the functional ensemble networks of stable and transient ensembles during spontaneous (left) and evoked (right) activity in almost all days. (D) Ensemble robustness of stable and transient ensembles during spontaneous activity (left) and evoked (right) activity. Data are presented as mean (dot) ± SEM (shaded). Kruskal–Wallis test between methods or datasets and data from the main figures of this study, and post hoc Tukey–Kramer: *p<0.05, **p<0.01; ***p<0.001. (E) Jaccard similarity formula used to define stability of an ensemble between two sessions (top) and an example (bottom).

Ensemble stability analysis by different methods and datasets.
(A) Number of stable and transient ensembles during spontaneous (left) and evoked (right) activity on all days recorded using different methods and datasets. Colors identify the method used or dataset. Allen Brain Institute and Churchland Lab datasets were analyzed by using the main method described in this study. Red color represents the data used in the main Figure 3. (B) Count of neurons per ensemble of stable and transient ensembles during spontaneous (left) and evoked (right) activity on all days recorded. (C) Density of the functional ensemble networks of stable and transient ensembles during spontaneous (left) and evoked (right) activity in almost all days. (D) Ensemble robustness of stable and transient ensembles during spontaneous activity (left) and evoked (right) activity. Data are presented as mean (dot) ± SEM (shaded). Kruskal–Wallis test between methods or datasets and data from the main figures of this study, and post hoc Tukey–Kramer: *p<0.05.
Stable ensembles in spontaneous activity on days 1 and 46.
Raw videos of 2 min length (accelerated 5x) from days 1 (top-left) and 46 (top-right). Circles are identifying neurons from stable neuronal ensembles, colors represent different ensembles. Scale bar: 50 µm. At the bottom, the summation of calcium signals from each ensemble.
Stable ensembles in evoked activity on days 1 and 46.
Raw videos of 2 min length (accelerated 5x) from days 1 (top-left) and 46 (top-right). Circles are identifying neurons from stable neuronal ensembles, colors represent different ensembles. Scale bar: 50 μm. At the bottom, the summation of calcium signals from each ensemble.

Long-term stability of spontaneous and evoked ensembles.
(A) Example of spontaneous ensemble activity. Neurons are sorted based on their ensemble identity (right). (B) Example of evoked ensemble activity. Neurons are sorted based on their ensemble identity, and it is indicated if they were tuned to the visual stimulation (right). The first ~500 ms (of the 2 s) of every visual stimulation (50 per session) are marked at the bottom of the raster activity. Note that there is a particular stable neuronal ensemble (blue ensemble) mainly evoked at the onset of the visual stimulation. (C) Neuronal ensembles across days (identified independently). (Top) Neuronal identity sorted as in (A). (Bottom) Colors indicate the ensemble to which neurons belonged, white color indicates no participation in any stable ensemble. Scale bar: 50 µm. (D) Neuronal ensembles across days (identified independently). (Top) Neuronal identity sorted as in (B). (Bottom) Colors indicate the ensemble to which neurons belonged, white color indicates no participation in any stable ensemble, gray color indicates participation in more than one stable ensemble. Scale bar: 50 µm. (E) Fraction of neurons during spontaneous (top) or evoked (bottom) activity across days which participated in two or more stable ensembles (shared), only one (single), and without participation in any stable ensemble. (F) Fraction of neurons during spontaneous (top) and evoked (bottom) activity across which remained in the same ensemble (stable), changed their ensemble or stopped participating (lost), and new neurons. (G) Fraction of stable neurons during spontaneous (top) and evoked (bottom) activity from days 1, 2, 10, and 43–46 which participated in one stable ensemble (single) or more (shared). (H) Network density within stable ensembles during spontaneous (top) and evoked (bottom) activity was significantly higher in stable neurons than lost neurons (p<0.01). Density was computed from functional connectivity analyzed on day 1. Data are presented as mean ± SEM. Mann–Whitney test: **p<0.01 and ***p<0.001. See Figure 4—source data 1.
-
Figure 4—source data 1
Neuronal composition of stable ensembles.
- https://cdn.elifesciences.org/articles/64449/elife-64449-fig4-data1-v2.docx

Ensemble structure varying the threshold to define stable ensembles.
(A) Fraction of neurons during spontaneous (top) or evoked (bottom) activity across days which participated in two or more stable ensembles (shared), only one (single), and without participation in any stable ensemble. We used different values of the threshold to define stability. Colors from blue to green represent the increment of the threshold, and red represents the data used in the main Figure 4. (B) Fraction of neurons during spontaneous (top) and evoked (bottom) activity across days which remained in the same ensemble (stable), changed their ensemble or stopped to participate (lost), and new neurons. (C) Fraction of stable neurons during spontaneous (top) and evoked (bottom) activity across days which participated in one stable ensemble (single) or more (shared). (D) Network density within stable ensembles during spontaneous (top) and evoked (bottom) activity across days (p<0.01). Density was computed from functional connectivity analyzed on day 1. Data are presented as mean (dot) ± SEM (shaded). Kruskal–Wallis test between methods or datasets and data from the main figures of this study, and post hoc Tukey–Kramer: *p<0.05, **p<0.01; ***p<0.001.

Ensemble structure using different methods and datasets.
(A) Fraction of neurons during spontaneous (top) or evoked (bottom) activity across days which participated in two or more stable ensembles (shared), only one (single), and without participation in any stable ensemble using different methods and datasets. Colors identify the method used or dataset. Allen Brain Institute and Churchland Lab datasets were analyzed by using the main method described in this study. Red color represents the data used in the main Figure 4. (B) Fraction of neurons during spontaneous (top) and evoked (bottom) activity across days which remained in the same ensemble (stable), changed their ensemble or stopped to participate (lost), and new neurons. (C) Fraction of stable neurons during spontaneous (top) and evoked (bottom) activity across days which participated in one stable ensemble (single) or more (shared). (D) Network density within stable ensembles during spontaneous (top) and evoked (bottom) activity across days (p<0.01). Density was computed from functional connectivity analyzed on day 1. Data are presented as mean (dot) ± SEM (shaded). Kruskal–Wallis test between methods or datasets and data from the main figures of this study, and post hoc Tukey–Kramer: *p<0.05, **p<0.01; ***p<0.001.

Persistence of neuronal sequences using seqNMF toolbox.
(A) Example of neuronal sequences detected (factor exemplars, left) from the neuronal activity of common neurons across days (right) during spontaneous activity. On top are the amplitudes at which each sequence occurs (temporal loadings). (B) Same as (A) but during evoked activity.
Tables
Reagent type (species) or resource | Designation | Source or reference | Identifiers | Additional information |
---|---|---|---|---|
Strain, strain background (mice) | Slc17a7-IRES2-Cre | JAX stock # 023527 | VGlut1 | |
Strain, strain background (mice) | TIT2L-GC6s-ICL-tTA2 | JAX stock # 031562 | TIGRE2.0 Ai162 | |
Strain, strain background (mice) | TIT2L-GC6f-ICL-tTA2 | JAX stock # 030328 | TIGRE2.0 Ai148 | |
Software, algorithm | Drifting gratings generator for visual stimulation | This paper | https://www.mathworks.com/matlabcentral/fileexchange/78670-drifting-gratings-generator-for-visual-stimulation | |
Software, algorithm | ETL controller for volumetric imaging | This paper | https://www.mathworks.com/matlabcentral/fileexchange/78245-etl-controller-for-volumetric-imaging | |
Software, algorithm | Catrex GUI | This paper | https://github.com/PerezOrtegaJ/Catrex_GUI (copy archived at swh:1:rev:2ffc0749535be40ca2331f4c969a82fbfff102d4) | |
Software, algorithm | Neuronal Ensemble Analysis | This paper | https://github.com/PerezOrtegaJ/Neural_Ensemble_Analysis (copy archived at swh:1:rev:9d37fd031dfbdb4eb69faa449d0a6416267a7d4f) |