Plot a volcano plot for differential expression analysis.

plot_volcano(
  devil.res,
  lfc_cut = 1,
  pval_cut = 0.05,
  labels = TRUE,
  colors = c("gray", "forestgreen", "steelblue", "indianred"),
  color_alpha = 0.7,
  point_size = 1,
  center = TRUE,
  title = "Volcano plot"
)

Arguments

devil.res

A data frame or tibble containing the results of differential expression analysis. This object is generated by the test_de function.

lfc_cut

A numeric value specifying the threshold for absolute log-fold change. Genes with absolute log-fold change greater than or equal to this value are highlighted. (default is 1)

pval_cut

A numeric value specifying the threshold for adjusted p-value. Genes with adjusted p-value less than or equal to this value are highlighted. (default is 0.05)

labels

Logical indicating whether to label significant genes on the plot. (default is TRUE)

colors

A character vector specifying the colors to use for different classes of genes (e.g., "non-significant", "lfc", "p-value", "p-value and lfc"). Default colors are "gray", "forestgreen", "steelblue", and "indianred"

color_alpha

A numeric value specifying the alpha transparency level for point colors. (default is 0.7)

point_size

A numeric value specifying the size of points in the plot. (default is 1)

center

Logical indicating whether to center the x-axis at zero. (default is TRUE)

title

A character string specifying the title of the plot. (default is Volcano plot)

Value

A ggplot object representing the volcano plot.

Details

This function creates a volcano plot for visualizing the results of differential expression analysis. It highlights genes based on their log-fold change (lfc) and adjusted p-values (adj_pval). Genes that meet the specified thresholds for both log-fold change and adjusted p-value are optionally labeled on the plot.

The function also ensures that genes with an adjusted p-value of zero are displayed with a minimal p-value (1e-16) to avoid plotting issues.