Generate a volcano plot based on differential expression analysis results.
Usage
VolcanoPlot(
srt,
group.by = NULL,
test.use = "wilcox",
res = NULL,
DE_threshold = "avg_log2FC > 0 & p_val_adj < 0.05",
x_metric = "diff_pct",
palette = "RdBu",
palcolor = NULL,
pt.size = 1,
pt.alpha = 1,
cols.highlight = "black",
sizes.highlight = 1,
alpha.highlight = 1,
stroke.highlight = 0.5,
nlabel = 5,
features_label = NULL,
label.fg = "black",
label.bg = "white",
label.bg.r = 0.1,
label.size = 4,
aspect.ratio = NULL,
xlab = x_metric,
ylab = "-log10(p-adjust)",
theme_use = "theme_scop",
theme_args = list(),
combine = TRUE,
nrow = NULL,
ncol = NULL,
byrow = TRUE,
threshold_method = c("rectangular", "hyperbolic"),
hyperbola_c = 6,
annotate_enrichment = FALSE,
enrich_from = c("Enrichment", "GSEA", "GSVA"),
enrich_db = NULL,
enrich_terms = NULL,
enrich_top_terms = 3,
enrich_padj_cutoff = 0.05,
enrich_gsva_score_cutoff = NULL,
gsva_method = NULL,
enrich_nlabel = 15
)Arguments
- srt
An object of class
Seuratcontaining the results of differential expression analysis.- group.by
Name of one or more meta.data columns to group (color) cells by.
- test.use
A character string specifying the type of statistical test to use. Default is
"wilcox".- res
A
data.frameordata.tablewith differential expression results. Whenresis provided,srtwill be ignored. The data.frame must contain columns:gene,group1(factor or character),avg_log2FC,p_val_adj, and optionallypct.1andpct.2for calculatingdiff_pct.- DE_threshold
A character string specifying the threshold for differential expression (used to highlight significant genes in all plot types). Default is
"avg_log2FC > 0 & p_val_adj < 0.05".- x_metric
A character string specifying the metric to use for the x-axis (only for volcano plot). Default is
"diff_pct".- threshold_method
Volcano significance threshold method. Options are
"rectangular"(legacy DE_threshold) or"hyperbolic"(|log2FC * -log10(padj)| > c). Default is"rectangular".- hyperbola_c
Numeric cutoff
cfor hyperbolic volcano threshold. Default is6.- annotate_enrichment
Whether to annotate enrichment-hit genes on volcano plots. Enrichment results are read from existing results in
srt@toolsonly. Default isFALSE.- enrich_from
Character vector specifying enrichment result source(s) to annotate. Options are
"Enrichment","GSEA","GSVA". Default isc("Enrichment", "GSEA", "GSVA").- enrich_db
Optional database filter for enrichment annotation, e.g.
"GO_BP"or"KEGG". Default isNULL.- enrich_terms
Optional whitelist of enrichment term IDs or names for annotation. Default is
NULL.- enrich_top_terms
Number of top enriched terms selected per source/group/database. Default is
3.- enrich_padj_cutoff
Adjusted p-value cutoff for
"Enrichment"and"GSEA"annotation. Default is0.05.- enrich_gsva_score_cutoff
Optional absolute GSVA score cutoff for
"GSVA"annotation. Default isNULL.- gsva_method
Optional GSVA method filter (e.g.
"gsva"or"ssgsea") when multiple GSVA tool slots exist. Default isNULL.- enrich_nlabel
Maximum number of enrichment-derived labels added per group. Labels from
features_labelare always retained. Default is15.- palette
Color palette name. Available palettes can be found in thisplot::show_palettes. Default is
"RdBu".- palcolor
Custom colors used to create a color palette. Default is
NULL.- pt.size
The size of the points. Default is
1.- pt.alpha
The transparency of the data points. Default is
1.- cols.highlight
A character string specifying the color for highlighted points. Default is
"black".- sizes.highlight
The size of the highlighted points. Default is
1.- alpha.highlight
The transparency of the highlighted points. Default is
1.- stroke.highlight
The stroke width for the highlighted points. Default is
0.5.- nlabel
An integer value specifying the number of labeled points per group. Default is
5.- features_label
A character vector specifying the feature labels to plot. Default is
NULL.- label.fg
A character string specifying the color for the labels' foreground. Default is
"black".- label.bg
A character string specifying the color for the labels' background. Default is
"white".- label.bg.r
The radius of the rounding of the labels' background. Default is
0.1.- label.size
The size of the labels. Default is
4.- aspect.ratio
Aspect ratio of the panel. Default is
NULL.- xlab
A character string specifying the x-axis label.
- ylab
A character string specifying the y-axis label.
- theme_use
Theme to use for the plot. Default is
"theme_scop".- theme_args
A list of additional arguments to pass to the theme function. Default is
list().- combine
Whether to combine multiple plots into one. Default is
TRUE.- nrow
Number of rows for combined plots. Default is
NULL.- ncol
Number of columns for combined plots. Default is
NULL.- byrow
Whether to fill plots by row. Default is
TRUE.
Examples
data(pancreas_sub)
pancreas_sub <- standard_scop(pancreas_sub)
#> ℹ [2026-04-26 02:31:40] Start standard processing workflow...
#> ℹ [2026-04-26 02:31:40] Checking a list of <Seurat>...
#> ! [2026-04-26 02:31:41] Data 1/1 of the `srt_list` is "unknown"
#> ℹ [2026-04-26 02:31:41] Perform `NormalizeData()` with `normalization.method = 'LogNormalize'` on 1/1 of `srt_list`...
#> ℹ [2026-04-26 02:31:43] Perform `Seurat::FindVariableFeatures()` on 1/1 of `srt_list`...
#> ℹ [2026-04-26 02:31:44] Use the separate HVF from `srt_list`
#> ℹ [2026-04-26 02:31:44] Number of available HVF: 2000
#> ℹ [2026-04-26 02:31:44] Finished check
#> ℹ [2026-04-26 02:31:44] Perform `Seurat::ScaleData()`
#> ℹ [2026-04-26 02:31:45] Perform pca linear dimension reduction
#> ℹ [2026-04-26 02:31:45] Use stored estimated dimensions 1:20 for Standardpca
#> ℹ [2026-04-26 02:31:46] Perform `Seurat::FindClusters()` with `cluster_algorithm = 'louvain'` and `cluster_resolution = 0.6`
#> ℹ [2026-04-26 02:31:46] Reorder clusters...
#> ℹ [2026-04-26 02:31:46] Skip `log1p()` because `layer = data` is not "counts"
#> ℹ [2026-04-26 02:31:46] Perform umap nonlinear dimension reduction
#> ℹ [2026-04-26 02:31:46] Perform umap nonlinear dimension reduction using Standardpca (1:20)
#> ℹ [2026-04-26 02:31:52] Perform umap nonlinear dimension reduction using Standardpca (1:20)
#> ✔ [2026-04-26 02:31:57] Standard processing workflow completed
pancreas_sub <- RunDEtest(
pancreas_sub,
group.by = "CellType"
)
#> ℹ [2026-04-26 02:31:58] Data type is log-normalized
#> ℹ [2026-04-26 02:31:58] Start differential expression test
#> ℹ [2026-04-26 02:31:58] Find all markers(wilcox) among [1] 5 groups...
#> ℹ [2026-04-26 02:31:58] Using 1 core
#> ⠙ [2026-04-26 02:31:58] Running for Ductal [1/5] ■■ 20% | ETA: 1s
#> ✔ [2026-04-26 02:31:58] Completed 5 tasks in 876ms
#>
#> ℹ [2026-04-26 02:31:58] Building results
#> ✔ [2026-04-26 02:31:59] Differential expression test completed
VolcanoPlot(
pancreas_sub,
group.by = "CellType",
ncol = 2
)
VolcanoPlot(
pancreas_sub,
group.by = "CellType",
DE_threshold = "abs(diff_pct) > 0.3 & p_val_adj < 0.05",
ncol = 2
)
VolcanoPlot(
pancreas_sub,
group.by = "CellType",
x_metric = "avg_log2FC",
ncol = 2
)
if (FALSE) { # \dontrun{
pancreas_sub <- RunEnrichment(
pancreas_sub,
group.by = "CellType",
db = "GO_BP",
species = "Mus_musculus"
)
VolcanoPlot(
pancreas_sub,
group.by = "CellType",
threshold_method = "hyperbolic",
hyperbola_c = 6,
annotate_enrichment = TRUE,
enrich_from = "Enrichment",
enrich_db = "GO_BP",
ncol = 2
)
} # }