Skip to contents

A GPU-accelerated volcano plot for differential-expression results. Points are rendered with WebGL (via regl-scatterplot) so hundreds of thousands to millions of genes/features stay interactive, while axes, threshold guides and gene labels are drawn as crisp vector overlays.

Usage

volcano(
  data,
  fc_threshold = 1,
  p_threshold = 0.05,
  point_size = 3,
  opacity = 0.8,
  colors = NULL,
  x_label = "log2 fold change",
  y_label = "-log10 p-value",
  show_threshold_lines = TRUE,
  label_top_n = 10,
  theme = NULL,
  width = NULL,
  height = NULL,
  element_id = NULL
)

Arguments

data

A data frame with numeric columns x (log2 fold change) and y (-log10 p-value). An optional label column supplies gene names for tooltips and top-hit labels.

fc_threshold

Absolute log2 fold-change cutoff for calling a hit.

p_threshold

P-value cutoff (applied on the -log10 scale).

point_size

Point radius in pixels.

opacity

Point opacity in [0, 1].

colors

Optional named list of hex colors for the three point classes: up, down and ns (not significant). NULL (the default) uses the component's built-in palette.

x_label, y_label

Axis titles.

show_threshold_lines

Draw the fold-change / p-value threshold guides.

label_top_n

Number of top up- and down-regulated genes to label.

theme

Optional named list of theme overrides (colors, fonts, ...) merged over the component defaults in the browser. NULL uses the default theme.

width, height

Widget dimensions (any valid CSS size).

element_id

Optional explicit DOM id.

Value

An htmlwidget object.

Examples

set.seed(1)
df <- data.frame(
  x = rnorm(2000),
  y = abs(rnorm(2000)) * 3,
  label = paste0("GENE", seq_len(2000))
)
volcano(df)