Skip to main content

Population and element-level analysis of neuronal computations

Project description

DRIADA

Dimensionality Reduction for Integrated Activity Data Analysis — 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
Open In Colab Recurrence analysis Delay embedding, recurrence plots, RQA, visibility & ordinal graphs, population module recovery

All notebooks generate synthetic data internally — no external files needed. See the examples reference for 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
  • 🔄 Recurrence Analysis — delay embedding, recurrence plots, RQA, visibility graphs, ordinal partition networks for nonlinear dynamics and population module recovery
  • 📏 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

If you use DRIADA in your research, please cite:

@software{driada2026,
  title = {DRIADA: Dimensionality Reduction for Integrated Activity Data Analysis},
  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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

driada-1.1.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

driada-1.1.0-py3-none-any.whl (616.5 kB view details)

Uploaded Python 3

File details

Details for the file driada-1.1.0.tar.gz.

File metadata

  • Download URL: driada-1.1.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for driada-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5f9245a8e9205b2547dca690a5b00eb75d85e6949b3119339c8c5184e17d43f9
MD5 4ebdd2add6875fbfb2ef41993e81545d
BLAKE2b-256 203b7c5f8400b0ddddcec8c11696329cd7a4920707c13a76ea1db56d99897328

See more details on using hashes here.

Provenance

The following attestation bundles were made for driada-1.1.0.tar.gz:

Publisher: publish.yml on iabs-neuro/driada

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file driada-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: driada-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 616.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for driada-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96cb1bc5b8c234bd8cefcd571521a8fdf6b0017c4659e67c2368bebadad30f21
MD5 1850b9a27150784758cf721aa3ed0a79
BLAKE2b-256 42cfd9a72243b9f8fb218db0ff3f2dc085757d6ba9d966c9e0a9eec0765eb324

See more details on using hashes here.

Provenance

The following attestation bundles were made for driada-1.1.0-py3-none-any.whl:

Publisher: publish.yml on iabs-neuro/driada

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page