Expand description
Negative binomial differential expression for bulk and single-cell RNA-seq.
A Rust port of the edgeR numerical stack (normalisation, Cox-Reid dispersion
estimation, the Levenberg-damped negative binomial GLM, quasi-likelihood
weights, the exact test), the limma linear model stack (squeezeVar, the
F-distribution fits, voom, lmFit, contrasts.fit, eBayes, topTable),
and NEBULA, a negative binomial gamma mixed model for single cell.
The bulk stack follows edgePython, itself a port of edgeR and limma, with
the R winning wherever the two disagree. NEBULA is ported from the nebula
package’s own C++ instead.
§Numeric policy
Public containers and fits are generic over prelude::EdgeFloat, so
single-cell counts can be held as f32 and halve the memory. Likelihood
evaluation, Cox-Reid log-determinants, the optimisers and every p-value run
in f64 regardless of T. A negative binomial deviance is a difference of
large logs, and accumulating one in f32 loses parity with edgeR well
before it saves anything worth having.
§Parallelism
Genes are the parallel axis almost everywhere. Counts are stored gene-major, so one gene is a contiguous slice, and the fan-out is a rayon iterator over genes with a per-thread scratch buffer.
Normalisation is the exception, and deliberately so: TMM has no gene axis to fan out over, since the unit of work is one sample compared against a reference column. It parallelises over samples and transposes the counts once on entry so each sample is contiguous. Any module that departs from the gene-major rule says so in its own header.
Modules§
- core
- Containers and the per-sample quantities edgeR derives from raw counts.
- dispersion
- Dispersion estimation.
- errors
- The crate-level error enum.
- exact
- The classic two-group exact test, edgeR’s
exactTest. - glm
- Negative binomial generalised linear models, fitted per gene.
- limma
- The limma routines edgeR depends on, and the linear model stack on top.
- numeric
- The numerical support layer: everything edgePython reaches into
scipyfor. - prelude
- The types most modules want. Prefer
use crate::prelude::*;over deep imports in new code. - ql
- Quasi-likelihood machinery: edgeR’s
ql_weights.cand the adjusted deviances built on it. - results
- Ranking and calling: edgeR’s
topTagsanddecideTests. - sc
- NEBULA: negative binomial mixed models for single cell.
- splicing
diffSpliceDGE: differential exon usage.- utils
- Shared building blocks: trait bounds, SIMD kernels and the data structures every other module indexes through.