Skip to contents

Plots effect size against significance, with cutoff guides and optional labels on the most significant genes. Shrunken log fold changes (see DESeq2::lfcShrink()) give a more honest picture than raw ones, because genes with very low counts otherwise produce large fold changes that are almost entirely noise.

Usage

plot_volcano(res, fdr = 0.05, lfc = 1, label_n = 15)

Arguments

res

A DESeqResults object or data frame with log2FoldChange and padj columns, and optionally symbol.

fdr

Adjusted p-value cutoff.

lfc

Absolute log2 fold-change cutoff used for colouring and for the vertical guides.

label_n

Number of top genes to label. Requires a symbol column and the ggrepel package; set to 0 to disable.

Value

A ggplot2::ggplot() object.

Examples

set.seed(1)
res <- data.frame(
  log2FoldChange = rnorm(500),
  padj           = runif(500),
  symbol         = paste0("GENE", 1:500)
)
plot_volcano(res, label_n = 0)