PyDESeq2 Differential Expression
An end-to-end guide for bulk RNA-seq differential expression with PyDESeq2 — formulaic designs, Wald tests, FDR correction, LFC shrinkage, and plots.
Data & AnalyticsAdvanced★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
- Runs the full DESeq2 pipeline in Python: size factors → dispersion estimation → GLM fit → Wald tests → Benjamini-Hochberg adjustment.
- Covers formulaic design strings (
~batch + condition), multi-factor designs, interaction terms, and explicit contrast specification. - Includes gene/sample filtering, significance filtering and ranking, volcano and MA plot code, plus CSV and portable H5AD export.
- Ships a CLI script
scripts/run_deseq2_analysis.pyfor batch runs and a troubleshooting section for index mismatches, transposed matrices, and non-full-rank design matrices.
Who it's for
- Bioinformaticians and grad students analyzing bulk RNA-seq counts.
- Teams porting R DESeq2 workflows into Python pipelines.
- Anyone needing to control batch effects or covariates in multi-factor designs.
Examples
- "Run treated vs control DE analysis on counts.csv and metadata.csv" → generates code from filtering through the significant-gene count.
- "Adjust for batch effects" → CLI invocation with
--design "~batch + condition"and the rule that adjustment variables come first. - "No significant genes found" → diagnostic snippets for dispersion distribution, size factors, and p-value histograms.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/HEAD/skills/pydeseq2/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the skills/pydeseq2 folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/pydeseq2/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git && mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/pydeseq2 ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Confirm Python 3.11 or newer:
python --version - Install dependencies:
uv pip install pydeseq2==0.5.4(addmatplotlib seabornfor plots). - Clone the skill repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Copy the skill into Claude Code:
mkdir -p ~/.claude/skills && cp -r scientific-agent-skills/skills/pydeseq2 ~/.claude/skills/ - Verify that
~/.claude/skills/pydeseq2/contains bothreferences/andscripts/. - Restart Claude Code and try a prompt like "Run a PyDESeq2 differential expression analysis on my counts matrix."
View source on GitHub ↗License: MIT