Skip to main content

Differential expression analysis for single-cell genomics

Project description

delnx

PyPI version Tests Codecov pre-commit.ci status Documentation Status

🌸 delnx

delnx ("de-lo-nix" | /dɪˈlɒnɪks/) is a python package for differential expression analysis of (single-cell) genomics data. It enables scalable analyses of atlas-level datasets through GPU-accelerated regression models and statistical tests implemented in JAX.

🚀 Installation

PyPI

pip install delnx

Development version

pip install git+https://github.com/joschif/delnx.git@main

⚡ Quickstart

Negative binomial DE (count data)

import delnx as dx

# Fit negative binomial GLMs with quasi-likelihood dispersion shrinkage
fit = dx.tl.nb_fit(adata, condition_key="treatment", reference="control")

# Test for differential expression
results = dx.tl.nb_test(adata, fit, contrast="treatment[T.drugA]")

General-purpose DE (log-normalized / binary data)

# Logistic regression with likelihood ratio test
results = dx.tl.de(
    adata,
    condition_key="treatment",
    reference="control",
    contrast="treatment[T.drugA]",
)

# Formula-based design with covariates
results = dx.tl.de(
    adata,
    formula="~ treatment + batch",
    contrast="treatment[T.drugA]",
    method="anova",
)

Per-group DE with grouped wrapper

results = dx.tl.grouped(
    dx.tl.de, adata,
    group_key="cell_type",
    condition_key="treatment",
    reference="control",
    contrast="treatment[T.drugA]",
)

Fast rank-based markers

results = dx.tl.rank_de(adata, condition_key="cell_type")

💎 Features

  • Negative binomial GLMs: GPU-accelerated glmGamPoi-style fitting with quasi-likelihood dispersion shrinkage for count data.
  • General-purpose DE: Logistic regression, ANOVA, and binomial GLM for log-normalized, scaled, or binary data.
  • Formula interface: R-style formulas (~ treatment + batch) parsed by patsy, with treatment coding and reference levels.
  • Rank-based markers: Fast AUROC-based one-vs-all marker detection with Numba-optimized ranking.
  • Pseudobulking: Perform DE on large multi-sample datasets by using pseudobulk aggregation.
  • Effect sizes: Log2 fold change and AUROC computation for pairwise condition comparisons.
  • GPU acceleration: Core methods are implemented in JAX, enabling GPU acceleration for scalable DE analysis on large datasets.

📖 Documentation

For more information, check out the documentation and the API reference.

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

delnx-0.3.0.tar.gz (5.2 MB view details)

Uploaded Source

Built Distribution

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

delnx-0.3.0-py3-none-any.whl (86.5 kB view details)

Uploaded Python 3

File details

Details for the file delnx-0.3.0.tar.gz.

File metadata

  • Download URL: delnx-0.3.0.tar.gz
  • Upload date:
  • Size: 5.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for delnx-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fdbbc56ef70086ddffcb0a4670d622286570a06f144fddde5a141db9af57a6c2
MD5 1436a6aef4edf6db922943c1667af0f3
BLAKE2b-256 e999399c1046a51adba3d3e2a0966c21c23fc233fd84c8ebe5446b0a63997571

See more details on using hashes here.

Provenance

The following attestation bundles were made for delnx-0.3.0.tar.gz:

Publisher: release.yaml on mlbelab/delnx

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

File details

Details for the file delnx-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: delnx-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 86.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for delnx-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 288b28ca52655b72caf60643df442e628d287853c17adafdfdad4aafb60928b6
MD5 f923f35fd172bf9f44c34ec3ca435251
BLAKE2b-256 a59d0ab697961f145707e3875f7d76bd0813a570c12227d67f11ea734ee01a64

See more details on using hashes here.

Provenance

The following attestation bundles were made for delnx-0.3.0-py3-none-any.whl:

Publisher: release.yaml on mlbelab/delnx

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