| 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.7 |
| Built: | 2026-09-28 15:53:59 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
The application presents pathway enrichment results in a searchable DT table. Selecting one or more rows reactively highlights the union of their matched genes in a ggplot2/ggiraph volcano plot and lists the selected genes below the plot.
pathway_app( enrichment, gene_data, pathway_col = "Description", pathway_gene_col = "geneID", pathway_p_col = "p.adjust", pathway_ratio_col = "GeneRatio", gene_col = "gene", gene_effect_col = "logFC", gene_p_col = "adj.P.Val", show_pathways = NULL, gene_id_case = c("asis", "upper", "lower"), pval_cutoff = 0.05, logFC_cutoff = 1, launch = FALSE, app_title = "Pathway-gene explorer" )pathway_app( enrichment, gene_data, pathway_col = "Description", pathway_gene_col = "geneID", pathway_p_col = "p.adjust", pathway_ratio_col = "GeneRatio", gene_col = "gene", gene_effect_col = "logFC", gene_p_col = "adj.P.Val", show_pathways = NULL, gene_id_case = c("asis", "upper", "lower"), pval_cutoff = 0.05, logFC_cutoff = 1, launch = FALSE, app_title = "Pathway-gene explorer" )
enrichment |
enrichment result object or data frame. Objects supported
by |
gene_data |
data frame containing one row per gene and its effect size. |
pathway_col |
column containing pathway descriptions. |
pathway_gene_col |
column containing pathway member IDs. IDs may be
separated by |
pathway_p_col |
pathway adjusted P-value column. If absent, the table
displays |
pathway_ratio_col |
optional GeneRatio column. |
gene_col |
gene identifier column in |
gene_effect_col |
gene effect column, usually logFC. |
gene_p_col |
gene P-value column, usually adjusted P-value. |
show_pathways |
optional number of pathways to show. |
gene_id_case |
whether IDs should be matched as-is, upper-cased, or lower-cased. |
pval_cutoff |
gene P-value cutoff used for volcano classification. |
logFC_cutoff |
absolute effect cutoff used for volcano classification. |
launch |
whether to immediately launch the application with
|
app_title |
title shown above the application. |
A shiny.appobj invisibly when launch = FALSE; when launch = TRUE
the function runs the application and returns after it is closed.
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