Skip to content

Dimensionality Reduction for Integrated Activity Data

License

Notifications You must be signed in to change notification settings

iabs-neuro/driada

DRIADA

Dimensionality Reduction for Integrated Activity Data β€” a Python framework for analyzing neural population activity at both single-neuron and population levels.

Python Version PyPI version Downloads License Tests codecov Docs Platform

DRIADA connects single-neuron selectivity analysis with population-level dimensionality reduction. Given neural activity and related behavior/environment variables, it identifies which neurons encode which variables, extracts low-dimensional population structure, and links the two.

πŸš€ Tutorials

Interactive notebooks β€” click a badge to open in Google Colab (no setup required):

Notebook Topics
Open In Colab DRIADA overview Experiment objects, feature types, quick tour of INTENSE, dimensionality reduction, networks
Open In Colab Neuron analysis Spike reconstruction, kinetics optimization, quality metrics, surrogates
Open In Colab Selectivity detection (INTENSE) Mutual information, two-stage testing, optimal delays, mixed selectivity
Open In Colab Population geometry & dimensionality reduction PCA, UMAP, Isomap, autoencoders, manifold quality metrics, dimensionality estimation
Open In Colab Network analysis Cell-cell significance, spectral analysis, communities, graph entropy
Open In Colab Advanced capabilities Embedding selectivity, leave-one-out importance, RSA, RNN analysis

All notebooks generate synthetic data internally β€” no external files needed. See the examples reference for 23 standalone scripts covering additional use cases.

πŸ”¬ Key Capabilities

  • 🧠 INTENSE β€” detect neuron-feature selectivity via mutual information with rigorous two-stage statistical testing, delay optimization, and mixed selectivity disentanglement
  • πŸ“Š Dimensionality Reduction β€” linear (PCA), graph-based (Isomap, diffusion maps, LLE), neighbor-embedding (UMAP, t-SNE), and neural network-based (autoencoders) with manifold quality metrics
  • πŸ“ Dimensionality Estimation β€” PCA-based, effective rank, k-NN, correlation, and geodesic dimension
  • πŸ”— Integration β€” map single-cell selectivity onto population manifolds and embedding components
  • 🌐 Network Analysis β€” general-purpose graph analysis (spectral, entropy, communities) for connectomes, functional networks, or dimensionality reduction proximity graphs
  • πŸ“ RSA β€” representational dissimilarity matrices, cross-region and cross-session comparisons
  • πŸ§ͺ Synthetic Data β€” generate populations with known ground truth for validation
  • πŸ”¬ Neuron β€” calcium kinetics optimization (rise/decay fitting), event detection, and signal quality metrics

Data

DRIADA is designed for calcium imaging data but works with any neural activity represented as a (n_units, n_frames) array β€” RNN activations, firing rates, LFP channels, or anything else. Behavioral variables are 1D or multi-component arrays of the same length.

Input workflow: load your arrays into a Python dict and call load_exp_from_aligned_data:

from driada.experiment import load_exp_from_aligned_data
from driada.intense import (compute_cell_feat_significance,
    compute_cell_cell_significance, compute_embedding_selectivity)
from driada.rsa import compute_experiment_rdm
from driada.network import Network
from driada.integration import get_functional_organization
import scipy.sparse as sp

data = {
    'calcium': calcium_array,       # (n_neurons, n_frames) β€” or 'activations', 'rates', etc.
    'speed': speed_array,           # (n_frames,) continuous variable
    'position': position_array,     # (2, n_frames) multi-component variable
    'head_direction': hd_array,     # auto-detected as circular
    'trial_type': trial_type_array, # auto-detected as discrete
}

exp = load_exp_from_aligned_data('MyLab', {'name': 'session1'}, data,
                                 static_features={'fps': 30.0})

feat_stats, feat_sig, *_ = compute_cell_feat_significance(exp)       # neuron-feature selectivity
cell_sim, cell_sig, *_ = compute_cell_cell_significance(exp)         # functional connectivity
net = Network(adj=sp.csr_matrix(cell_sig), preprocessing='giant_cc') # network analysis
embedding = exp.create_embedding('umap', n_components=2)             # dimensionality reduction
rdm, labels = compute_experiment_rdm(exp, items='trial_type')        # representational similarity
emb_res = compute_embedding_selectivity(exp, ['umap'])               # which neurons encode which components
org = get_functional_organization(exp, 'umap',
    intense_results=emb_res['umap']['intense_results'])              # selectivity-to-embedding bridge

You can also load directly from .npz files via load_experiment(). See the RNN analysis tutorial for a non-calcium example.

Installation

pip install driada

# Optional extras
pip install driada[gpu]   # autoencoders, torch-based methods
pip install driada[mvu]   # MVU dimensionality reduction (cvxpy)
pip install driada[all]   # everything

# From source
git clone https://github.com/iabs-neuro/driada.git
cd driada
pip install -e ".[dev]"

DRIADA pulls in ~30 dependencies (numpy, scipy, scikit-learn, numba, joblib, etc.). See pyproject.toml for the full list.

Documentation

πŸ“– driada.readthedocs.io β€” API reference, installation guide, and quickstart πŸ“‹ Changelog β€” release history and migration notes

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

git clone https://github.com/iabs-neuro/driada.git
cd driada
pip install -e ".[dev]"
pytest

Citation

A paper describing DRIADA has been submitted to the Journal of Open Source Software (JOSS). In the meantime, please cite:

@software{driada2026,
  title = {DRIADA: Dimensionality Reduction for Integrated Activity Data},
  author = {Pospelov, Nikita and contributors},
  year = {2026},
  url = {https://github.com/iabs-neuro/driada}
}

Publications

DRIADA has been used in the following research:

Biological neural systems

Artificial neural networks

Methodological applications

See PUBLICATIONS.md for the complete list with abstracts and details.

Support

License

This project is licensed under the MIT License β€” see the LICENSE file for details.

Packages

No packages published

Contributors 3

  •  
  •  
  •