volcanoPlot | R Documentation |
Create a volcano plot of differential expression results.
volcanoPlot(
x,
palettePoint,
maxOverlaps,
sizeLabel,
Th_logFC,
Th_Pvalue,
subsetGenes,
st_significance
)
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". |
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.
Reads the input CSV and checks for duplicate IDs.
Standardizes columns to "ID", "logFC", and "adjustPvalue" or "PValue".
Optionally subsets to the top N genes by p-value.
Classifies each gene as "UP", "DOWN", or "NO" based on thresholds.
Plots points with manual fill, size, and alpha scales, adds threshold lines, and repels labels using "ggrepel".
A "ggplot" object displaying the volcano plot.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.