DESeq2 is a widely adopted R/Bioconductor package that performs differential gene expression analysis on raw read count data. It models counts using a negative binomial distribution to account for overdispersion, then applies empirical Bayes shrinkage to stabilize dispersion and log2 fold change estimates, particularly for genes with low counts or high variability.
Glossary
DESeq2

What is DESeq2?
DESeq2 is an R/Bioconductor software package that uses a negative binomial distribution and empirical Bayes shrinkage to estimate dispersion and fold changes for differential gene expression analysis from raw RNA-seq count data.
The workflow involves estimating size factors for normalization, estimating gene-wise dispersion, fitting a generalized linear model using a design matrix, and performing Wald tests for coefficient significance. DESeq2 provides built-in functions for variance stabilizing transformation and rlog transformation, enabling downstream visualization via PCA plots, heatmaps, and MA plots.
Key Features of DESeq2
DESeq2 provides a robust statistical framework for differential expression analysis from raw RNA-seq count data, centered on its unique approach to dispersion estimation and fold change shrinkage.
Negative Binomial Modeling
DESeq2 models raw read counts using a negative binomial distribution, which naturally accounts for the overdispersion inherent in RNA-seq data. Unlike a Poisson distribution, which assumes variance equals the mean, the negative binomial allows variance to exceed the mean, capturing both technical shot noise and biological variability. The model parameterizes the variance as a function of the mean with a gene-specific dispersion parameter, enabling accurate hypothesis testing even for genes with low counts.
Empirical Bayes Dispersion Shrinkage
A defining innovation of DESeq2 is its use of empirical Bayes shrinkage for dispersion estimation. Raw dispersion estimates are highly unstable for genes with few counts. DESeq2 addresses this by:
- Fitting a parametric curve to the observed dispersion-mean relationship across all genes
- Shrinking individual gene dispersions toward this fitted trend
- Applying stronger shrinkage when counts are low and weaker shrinkage when counts are high This information-borrowing strategy stabilizes variance estimates and dramatically reduces false positives.
Log2 Fold Change Shrinkage
DESeq2 applies adaptive shrinkage to log2 fold change estimates, a step distinct from dispersion shrinkage. Using a zero-centered Normal prior whose width is estimated from the data, the algorithm shrinks large fold changes from genes with high dispersion or low counts toward zero. This produces conservative, reproducible effect size estimates that are directly suitable for ranking genes by biological significance rather than statistical significance alone. The lfcShrink() function implements this with options for the apeglm and ashr shrinkage estimators.
Hypothesis Testing with Wald Test
DESeq2 employs the Wald test to assess whether estimated log2 fold changes differ significantly from zero. For each gene, the test computes:
- The maximum likelihood estimate of the coefficient
- Its standard error from the model's information matrix
- A z-statistic and corresponding p-value For multi-factor designs, DESeq2 also supports likelihood ratio tests (LRT), which compare full and reduced model fits to identify genes that respond to any level of a categorical variable, making it ideal for time-series or multi-condition experiments.
Automatic Independent Filtering
DESeq2 integrates independent filtering to increase detection power. Before multiple testing correction, genes with very low mean normalized counts are filtered out, as they provide insufficient evidence for differential expression. This filtering is performed independently of the test statistic under the null hypothesis, so it does not inflate the type I error rate. By reducing the number of tests requiring correction, the Benjamini-Hochberg procedure operates on a smaller set, yielding more significant adjusted p-values for genes with sufficient signal.
Variance Stabilizing Transformation
DESeq2 provides a variance stabilizing transformation (VST) and a regularized log transformation (rlog) for downstream visualization. These transformations produce data where the variance is approximately independent of the mean, making them suitable for:
- Principal component analysis (PCA) to visualize sample clustering
- Heatmaps of gene expression patterns
- Machine learning inputs requiring homoskedastic data
The VST is faster than
rlogfor large datasets and is the recommended default for exploratory analysis.
Frequently Asked Questions
Concise answers to the most common technical questions about the DESeq2 differential expression workflow, from core statistical concepts to practical implementation details.
DESeq2 is an R/Bioconductor software package that performs differential gene expression analysis on raw RNA-seq count data. It works by modeling read counts using a negative binomial distribution and applying empirical Bayes shrinkage to stabilize estimates of dispersion and log2 fold change. The core workflow involves: (1) normalizing raw counts using a median-of-ratios method to estimate size factors, (2) estimating gene-wise dispersion parameters, (3) fitting a generalized linear model (GLM) for each gene, and (4) performing a Wald test or likelihood ratio test to identify genes with statistically significant expression changes between conditions. The shrinkage step is critical—it borrows information across all genes to prevent low-count, high-variance genes from dominating the list of false positives, making DESeq2 particularly robust for experiments with small sample sizes.
DESeq2 vs. edgeR vs. limma-voom
A technical comparison of the three dominant R/Bioconductor packages for differential gene expression analysis from RNA-seq count data.
| Feature | DESeq2 | edgeR | limma-voom |
|---|---|---|---|
Statistical Model | Negative Binomial GLM | Negative Binomial GLM | Linear model on precision-weighted log-CPM |
Dispersion Estimation | Empirical Bayes shrinkage (gene-wise) | Empirical Bayes shrinkage (tagwise) | Estimates mean-variance trend via voom |
Normalization Method | Median of ratios (size factors) | Trimmed Mean of M-values (TMM) | TMM normalization (via edgeR) |
Hypothesis Test | Wald test or LRT | Exact test or quasi-likelihood F-test | Moderated t-statistic (empirical Bayes) |
Handles Complex Designs | |||
Single-Cell Compatibility | Pseudobulk aggregation | Pseudobulk aggregation | Pseudobulk aggregation |
Outlier Robustness | Cook's distance filtering | Moderate via quasi-likelihood | High via precision weights |
Speed (Typical Dataset) | < 30 sec | < 20 sec | < 45 sec |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core statistical and computational concepts that underpin the DESeq2 differential expression workflow.
Negative Binomial Distribution
The foundational probability model for DESeq2. RNA-seq produces count data where the variance typically exceeds the mean (overdispersion). The negative binomial distribution models this by using two parameters: the mean and the dispersion parameter. This prevents the false positives that would arise from assuming a simpler Poisson distribution.
Empirical Bayes Shrinkage
A critical stabilization technique. DESeq2 'borrows' information across all genes to improve estimates for individual genes, especially those with low read counts or high variability. It shrinks gene-specific dispersion and log2 fold change estimates toward a common prior distribution, preventing genes with small counts from appearing as the most highly differentially expressed due to statistical noise.
Dispersion Estimation
A three-step process to model gene-specific variability:
- Gene-wise dispersion: Estimates raw dispersion per gene.
- Fitted dispersion: Fits a curve to model the mean-dispersion relationship across all genes.
- Final MAP dispersion: Shrinks gene-wise estimates toward the fitted curve using Empirical Bayes, providing the final dispersion value used for hypothesis testing.
Median of Ratios Normalization
DESeq2's internal method for correcting for differences in sequencing depth and library composition. It calculates a size factor for each sample by taking the median ratio of gene counts relative to a geometric mean across all samples. This method is robust to the presence of a few highly differentially expressed genes that could skew total count normalization.
Variance Stabilizing Transformation (VST)
A data transformation applied to the raw count data for visualization purposes. The VST renders the variance approximately independent of the mean across the range of expression values. This transformed data is suitable for Principal Component Analysis (PCA) and hierarchical clustering heatmaps, which assume homoskedasticity.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us