Library / SDK
scverse/PyDESeq2 avatar
scverse/PyDESeq2

PyDESeq2: a Python re-implementation of the DESeq2 pipeline for bulk RNA-seq

A Python implementation of the DESeq2 pipeline for bulk RNA-seq DEA.

767 stars93 forksPythonMIT

At a glance

What is it?
PyDESeq2 brings Wald-test differential expression analysis on bulk RNA-seq counts into Python, but it is a from-scratch re-implementation, so numbers can differ from Bioconductor DESeq2. Here is what it covers, what it leaves out, and what to check before you trust it.
Who is it for?
PyDESeq2 fits teams that need DESeq2-style bulk RNA-seq results inside an existing Python workflow and can tolerate that it is an independent re-implementation rather than the Bioconductor package. It does not fit anyone who needs exact parity with R DESeq2, features outside the DESeq2 v1.34.0 default envelope, or single-cell data.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What PyDESeq2 solves for teams already living in Python

PyDESeq2 exists for one narrow job: running differential expression analysis on bulk RNA-seq counts without leaving a Python environment. The reference implementation of the method lives in R on Bioconductor, which fits badly when count matrices, sample sheets and downstream notebooks already sit in Python. The README describes the project as a Python implementation of the DESeq2 method for differential expression analysis with bulk RNA-seq data, originally in R, and states that the aim is to facilitate DEA experiments for Python users. The scope is counts plus a design formula. It is not a read assembler, not an aligner, not a quantifier, and not a single-cell method. The intended users are researchers and bioinformatics engineers who want DESeq2-style results inside an analysis script they can rerun, and who are willing to weigh the trade-offs that come with an independent re-implementation.

Written from scratch, so numbers can drift from Bioconductor

The single most important line for an adopter sits in the README's introduction: because PyDESeq2 is a re-implementation of DESeq2 from scratch, you may experience some differences in terms of retrieved values or available features. A re-implementation has to re-derive numerical behaviour from the published method rather than reuse a tested R implementation, so small differences in dispersion estimation, shrinkage or Wald test statistics are a property of the design, not a bug report waiting to happen. Current feature coverage is described as broadly corresponding to the default settings of DESeq2 (v1.34.0) for single-factor and multi-factor analysis with categorical or continuous factors, using Wald tests. The README also says more is planned and invites users to open an issue for features they would like implemented. Anything outside that envelope, and any comparison against a specific R result, has to be verified by you.

Installing from PyPI, a conda environment, or uv

The quickest route is PyPI, and the README asks for pip inside a conda environment because the scientific stack is easier to isolate that way. After the install you should be able to import the package and run the example scripts in the repository's examples directory, which include a minimal pipeline, a pandas input and output walkthrough, and a step-by-step version of the same analysis. The plain pip install is one line.

bash
pip install pydeseq2

If you prefer a self-contained environment, the README recommends creating one, activating it, installing pip inside it, and then installing PyDESeq2.

bash
conda create -n pydeseq2
conda activate pydeseq2
conda install pip
pip install pydeseq2

Projects already managed by uv can add the dependency directly, which is the shortest path if your repository already uses uv for environment management.

bash
uv add pydeseq2

The README also points to Bioconda, where the same package is available through a conda channel and can be installed with conda install -c bioconda pydeseq2, and to the contributing section for anyone who wants the development version from source.

A dependency floor of Python 3.12 with a recent scientific stack

PyDESeq2 does not run on older interpreters. The pyproject file declares requires-python of 3.12 or newer, and its classifiers cover Python 3.12, 3.13 and 3.14. The dependency list is pinned to recent floors rather than loose minimums: anndata 0.11, formulaic 1.0.2, formulaic-contrasts 0.2, matplotlib 3.10, numpy 2.2, pandas 2.3, scikit-learn 1.6, scipy 1.15 and session-info2. The README states that the code is tested in a CI workflow with Python 3.12 to 3.14 and the latest versions of anndata, formulaic, numpy, pandas, scikit-learn, scipy, formulaic-contrasts and matplotlib, and that the authoritative list of version requirements lives in pyproject.toml. The practical consequence is that an existing environment with numpy 1.x or pandas 2.0 needs an upgrade before PyDESeq2 will install, which matters on shared HPC clusters where the system python is often older than the cluster admins expect.

The analysis is a formula plus a Wald test over a count table

