edge-rs
edgeR's quasi-likelihood pipeline and limma-voom for Python, with the numerics
in the edge-rs Rust crate. No R, no
rpy2. NumPy in, polars out, and every function named after the R function it
reproduces.
Docs, API reference and vignettes: https://gregorlueg.github.io/edge-rs/
Install
uv pip install edge-rs
The runtime dependencies are NumPy, polars and beartype.
Use
import edge_rs
# counts: (n_genes, n_samples), as in edgeR
res = edge_rs.run_edger_ql(counts, design, feature_ids=genes, coef="treated")
res = edge_rs.run_limma_voom(counts, design, feature_ids=genes, coef="treated")
Or step by step, as in edgeR and limma:
keep = edge_rs.filter_by_expr(counts, design=design)
lib_size = counts.sum(axis=0)
nf = edge_rs.calc_norm_factors(counts[keep], lib_size=lib_size)
fit = edge_rs.glm_ql_fit(counts[keep], design, lib_size=lib_size, norm_factors=nf)
edge_rs.top_tags(edge_rs.glm_ql_ftest(fit, coef="treated"))
vfit = edge_rs.voom_lm_fit(counts[keep], design, lib_size=lib_size, norm_factors=nf)
edge_rs.top_table(edge_rs.ebayes(vfit), coef="treated")
If you would rather not carry lib_size around, make_dgelist bundles counts,
library sizes, normalisation factors and annotation. Subsetting it keeps the
library sizes of the full matrix, as edgeR's keep.lib.sizes = TRUE does, and
every function above takes it in place of the counts:
dge = edge_rs.make_dgelist(counts, genes=pl.DataFrame({"gene_id": genes}))
dge = edge_rs.calc_norm_factors(dge[edge_rs.filter_by_expr(dge, design=design)])
fit = edge_rs.glm_ql_fit(dge, design)
edge_rs.top_tags(
edge_rs.glm_ql_ftest(fit, coef="treated"), feature_ids=dge.genes["gene_id"]
)
Counts are genes x samples. Single cell tools are the other way round, so
pseudobulk from bixverse goes in as
pb.counts.T. A design is a NumPy matrix or a polars frame; with a frame, the
column names become coefficient names and coef="treated" works. Everything is
0-based.
What's in it
| Python | R |
|---|---|
make_dgelist, DgeList |
edgeR::DGEList |
filter_by_expr |
edgeR::filterByExpr |
calc_norm_factors |
edgeR::calcNormFactors |
cpm, ave_log_cpm |
edgeR::cpm, edgeR::aveLogCPM |
remove_batch_effect |
limma::removeBatchEffect |
glm_ql_fit, glm_ql_ftest, top_tags |
edgeR::glmQLFit, edgeR::glmQLFTest, edgeR::topTags |
voom, voom_lm_fit, lm_fit |
limma::voom, edgeR::voomLmFit, limma::lmFit |
make_contrasts, contrasts_fit |
limma::makeContrasts, limma::contrasts.fit |
ebayes, top_table |
limma::eBayes, limma::topTable |
run_edger_ql, run_limma_voom |
the above, chained |
Not exposed yet: NEBULA, the exact test, glmFit/glmLRT/glmTreat and
diffSpliceDGE. The crate has all of them.
How close to R?
The crate is gated against edgeR 4.8.2 and limma 3.66.0 on committed fixtures, and the Python tests run the same fixtures through the bindings. The bulk vignette reruns the edgeR QL F1000 workflow on GSE60450 and matches R on every number it shows.
Vignettes
Two notebooks: bulk DGE on GSE60450, and pseudobulk DGE on the Kang PBMCs with
bixverse. Each is a jupytext .py in docs/vignettes/ with its executed
.ipynb next to it, and the data download on first use.
uv sync --group dev --group vignettes
uv run maturin develop --release
uv run python dev/vignettes.py execute # both
uv run python dev/vignettes.py execute pseudobulk # or by name
Development
uv sync --group dev
uv run maturin develop --release
uv run pytest tests -q
The wheel builds against the crate in the parent directory, so it always tracks this checkout.
Metadata
Release files for edge-rs 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| edge_rs-0.1.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ x86-64 | Details for edge_rs-0.1.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| edge_rs-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ ARM64 | Details for edge_rs-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| edge_rs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details for edge_rs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl |
| edge_rs-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl | CPython 3.11 | abi3 | macOS 10.12+ x86-64 | Details for edge_rs-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl |
Total release size: 4.9 MB
Release files / edge_rs-0.1.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | edge_rs-0.1.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
24a34a4962687e002266fecd98e2a3daf69e71df60639e536747402f1d5e9fe4
|
|
BLAKE2b-256 checksum How to use checksums |
8304f1f92c92313dd7bac36639c0276fc36c078f039a1fb3d2edc6e48319732d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / edge_rs-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | edge_rs-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
48fa865bae49623d5e9cb7329056cc5a4656eeb02ed6dfd175ce674164d0dc37
|
|
BLAKE2b-256 checksum How to use checksums |
c5b4db19f3e5c053560cea982d3673cdb506c68b303d797b14541f64aa9d3dd7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / edge_rs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | edge_rs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
84b0e9fbda3431fedc60acd405ec56b78f4f54533c7dec3ff0dd61dd5069e705
|
|
BLAKE2b-256 checksum How to use checksums |
f32f14d20f297088f8e5fb5e6db080548bdf93b17929bc20cab0ea8756226675
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / edge_rs-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
| Download URL | edge_rs-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.11 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
7a64f1ee061763c49089a320bd44574497cef1f19848a640bb0a5a6338e34316
|
|
BLAKE2b-256 checksum How to use checksums |
786f8131de057b2acf8a1cff5fadf19003c9a1b786ea9f0e1f24e57a220e307d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for edge-rs 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for edge_rs-0.1.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.