Skip to main content

Population and element-level analysis of neuronal computations

Project description

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.

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.0.0.tar.gz (1.2 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.0.0-py3-none-any.whl (594.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for driada-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8267901dc4f44500ebb138ae46798bd345f6e16173971ec18f58c5caf5790651
MD5 e3033dc12eab0521d96a273c6518b971
BLAKE2b-256 420716e09838e74bfc03854fa52ee36c6d4552c4e97c20399374de1d06c14374

See more details on using hashes here.

Provenance

The following attestation bundles were made for driada-1.0.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.0.0-py3-none-any.whl.

File metadata

  • Download URL: driada-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 594.2 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5c2fa4f7ca595234a4dbe5957ee6ca84edd0cbd97301243dc4d802be413794e
MD5 e320857e4f1fc4d59b8426976ca207d7
BLAKE2b-256 0eb38ae164aba7bb9717a34fdba5e9fa4db46dc12297f3d3a363c2905816148a

See more details on using hashes here.

Provenance

The following attestation bundles were made for driada-1.0.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