Package 'ivolcano'

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

Help Index


geom_ivolcano_gene

Description

Add gene labels to ivolcano plot

interactive volcano plot

Usage

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
)

Arguments

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), "negLogP", "absLogFC", or other variable in the input data to scale dot sizes.

point_size

set point size when size_by is "manual", a list with three elements: base, medium, large.

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.

Value

volcano plot

Author(s)

Guangchuang Yu

Examples

# 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
)

geom_ivolcano_line

Description

Add threshold lines to an iVolcano plot

Usage

geom_ivolcano_line(linetype = "longdash", color = "grey40", linewidth = 0.5)

Arguments

linetype

line type for the threshold lines

color

line color for the threshold lines

linewidth

line width for the threshold lines

Value

A ggplot2 layer object


idotplot

Description

Interactive Dot Plot

Usage

idotplot(
  object,
  x = "GeneRatio",
  color = "p.adjust",
  showCategory = 10,
  size = "Count",
  label_format = 30,
  trigger = c("click", "hover"),
  title = "",
  ...
)

Arguments

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

Value

ggplot object with interactive layers

Author(s)

Guangchuang Yu


ivolcano_point

Description

Visualize points in volcano plot

Usage

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
)

Arguments

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), "negLogP", "absLogFC", or other variable in the input data to scale dot sizes.

point_size

set point size when size_by is "manual", a list with three elements: base, medium, large.

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.

Value

base plot of a volcano plot


onclick_ensembl

Description

onclick function to popup Ensembl gene webpage

Usage

onclick_ensembl(gene)

Arguments

gene

query gene

Value

onclick action

Author(s)

Guangchuang Yu


onclick_fanyi

Description

generate onclick function from fanyi::gene_summary() output

Usage

onclick_fanyi(gene_summary, cols)

Arguments

gene_summary

output from fanyi::gene_summary()

cols

selected columns from 'gene_summary'

Value

onclick function

Author(s)

Guangchuang Yu


onclick_genecards

Description

onclick function to popup genecards webpage

Usage

onclick_genecards(gene)

Arguments

gene

query gene

Value

onclick action

Author(s)

Guangchuang Yu


onclick_hgnc

Description

onclick function to popup HGNC gene webpage

Usage

onclick_hgnc(gene)

Arguments

gene

query gene

Value

onclick action

Author(s)

Guangchuang Yu


onclick_ncbi

Description

onclick function to popup NCBI gene webpage

Usage

onclick_ncbi(gene)

Arguments

gene

query gene

Value

onclick action

Author(s)

Guangchuang Yu


onclick_pubmed

Description

onclick function to popup PubMed webpage

Usage

onclick_pubmed(gene)

Arguments

gene

query gene

Value

onclick action

Author(s)

Guangchuang Yu


onclick_uniprot

Description

onclick function to popup UniProt webpage

Usage

onclick_uniprot(gene)

Arguments

gene

query gene

Value

onclick action

Author(s)

Guangchuang Yu


Launch a pathway-selection Shiny explorer

Description

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.

Usage

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"
)

Arguments

enrichment

enrichment result object or data frame. Objects supported by ggplot2::fortify() (for example, clusterProfiler::enrichResult) are converted automatically.

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 /, ⁠;⁠, ⁠,⁠, or |.

pathway_p_col

pathway adjusted P-value column. If absent, the table displays NA for FDR.

pathway_ratio_col

optional GeneRatio column.

gene_col

gene identifier column in gene_data.

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. NULL keeps all pathways.

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 shiny::runApp(). The default returns a shiny.appobj for embedding or testing.

app_title

title shown above the application.

Value

A shiny.appobj invisibly when launch = FALSE; when launch = TRUE the function runs the application and returns after it is closed.

Author(s)

Guangchuang Yu


scale_color_figureya

Description

scale_color_figureya

Usage

scale_color_figureya(
  mode = c("classic", "advanced"),
  na.value = "grey80",
  guide = "none",
  ...
)

Arguments

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

Value

A ggplot2 scale object