Diffexpr
Porting DESeq2 into python via rpy2
Install / Use
/learn @wckdouglas/DiffexprREADME
diffexpr
A python package using rpy2 to port DESeq2 into python.
Installation
Dependencies are pandas (python), rpy2 (python), and DESeq2 (R)
Best way to setup the environment should be via docker,
but it should also be possible to install the dependency packages using
conda:
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda create -q -n diffexpr python=3.6 \
pandas tzlocal rpy2 biopython ReportLab pytest-cov \
bioconductor-deseq2 codecov
conda activate diffexpr # activate diffexpr environment
Rscript setup.R #to install DESeq2 correctly
python setup.py install
<a name="docker"></a> Docker
We build two docker images in our CI workflow:
- diffexpr (
ghcr.io/wckdouglas/diffexpr/diffexpr): contains minimal dependencies for executing code in this package - diffexpr-dev (
ghcr.io/wckdouglas/diffexpr/diffexpr-dev): is the same asdiffexpr, but with additional python packages (matplotlib,seaborn, andjupyterlab) for using this package in jupyter notebook analysis (see below for how to spin up the jupyterlab instance from within the container), feel free to file an issue or put a PR to include your favorite packages!
<a name="example"></a> Example
An example of running DESeq2 in python using diffexpr package is provided here.
This should be reproducible by:
git clone https://github.com/wckdouglas/diffexpr.git
cd diffexpr
docker run \
-p 1234:1234 \
--mount type=bind,source="$(pwd)",target=/jupyter \
ghcr.io/wckdouglas/diffexpr/diffexpr-dev:master
and go to http://localhost:1234 to access the jupyter lab instance
The --mount type=bind,source="$(pwd)",target=/jupyter option will mount the local filesystem (current directory) at /jupyter, such that the container has access to all the files under the current directory, the example notebook is under /jupyter/example/deseq_example.ipynb:

Citation
:bangbang: Please cite the original DESeq2 paper if you used this package in your work:
@article{Love2014,
doi = {10.1186/s13059-014-0550-8},
url = {https://doi.org/10.1186/s13059-014-0550-8},
year = {2014},
month = dec,
publisher = {Springer Science and Business Media {LLC}},
volume = {15},
number = {12},
author = {Michael I Love and Wolfgang Huber and Simon Anders},
title = {Moderated estimation of fold change and dispersion for {RNA}-seq data with {DESeq}2},
journal = {Genome Biology}
}
Alternatives
pyDESeq2 is a pure python implementation of DESeq2.
Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
109.7kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
349.7kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
