Skip to main content

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 → glmQLFTest and the classic exactTest
  • 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 of ov.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyedger-0.1.0.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyedger-0.1.0-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

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

Hashes for pyedger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e76b3e82ef0956455422df8b96eb29c1426542c45f785ed7f1f30b12629958f3
MD5 9cf3b3b784b8333d25bf8f285f462a30
BLAKE2b-256 3b7e437b0df46cb222e5e7d13b9c0fa18f681535aba300a999ca230f2343ec36

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyedger-0.1.0.tar.gz:

Publisher: publish.yml on omicverse/py-edgeR

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pyedger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50f6d87125353848179df1748f0c019b4ee925954a863e33fa345bbe59467115
MD5 e15f5190d2eca0b2581c701e56d4d8d5
BLAKE2b-256 950cc2ebb78a7ad332b694236e8792f364a4425b1330fae9a32210f92abea7bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyedger-0.1.0-py3-none-any.whl:

Publisher: publish.yml on omicverse/py-edgeR

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page