The dependency list hints at the shape of the implementation. Design formulas go through formulaic and formulaic-contrasts, which is the modelling layer for categorical and continuous factors. Numeric work sits on numpy, pandas and scipy, with scikit-learn and anndata also required, and matplotlib is pulled in for plotting. The repository ships example scripts that make the intended workflow legible: a minimal pipeline, a pandas-based input and output example, and a step-by-step script that unpacks the analysis into its stages. The quick start examples use synthetic data that lives in the repository's datasets directory, so you can exercise the whole path without a download. For real work, the README points to the experiments described in the PyDESeq2 article, which rely on data from The Cancer Genome Atlas, obtainable from the GDC portal. Documentation with downloadable examples is hosted on ReadTheDocs, and the Getting Started section is the documented entry point.

Where the project stops short of DESeq2

The limits are stated plainly, and they are not edge cases. First, parity with R is not claimed; the README warns about differences in retrieved values and in the set of available features. Second, coverage is scoped to the default settings of DESeq2 v1.34.0 for single-factor and multi-factor analysis with categorical or continuous factors using Wald tests, so anything outside that envelope is unimplemented rather than untested. Third, the data story is thin: quick start runs on synthetic data, and the README does not document rollback, how to interpret a failed fit, or how to resume an interrupted run. Fourth, the examples assume a counts table with a design; the README does not describe single-cell input, and the package describes itself as a bulk RNA-seq tool. A final practical limit sits in the dependency set itself, since requiring numpy 2.2 and pandas 2.3 raises the cost of getting an older analysis container to run again.

scverse took over maintenance, and the licence stays permissive

The project is alive but its centre of gravity moved. The README credits the original work by Boris Muzellec, Maria Teleńczuk, Vincent Cabeli and Mathieu Andreux, funded by Owkin, and states that in December 2025 maintenance was taken over by the scverse community. The repository is not archived, and the last push was on 2026-10-19, with tagged releases v0.5.4 on 2026-01-23, v0.5.3 on 2025-10-28 and v0.5.2 on 2025-06-26. The licence is MIT, which is permissive for commercial and academic use; check the LICENSE file yourself for the exact terms rather than relying on a summary. Contributors work through pre-commit, which the README says automatically runs ruff, black and mypy, so patches are formatted and type-checked before review. Version numbers are dynamic in pyproject.toml and derived through hatch-vcs, so the installed version is taken from the git tag rather than typed into the file. A new community maintainer group is a positive sign for long term support, but it also means the public roadmap and API surface may shift from what the original authors intended.

Editorial conclusion

PyDESeq2 fits teams that need DESeq2-style bulk RNA-seq results inside an existing Python workflow and can tolerate that it is an independent re-implementation rather than the Bioconductor package. It does not fit anyone who needs exact parity with R DESeq2, features outside the DESeq2 v1.34.0 default envelope, or single-cell data. Before adopting it, run one comparison condition with your own counts against R DESeq2, check the p-value and log2 fold change columns for the genes you care about, and read the warning in the README that retrieved values may differ.

Frequently asked questions

How do I install PyDESeq2?

The README documents four routes: pip install pydeseq2 from PyPI, a conda environment followed by pip install pydeseq2, uv add pydeseq2 for uv managed projects, and conda install -c bioconda pydeseq2 from the Bioconda channel. The project recommends installing inside a conda environment.

Which Python versions does PyDESeq2 support?

The pyproject file requires Python 3.12 or newer, and the README says the code is tested in CI with Python 3.12 to 3.14 against the latest versions of anndata, formulaic, numpy, pandas, scikit-learn, scipy, formulaic-contrasts and matplotlib.

Does PyDESeq2 give the same results as R DESeq2?

Not guaranteed. The README states that because PyDESeq2 is a re-implementation of DESeq2 from scratch, you may experience some differences in terms of retrieved values or available features. Feature coverage currently corresponds broadly to the default settings of DESeq2 (v1.34.0) for single-factor and multi-factor analysis with Wald tests.

Can PyDESeq2 be used with single-cell data?

The README describes PyDESeq2 as a tool for bulk RNA-seq data and its quick start examples use synthetic bulk counts stored in the repository. The README does not document single-cell input, so single-cell workflows would need checking before you rely on it.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. scverse/PyDESeq2 on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/scverse-pydeseq2.svg)](https://hysenlabs.com/projects/scverse-pydeseq2)

Was this useful?