ezvolcano: Volcano plot

View source: R/ezvolcano.R

ezvolcanoR Documentation

Volcano plot

Description

Volcano plot in ggplot2 using output from ezlimma package, e.g. limma_contrasts. The logFC and significance columns are supplied by the user, or inferred from the supplied comparison, e.g. if comparison="AvsB", ezvolcano expects column names AvsB.logFC and, depending on type.sig, AvsB.p or AvsB.FDR.

Usage

ezvolcano(
  tab,
  lfc.col = NA,
  sig.col = NA,
  lab.col = "Gene.Symbol",
  ntop.sig = 0,
  ntop.lfc = 0,
  comparison = NULL,
  alpha = 0.4,
  name = "volcano",
  ann.rnames = NULL,
  up.ann.color = "black",
  down.ann.color = "black",
  shape = 19,
  x.bound = NULL,
  y.bound = NULL,
  type.sig = c("p", "FDR"),
  cut.color = "black",
  cut.lfc = 1,
  cut.sig = 0.05,
  lines.sig = NA,
  raster = FALSE,
  sep = ".",
  na.lab = c("---", ""),
  seed = 0,
  plot = TRUE
)

Arguments

tab

Table of output from ezlimma.

lfc.col

Column name or index of tab with logFC. Some features should be > 0 and others < 0.

sig.col

Column name or index of tab with p-values or FDRs.

lab.col

Column name or index of tab with labels, such as gene symbol, annotating features. If NULL, no points are annotated.

ntop.sig

Number of top significant features to annotate.

ntop.lfc

Number of top logFC features to annotate.

comparison

Name of contrast to plot. If given, it's assumed that lfc.col=paste0(comparison, '.logFC') and sig.col=paste0(comparison, '.p') or paste0(comparison, '.FDR'), and these are over-ridden.

alpha

Transparency for non-annotated points, passed to geom_point.

name

Name of file to create. Set to NA to plot to screen instead of to file.

ann.rnames

Character vector of additional rownames of tab to annotate; elements must be in rownames(tab).

up.ann.color

Color for annotated points that are upregulated (logFC>0).

down.ann.color

Color for annotated points that are downregulated (logFC<0).

shape

Shape of non-annotated dots. Set to 1 for empty dots.

x.bound

x-axis limits are set to c(-x.bound, x.bound). If NULL, x.bound=max(abs(tab[,lfc.col])).

y.bound

y-axis limits are set to c(0, y.bound). If NULL, y.bound=max(tab[,'nlg10sig']).

type.sig

Type of significance y-axis should use, either "p" or "FDR".

cut.color

Color of points that meet both cut.lfc and cut.sig but are not labeled.

cut.lfc

Points need to have |logFC| >= cut.lfc to have cut.color.

cut.sig

Points need to have significance tab[,sig.col] <= cut.sig to have cut.color.

lines.sig

Numeric vector of values of sig.type at which to draw lines. For example, if type.sig="p", you may want to set lines.sig = 0.05, which will draw a line at y = -log10(0.05).

raster

Rasterize points using ggrastr so plot is lighter.

sep

Separator string between contrast names and suffix such as logFC.

na.lab

Character vector of labels in lab.col to treat as missing, in addition to NA.

seed

Numeric seed for reproducibility since ggrepel uses a random algorithm.

plot

Logical; should plot be generated?

Details

If ntop.sig>0 or ntop.lfc>0, then lab.col must be in colnames(tab). For annotated points, up.ann.color & down.ann.color dominate cut.color.

Value

Invisibly, a ggplot object.

See Also

multi_volcano


jdreyf/ezlimmaplot documentation built on Feb. 8, 2025, 2:25 a.m.