Sovereign 8s.is mirror of standardgalactic/pCCA-Hippocampus
  • Jupyter Notebook 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-05-11 18:46:53 -04:00
load_dataset.ipynb Rename load_data_nwb.ipynb to load_dataset.ipynb 2026-01-20 19:55:44 -03:00
load_dataset_dandi_colab.ipynb Se creó con Colab 2026-01-17 15:39:33 -05:00
pCCA_example_CA1-CA3-RSC.ipynb Rename Example_pCCA_CA1-CA3-RSC.ipynb to pCCA_example_CA1-CA3-RSC.ipynb 2026-01-20 19:56:19 -03:00
pCCA_simulation.ipynb Update pCCA_simulation.ipynb 2026-01-20 18:36:28 -03:00
README.md Update README.md 2026-05-11 18:46:53 -04:00

pCCA-Hippocampus

Codes and Examples to apply partial canonical correlation analysis (pCCA) on neuronal population recordings. Papers applying this code: (doi:10.1038/s41586-026-10481-z).

Examples & Tutorials:

Four notebooks are provided showing:

  1. How to load data from the hippocampal-neocortical DANDI set on a local machine;
  2. How to load data from the hippocampal-neocortical DANDI set on a colab notebook straight from DANDI server;
  3. How to run pCCA on a simple Poisson spiking network (colab notebook);
  4. how to run pCCA on real spiking data collected from CA3-CA1-RSC areas during novel maze learning on mice (jupyter notebook to be run locally).

All recordings can be downloaded from: https://dandiarchive.org/dandiset/001695

Installation

pip install partial_CCA

Quick Start The PartialCCA class follows the standard scikit-learn API (fit, transform, score).

Usage in Python:

import numpy as np
from partial_CCA import PartialCCA

# Generate dummy data: 100 samples, 20 neurons in X, 15 in Y, 5 in Z
X = np.random.randn(100, 20)
Y = np.random.randn(100, 15)
Z = np.random.randn(100, 5)

# Initialize and fit the model
model = PartialCCA()
model.fit(X, Y, Z)

# Transform data into canonical components
proj_x, proj_y = model.transform(X, Y)

# Get canonical correlations
print(model.canonical_correlations_)

Features: If no variable Z is provided, the model automatically defaults to standard Canonical Correlation Analysis (CCA). Statistical Validation: Includes a surrogate_test method that uses circular shifting to calculate p-values for the observed correlations.

Authors: Joaquin Gonzalez (https://scholar.google.com/citations?user=rcGEkDgAAAAJ&hl=en). Postdoc, Buzsaki Lab (https://buzsakilab.com/wp/) and Chen Lab (https://cn3laboratory.org/pi.html). New York University