Pure-Python port of Bioconductor edgeR — negative-binomial models for differential expression of count data (estimateDisp, glmFit, glmLRT, glmQLFTest, exactTest).
Project description
pyedger
A pure-Python port of Bioconductor edgeR (Robinson, McCarthy & Smyth, Bioinformatics 2010) — negative-binomial models for differential expression of count data.
- No
rpy2, no R install — the edgeR negative-binomial GLM workflow reimplemented in NumPy / SciPy - The canonical pipelines:
DGEList → calcNormFactors → estimateDisp → glmQLFit → glmQLFTestand the classicexactTest - TMM normalization, common / trended / tagwise dispersion, GLM and quasi-likelihood F-tests,
filterByExpr,cpm/aveLogCPM - Both Python-style (
glm_fit,estimate_disp,top_tags) and R-style (glmFit,estimateDisp,topTags) names exported
This is a standalone mirror of the implementation developed in
omicverse, where it powers the edgeR differential-expression backend ofov.bulk/pyDEG.
Install
pip install pyedger
Quick start
import numpy as np
import pyedger
# counts: genes x samples raw count matrix; group: per-sample condition labels
dge = pyedger.DGEList(counts=counts, group=group)
dge = pyedger.calcNormFactors(dge) # TMM normalization
keep = pyedger.filterByExpr(dge, group=group)
dge = dge[keep]
# Quasi-likelihood F-test workflow (the recommended edgeR pipeline)
dge = pyedger.estimateDisp(dge, design)
fit = pyedger.glmQLFit(dge, design)
qlf = pyedger.glmQLFTest(fit, coef=1)
res = pyedger.topTags(qlf, n=np.inf)
res.head()
Classic exact test
dge = pyedger.estimateDisp(dge, design)
et = pyedger.exactTest(dge, pair=("control", "treated"))
pyedger.topTags(et)
API
| Python | R counterpart |
|---|---|
DGEList |
DGEList |
calc_norm_factors / calcNormFactors |
calcNormFactors (TMM) |
filter_by_expr / filterByExpr |
filterByExpr |
estimate_disp / estimateDisp |
estimateDisp |
glm_fit / glmFit, glm_lrt / glmLRT |
glmFit, glmLRT |
glm_ql_fit / glmQLFit, glm_qlf_test / glmQLFTest |
glmQLFit, glmQLFTest |
exact_test / exactTest |
exactTest |
glm_treat / glmTreat |
glmTreat |
cpm, ave_log_cpm / aveLogCPM |
cpm, aveLogCPM |
top_tags / topTags |
topTags |
decide_tests_dge / decideTests |
decideTestsDGE |
DGEGLM, DGELRT, DGEExact, TestResults |
the corresponding S4 classes |
Citation
Robinson, M.D., McCarthy, D.J., Smyth, G.K. edgeR: a Bioconductor package for differential expression analysis of digital gene expression data. Bioinformatics 26(1), 139–140 (2010).
…and acknowledge omicverse / this repo for the Python port.
License
LGPL-3.0-or-later — matches the upstream Bioconductor package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyedger-0.1.0.tar.gz.
File metadata
- Download URL: pyedger-0.1.0.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e76b3e82ef0956455422df8b96eb29c1426542c45f785ed7f1f30b12629958f3
|
|
| MD5 |
9cf3b3b784b8333d25bf8f285f462a30
|
|
| BLAKE2b-256 |
3b7e437b0df46cb222e5e7d13b9c0fa18f681535aba300a999ca230f2343ec36
|
Provenance
The following attestation bundles were made for pyedger-0.1.0.tar.gz:
Publisher:
publish.yml on omicverse/py-edgeR
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyedger-0.1.0.tar.gz -
Subject digest:
e76b3e82ef0956455422df8b96eb29c1426542c45f785ed7f1f30b12629958f3 - Sigstore transparency entry: 1579869598
- Sigstore integration time:
-
Permalink:
omicverse/py-edgeR@308e24ef8bd8b17293990f0bceee45064b63dcdf -
Branch / Tag:
refs/heads/main - Owner: https://github.com/omicverse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@308e24ef8bd8b17293990f0bceee45064b63dcdf -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pyedger-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyedger-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50f6d87125353848179df1748f0c019b4ee925954a863e33fa345bbe59467115
|
|
| MD5 |
e15f5190d2eca0b2581c701e56d4d8d5
|
|
| BLAKE2b-256 |
950cc2ebb78a7ad332b694236e8792f364a4425b1330fae9a32210f92abea7bf
|
Provenance
The following attestation bundles were made for pyedger-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on omicverse/py-edgeR
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyedger-0.1.0-py3-none-any.whl -
Subject digest:
50f6d87125353848179df1748f0c019b4ee925954a863e33fa345bbe59467115 - Sigstore transparency entry: 1579869934
- Sigstore integration time:
-
Permalink:
omicverse/py-edgeR@308e24ef8bd8b17293990f0bceee45064b63dcdf -
Branch / Tag:
refs/heads/main - Owner: https://github.com/omicverse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@308e24ef8bd8b17293990f0bceee45064b63dcdf -
Trigger Event:
workflow_dispatch
-
Statement type: