Learn R Programming

inDAGO (version 1.0.0)

volcanoPlot: volcanoPlot

Description

Create a volcano plot of differential expression results.

Usage

volcanoPlot(
  x,
  palettePoint,
  maxOverlaps,
  sizeLabel,
  Th_logFC,
  Th_Pvalue,
  subsetGenes,
  st_significance
)

Value

A "ggplot" object displaying the volcano plot.

Arguments

x

Character. File path to a CSV containing DEG results, with at least columns "ID", "logFC", and one of "PValue", "FDR", or "FWER".

palettePoint

Character. Name of a discrete palette from the "paletteer" package, supplying colors for "UP", "DOWN", and "NO".

maxOverlaps

Integer. Maximum allowed label overlaps passed to "ggrepel::geom_text_repel()".

sizeLabel

Numeric. Font size for gene labels in the plot.

Th_logFC

Numeric. Absolute log2 fold-change threshold to call a gene "UP" or "DOWN".

Th_Pvalue

Numeric. P-value threshold to call significance (uses "FDR"/"FWER" if "st_significance = "adjustPvalue"", otherwise raw "PValue").

subsetGenes

Integer or "Inf". If numeric, only the top "subsetGenes" genes by p-value are shown and labeled.

st_significance

Character. Which p-value column to use: "adjustPvalue" (FDR or FWER) or "PValue".

Details

This function reads a CSV of DEGs, classifies genes as up/down/no change based on log-fold change and p-value thresholds, and plots –log10(p-value) versus log-FC using ggplot2.

  1. Reads the input CSV and checks for duplicate IDs.

  2. Standardizes columns to "ID", "logFC", and "adjustPvalue" or "PValue".

  3. Optionally subsets to the top N genes by p-value.

  4. Classifies each gene as "UP", "DOWN", or "NO" based on thresholds.

  5. Plots points with manual fill, size, and alpha scales, adds threshold lines, and repels labels using "ggrepel".