| Title: | Interactive Volcano Plot |
|---|---|
| Description: | Generate interactive volcano plots for exploring gene expression data. Built with 'ggplot2', the plots are rendered interactive using 'ggiraph', enabling users to hover over points to display detailed information or click to trigger custom actions. |
| Authors: | Guangchuang Yu [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-6485-8781>) |
| Maintainer: | Guangchuang Yu <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 0.0.6 |
| Built: | 2026-06-05 07:16:33 UTC |
| Source: | https://github.com/yulab-smu/ivolcano |
Add gene labels to ivolcano plot
interactive volcano plot
geom_ivolcano_gene( top_n = 10, label_mode = "separate", fontface = "italic", label_sig_only = TRUE, filter = NULL ) ivolcano( data, logFC_col = "logFC", pval_col = "adj.P.Val", gene_col = "gene", title = "Volcano Plot", interactive = TRUE, onclick_fun = NULL, pval_cutoff = 0.05, logFC_cutoff = 1, pval_cutoff2 = NULL, logFC_cutoff2 = NULL, size_by = "none", point_size = list(base = 2, medium = 4, large = 6), threshold_line = list(color = "black", linetype = "dashed", linewidth = 0.5), tooltip_cols = NULL, tooltip_labels = NULL, top_n = 10, label_mode = "separate", fontface = "italic", label_sig_only = TRUE, filter = NULL )geom_ivolcano_gene( top_n = 10, label_mode = "separate", fontface = "italic", label_sig_only = TRUE, filter = NULL ) ivolcano( data, logFC_col = "logFC", pval_col = "adj.P.Val", gene_col = "gene", title = "Volcano Plot", interactive = TRUE, onclick_fun = NULL, pval_cutoff = 0.05, logFC_cutoff = 1, pval_cutoff2 = NULL, logFC_cutoff2 = NULL, size_by = "none", point_size = list(base = 2, medium = 4, large = 6), threshold_line = list(color = "black", linetype = "dashed", linewidth = 0.5), tooltip_cols = NULL, tooltip_labels = NULL, top_n = 10, label_mode = "separate", fontface = "italic", label_sig_only = TRUE, filter = NULL )
top_n |
top N genes to display the labels (gene ID) |
label_mode |
one of 'all' or 'separate' (default). If label_mode = 'all', top_n genes with minimal p values will be displayed, otherwise, top_n up-regulated and top_n down-regulated genes will be displayed. |
fontface |
one of 'plain', 'bold', 'italic' (default) and their combination, e.g. 'bold.italic' |
label_sig_only |
whether filter significant genes before subset 'top_n' genes |
filter |
custom filter expression to select genes for labeling |
data |
A data frame that contains minimal information with gene id, logFC and adjusted P values |
logFC_col |
column name in 'data' that stored the logFC values |
pval_col |
column name in 'data' that stored the adjusted P values |
gene_col |
column name in 'data' that stored the gene IDs |
title |
plot title |
interactive |
whether plot the graph in interactive mode |
onclick_fun |
effects when click on the dot (gene), default is NULL |
pval_cutoff |
cutoff of the adjusted P values |
logFC_cutoff |
cutoff of the logFC values |
pval_cutoff2 |
second cutoff of the adjusted P values for advanced mode |
logFC_cutoff2 |
second cutoff of the logFC values for advanced mode |
size_by |
one of "none" (default), "manual" (set by |
point_size |
set point size when |
threshold_line |
customize threshold line style (e.g., line color, type, and width) |
tooltip_cols |
extra column names in 'data' to display in tooltip (e.g., c("biotype", "description")). When NULL (default), only gene ID, logFC, and p-value are shown. |
tooltip_labels |
display labels for the extra columns. If NULL or length differs from tooltip_cols, raw column names are used. |
volcano plot
Guangchuang Yu
# example data f <- system.file("extdata/airway.rds", package = "ivolcano") df <- readRDS(f) # plot ivolcano(df, logFC_col = "log2FoldChange", pval_col = "padj", gene_col = "symbol", onclick_fun = onclick_genecards )# example data f <- system.file("extdata/airway.rds", package = "ivolcano") df <- readRDS(f) # plot ivolcano(df, logFC_col = "log2FoldChange", pval_col = "padj", gene_col = "symbol", onclick_fun = onclick_genecards )
Add threshold lines to an iVolcano plot
geom_ivolcano_line(linetype = "longdash", color = "grey40", linewidth = 0.5)geom_ivolcano_line(linetype = "longdash", color = "grey40", linewidth = 0.5)
linetype |
line type for the threshold lines |
color |
line color for the threshold lines |
linewidth |
line width for the threshold lines |
A ggplot2 layer object
Interactive Dot Plot
idotplot( object, x = "GeneRatio", color = "p.adjust", showCategory = 10, size = "Count", label_format = 30, trigger = c("click", "hover"), title = "", ... )idotplot( object, x = "GeneRatio", color = "p.adjust", showCategory = 10, size = "Count", label_format = 30, trigger = c("click", "hover"), title = "", ... )
object |
enrichment result object (e.g. enrichResult) or a data frame |
x |
x-axis variable, one of 'GeneRatio', 'Count', etc. |
color |
variable for color, e.g., 'p.adjust' |
showCategory |
number of categories to show |
size |
variable for size, e.g., 'Count' |
label_format |
a numeric value sets wrap length, alternatively a custom function to format axis labels. |
trigger |
interaction trigger, one of "click" or "hover" |
title |
plot title |
... |
additional parameters passed to fortify |
ggplot object with interactive layers
Guangchuang Yu
Visualize points in volcano plot
ivolcano_point( data, logFC_col = "logFC", pval_col = "adj.P.Val", gene_col = "gene", title = "Volcano Plot", interactive = TRUE, onclick_fun = NULL, pval_cutoff = 0.05, logFC_cutoff = 1, pval_cutoff2 = NULL, logFC_cutoff2 = NULL, size_by = "none", point_size = list(base = 2, medium = 4, large = 6), tooltip_cols = NULL, tooltip_labels = NULL )ivolcano_point( data, logFC_col = "logFC", pval_col = "adj.P.Val", gene_col = "gene", title = "Volcano Plot", interactive = TRUE, onclick_fun = NULL, pval_cutoff = 0.05, logFC_cutoff = 1, pval_cutoff2 = NULL, logFC_cutoff2 = NULL, size_by = "none", point_size = list(base = 2, medium = 4, large = 6), tooltip_cols = NULL, tooltip_labels = NULL )
data |
A data frame that contains minimal information with gene id, logFC and adjusted P values |
logFC_col |
column name in 'data' that stored the logFC values |
pval_col |
column name in 'data' that stored the adjusted P values |
gene_col |
column name in 'data' that stored the gene IDs |
title |
plot title |
interactive |
whether plot the graph in interactive mode |
onclick_fun |
effects when click on the dot (gene), default is NULL |
pval_cutoff |
cutoff of the adjusted P values |
logFC_cutoff |
cutoff of the logFC values |
pval_cutoff2 |
second cutoff of the adjusted P values for advanced mode |
logFC_cutoff2 |
second cutoff of the logFC values for advanced mode |
size_by |
one of "none" (default), "manual" (set by |
point_size |
set point size when |
tooltip_cols |
extra column names in 'data' to display in tooltip (e.g., c("biotype", "description")). When NULL (default), only gene ID, logFC, and p-value are shown. |
tooltip_labels |
display labels for the extra columns. If NULL or length differs from tooltip_cols, raw column names are used. |
base plot of a volcano plot
onclick function to popup Ensembl gene webpage
onclick_ensembl(gene)onclick_ensembl(gene)
gene |
query gene |
onclick action
Guangchuang Yu
generate onclick function from fanyi::gene_summary() output
onclick_fanyi(gene_summary, cols)onclick_fanyi(gene_summary, cols)
gene_summary |
output from |
cols |
selected columns from 'gene_summary' |
onclick function
Guangchuang Yu
onclick function to popup genecards webpage
onclick_genecards(gene)onclick_genecards(gene)
gene |
query gene |
onclick action
Guangchuang Yu
onclick function to popup HGNC gene webpage
onclick_hgnc(gene)onclick_hgnc(gene)
gene |
query gene |
onclick action
Guangchuang Yu
onclick function to popup NCBI gene webpage
onclick_ncbi(gene)onclick_ncbi(gene)
gene |
query gene |
onclick action
Guangchuang Yu
onclick function to popup PubMed webpage
onclick_pubmed(gene)onclick_pubmed(gene)
gene |
query gene |
onclick action
Guangchuang Yu
onclick function to popup UniProt webpage
onclick_uniprot(gene)onclick_uniprot(gene)
gene |
query gene |
onclick action
Guangchuang Yu
Combine Interactive Pathway Dot Plot and Volcano Plot
pathway_volcano( p1, p2, widths = c(1, 1), trigger = c("click", "hover"), hover_css = "stroke:red;stroke-width:2px;", hover_inv_css = "opacity:0.15;", tooltip_css = "background:#fff;color:#000;border:1px solid #999;padding:6px;border-radius:4px;", non_selected_color = "#BDBDBD", non_selected_opacity = 0.25, label_follow = TRUE, ... )pathway_volcano( p1, p2, widths = c(1, 1), trigger = c("click", "hover"), hover_css = "stroke:red;stroke-width:2px;", hover_inv_css = "opacity:0.15;", tooltip_css = "background:#fff;color:#000;border:1px solid #999;padding:6px;border-radius:4px;", non_selected_color = "#BDBDBD", non_selected_opacity = 0.25, label_follow = TRUE, ... )
p1 |
interactive dot plot (from idotplot) |
p2 |
interactive volcano plot (from ivolcano) |
widths |
relative widths of the two plots, default is c(1, 1) |
trigger |
interaction trigger, one of "click" or "hover" |
hover_css |
css for hovered elements |
hover_inv_css |
css for non-hovered elements |
tooltip_css |
css for tooltip |
non_selected_color |
color for non-selected volcano points |
non_selected_opacity |
opacity for non-selected volcano points |
label_follow |
whether volcano labels follow pathway selection |
... |
additional parameters passed to ggiraph::girafe |
a girafe object
Guangchuang Yu
scale_color_figureya
scale_color_figureya( mode = c("classic", "advanced"), na.value = "grey80", guide = "none", ... )scale_color_figureya( mode = c("classic", "advanced"), na.value = "grey80", guide = "none", ... )
mode |
one of "classic" or "advanced" |
na.value |
color for NA values |
guide |
guide parameter passed to ggplot2::scale_color_manual |
... |
additional parameters passed to ggplot2::scale_color_manual |
A ggplot2 scale object