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.
pip install delnx
pip install git+https://github.com/joschif/delnx.git@mainimport 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]")# 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",
)results = dx.tl.grouped(
dx.tl.de, adata,
group_key="cell_type",
condition_key="treatment",
reference="control",
contrast="treatment[T.drugA]",
)results = dx.tl.rank_de(adata, condition_key="cell_type")- 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.
For more information, check out the documentation and the API reference.
