PyDESeq2 Differential Expression
Run a complete bulk RNA-seq differential expression analysis in Python with PyDESeq2, from raw counts to volcano plots.
Data & AnalyticsAdvanced★ 33,030⑂ 3,248AI score 8/10Last updated: Aug 9, 2026
What it does
Gives Claude a full playbook for differential expression (DE) analysis of bulk RNA-seq counts using PyDESeq2, the Python port of DESeq2.
- Loads counts/metadata, fixes orientation (samples × genes), filters low-count genes
- Builds formulaic designs (
~condition,~batch + condition, interaction terms) with explicit reference levels - Fits size factors, dispersions and the GLM, then runs Wald tests with Benjamini-Hochberg FDR control
- Applies apeGLM LFC shrinkage for ranking and plotting
- Produces volcano plots, MA plots and QC checks (p-value and dispersion distributions)
- Exports CSV results and portable AnnData/H5AD; ships a CLI script (
scripts/run_deseq2_analysis.py) for batch runs
A troubleshooting section covers index mismatches, non-full-rank design matrices and "no significant genes" scenarios.
Who it's for
- Bioinformaticians porting R DESeq2 workflows into Python pipelines
- Analysts handling multi-factor designs with batch effects or covariates
- Core facilities running the same DE protocol across many datasets
Examples
- "Using counts.csv and metadata.csv, compare treated vs control and list genes with padj < 0.05 and |log2FC| > 1."
- "I suspect batch effects — rerun with
~batch + conditionand show a crosstab to check for confounding." - "Save 300dpi volcano and MA plots, then apply LFC shrinkage and give me the top 20 genes as a table."
· · · Install guide · · ·
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 /tmp/scientific-agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/scientific-agent-skills/skills/pydeseq2 ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repository:
git clone https://github.com/K-Dense-AI/scientific-agent-skills.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy just this skill:
cp -r scientific-agent-skills/skills/pydeseq2 ~/.claude/skills/ - Set up Python 3.11+ and install dependencies:
uv pip install pydeseq2==0.5.4 matplotlib seaborn - Restart Claude Code, then ask something like "Use the pydeseq2 skill to run differential expression on my RNA-seq counts."
- Before running, verify that sample IDs in your counts file and metadata file match exactly, and that counts are raw integers (never normalized).
View source on GitHub ↗License: MIT