Skip to content

GiocomoLab/Herber2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Herber2024

Code to replicate analyses in Herber et al. 2024

Instructions:

  1. Download data from the Dryad repository (https://doi.org/10.5061/dryad.8cz8w9h0d) locally and unzip subfolders. Clone this repository.
  2. Install & update conda. Ensure that Python version 3.8.16 is accessible to conda.
  3. Create an environment matching the content of the aging MEC environment (conda create --name agingmec --file agingmec_env.txt python = 3.8.16)
  4. In this environment, run all code in the notebook "Import & Filter MATLAB Data" adjusting paths to match your machine. This will generate a local filtered copy of the neural and behavioral data in Python accessible .npy files. This is a pre-requisite for any additional analysis and takes ~30-40 minutes to run for all sessions across both the Split Maze (SM) and Random Foraging (RF) tasks.
  5. Run the notebook "Shuffle Procedure" at least through the classification of putative inhibitory interneurons. After that, you have the option of using the output of the rest of the notebook (Dryad repo > shuffle_scores) or generating it yourself. If you would like to regenerate shuffle scores, note that the shuffle procedure required to identify functional cell types (e.g. spatial, grid, non-grid spatial, speed cells) is computationally intensive and/or time- consuming. This is a necessary step before proceeding with neural analyses starting in Figure 2. You may find it helpful to run the shuffle using a cluster.
  6. To recapitulate results in individual figures except Figure 4, run code in the corresponding Python notebooks using the agingmec env, adjusting paths as needed. It is recommended to run the figures in the following order: Fig. 1/Supplementary Fig. 1, Supplementary Fig. 2, Fig. 2/Supplementary Fig. 3, Fig. 3/Supplementary Fig. 4, Fig. 5, Supplementary Fig. 5, Fig. 6, and then Supplementary Fig. 6, followed by the Fig. 7/8/Supplementary Fig. 8 notebook. In particular, Fig. 2/Supplementary Fig. 3 uses Supplementary Fig. 2 outputs; Fig. 3/Supplementary Fig. 4 and Supplementary Fig. 5 results depend on Fig. 2/Supplementary Fig. 3 outputs; and Supplementary Fig. 5 results depend on Fig. 3/Supplementary Fig. 4 and Fig. 5 outputs. The Fig. 7/8/Supplementary Fig. 8 notebook depends only on Fig. 5 outputs.
  7. To recapitulate results in Figure 4, create an environment matching the context of the LFP world environment (conda create --name LFPworld --file LFPworld_env.txt python = 3.8.16). Then, run the corresponding Jupyter notebook for Figure 4 within that environment.

Important Notes:

A. Several computations, including thresholding against spike time shuffle scores to classify functional cell types (e.g. grid, non-grid spatial, spatial, speed cells) and k-means hyperparameter optimization, rely on randomized functions. This leads to modest stochasticity in results, particularly if users run all code from raw or pre-processed data. We have verified that overall results are not impacted by this stochasticity, though effect sizes and p-values may differ slightly within an order of magnitude. In particular, if users generate shuffle scores (see Step 4) instead of using the provided shuffle scores, which correspond to the iteration of the shuffle used to generate the results in the paper, users will observe that the exact n of each functional cell type will vary. Similarly, the optimal k to model grid networks' trial by trial spatial firing similarity via k-means clustering will occassionally change with iterations of the hyperparameter optimization procedure in the Fig. 3/Supplementary Fig. 4 notebook. As a result, users will reproduce overall results in Fig. 3/Supplementary Fig. 4 and Supplementary Fig. 5 with slightly differences in exact n values, odds ratios, p-values, and plots. This is because k is set by a procedure involving repetitations of a randomized cross-validation procedure. If two k values generated very similar average silhouette scores across repetitions, iterations of this procedure may result flip the result one way or another. Importantly, we view this as a feature, rather than a flaw, of our analytic approach because conclusions across the paper are not influenced on the inclusion or exclusion of particular cells or the modeling of particular sessions' network activity one way or another.

B. Code to generate figures addressing requests by peer reviewers pertinent to neural or behavior data that were omitted from the final manuscript is included in this repository. Reviewer Figure 1 related to transcriptomic data, so code to replicate it is not included. Some code is infolded in the notebooks above (annotated with the Reviewer Figure number and brief commentary on the motivation and conclusions of the analysis); others are in stand-alone notebooks with a full analysis summary included. In particular, analysis of the impact of the cue tower in the first half of the Split Maze track on context discrimination across age groups (partially included in the paper as Supplementary Fig. 5k; also Reviewer Figure 2) is found in the Supplementary Fig. 5 notebook. Analysis of changes in Split Maze reward zone firing rates of grid and non-grid spatial cells over learning (Reviewer Figure 3) is found in the Reviewer Figure 3 notebook, which requires Supplementary Fig. 2 notebook outputs. Most of Reviewer Figure 4 was included as Supplementary Fig. 2 in the paper; any omitted panels are in the Supplementary Fig. 2 notebook. Recapitulation of Fig. 2 analyses of grid cell spatial firing properties related to Split Maze performance in the larger pool of all MEC spatial cells (Reviewer Fig. 5) and with a lower threshold to identify putative grid cells (Reviewer Fig. 6A-D) are found in the notebooks named Reviewer Figs. 5 and 6, respectively; both notebooks require Extended Data Fig. 2 outputs. Similar recapitulation of Supplementary Fig. 3 results with a lower threshold to identify non-grid spatial cells and Fig. 6 results with a lower threshold to identify speed-tuned cells (Reviewer Fig. 6e-i) are found in the Reviewer Figure 6 notebook. Reviewer Figure 6 analysis demonstrated that key results are resilient to altered thresholds. Reviewer Figure 7 panels may be produced with the Extended Data Fig. 6 notebook, as some panels were included in the revised Supplementary Fig. 6. Finally, Reviewer Figure 8 (single panel) may be produced with the Fig. 3 / Supplementary Fig. 4 notebook.

About

Code to replicate analyses in Herber et al. 2024 and 2025

Resources

Stars

Watchers

Forks

Packages

No packages published