edge_rs/lib.rs
1//! Negative binomial differential expression for bulk and single-cell RNA-seq.
2//!
3//! A Rust port of the edgeR numerical stack (normalisation, Cox-Reid dispersion
4//! estimation, the Levenberg-damped negative binomial GLM, quasi-likelihood
5//! weights, the exact test), the limma linear model stack (`squeezeVar`, the
6//! F-distribution fits, voom, `lmFit`, `contrasts.fit`, `eBayes`, `topTable`),
7//! and NEBULA, a negative binomial gamma mixed model for single cell.
8//!
9//! The bulk stack follows edgePython, itself a port of edgeR and limma. Where
10//! the two disagree, edgeR and limma win. NEBULA is ported from the `nebula`
11//! package's own C++.
12//!
13//! ### Numeric policy
14//!
15//! Public containers and fits are generic over [`prelude::EdgeFloat`], so
16//! single-cell counts can be held as `f32` and halve the memory. Likelihood
17//! evaluation, Cox-Reid log-determinants, the optimisers and every p-value run
18//! in `f64` regardless of `T`: an NB deviance is a difference of large logs and
19//! loses edgeR parity in `f32` long before it saves anything.
20//!
21//! ### Parallelism
22//!
23//! Genes are the parallel axis almost everywhere. Counts are gene-major, so one
24//! gene is a contiguous slice, and the fan-out is a rayon iterator over genes
25//! with a per-thread scratch buffer.
26//!
27//! Normalisation is the exception: TMM's unit of work is one sample against a
28//! reference column, so it parallelises over samples and transposes the counts
29//! once on entry. Any module departing from the gene-major rule says so in its
30//! own header.
31
32#![warn(missing_docs)]
33
34pub mod core;
35pub mod dispersion;
36pub mod errors;
37pub mod exact;
38pub mod glm;
39#[cfg(feature = "gpu")]
40pub mod gpu;
41pub mod limma;
42pub mod numeric;
43pub mod prelude;
44pub mod ql;
45pub mod results;
46pub mod sc;
47pub mod splicing;
48pub mod utils;