pydeseq2

Perform differential gene expression analysis on bulk RNA-seq count matrices with Wald tests.

4|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/shushuzn/Rairos --skill pydeseq2-shushuzn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pydeseq2
Source: https://github.com/shushuzn/Rairos/tree/main/skills/pydeseq2
Command: npx skills add https://github.com/shushuzn/Rairos --skill pydeseq2-shushuzn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, pickle, argparse, pathlib, matplotlib, numpy, sys, scipy, sklearn, anndata, and includes scripts (resource) and references (resource) components.

What problem does it solve?

It streamlines differential gene expression analysis from bulk RNA-seq count matrices into interpretable, statistically tested results with FDR control.

Core Features & Use Cases

  • Bulk RNA-seq DE from count data: Loads samples × genes count matrices, applies normalization, fits dispersions, and estimates log2 fold changes using PyDESeq2.
  • Wald testing with multiple testing correction: Performs contrast-based Wald tests and computes p-values with Benjamini–Hochberg adjusted p-values (padj).
  • Practical workflow support: Supports single- and multi-factor design formulas (including batch/covariates) plus optional LFC shrinkage for better visualization and ranking.
  • Output-ready results: Exports results as CSV (including significant genes) and can generate volcano and MA plots for quick interpretation.

Quick Start

Run a treated-vs-control bulk RNA-seq differential expression analysis from your counts.csv and metadata.csv by executing: python scripts/run_deseq2_analysis.py --counts counts.csv --metadata metadata.csv --design "~condition" --contrast condition treated control --output results --plots

Frequently Asked Questions about pydeseq2

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run differential expression analysis on bulk RNA-seq count data in Python?

Bulk RNA-seq differential expression analysis requires a samples × genes integer count matrix, matching metadata indices, a Wilkinson design formula, and contrast specification to estimate log2 fold changes and produce FDR-corrected results.

Can I include batch effects and covariates in my RNA-seq differential expression model?

Yes, you can include batch effects and covariates by specifying a multi-factor Wilkinson design formula. This allows the model to normalize unwanted variance and accurately estimate condition-specific log2 fold changes during differential expression testing.

How does Wald testing with FDR correction work for identifying differentially expressed genes?

Wald testing evaluates contrast-based log2 fold changes against a null hypothesis to compute raw p-values, then applies Benjamini–Hochberg adjustment to produce padj values for FDR correction across all tested genes.

What is the best way to generate volcano plots from RNA-seq differential expression results?

To generate volcano plots from RNA-seq differential expression results, apply optional LFC shrinkage during analysis to refine log2 fold change estimates, then plot the FDR-corrected padj values against the shrinkage-adjusted effect sizes.

Does PyDESeq2 support exporting significant differentially expressed genes to CSV?

Yes, the workflow exports results as CSV files containing significant differentially expressed genes with their log2 fold changes and FDR-corrected padj values, and can also generate volcano and MA plots for visualization.