Type: Package
Title: Create Volcano Plots for Differential Gene Expression Data
Version: 0.1.0
Description: Provides functionality to create customizable volcano plots for visualizing differential gene expression analysis results. The package offers options to highlight genes of interest, adjust significance thresholds, customize colors, and add informative labels. Designed specifically for RNA-seq data analysis workflows.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Imports: dplyr, ggplot2, ggrepel, ggtext, gridExtra, grid
RoxygenNote: 7.3.3
Depends: R (≥ 3.5.0)
NeedsCompilation: no
Packaged: 2026-01-11 12:24:09 UTC; theodosiou
Author: Loukas Theodosiou ORCID iD [aut, cre]
Maintainer: Loukas Theodosiou <theodosiou@evolbio.mpg.de>
Repository: CRAN
Date/Publication: 2026-01-16 11:00:08 UTC

Gene Expression Analysis Dataset

Description

A dataset containing gene expression analysis results. It has seven columns capturing various statistics related to gene expression.

Usage

all_genes

Format

A data frame with the following columns:

genes

Character. Gene name or identifier.

baseMean

Numeric. The base mean value for the gene across samples.

log2FoldChange

Numeric. The log2 fold change of gene expression. Positive values indicate upregulation and negative values indicate downregulation.

lfcSE

Numeric. Standard error of the log2 fold change.

stat

Numeric. The Wald statistic for the gene's expression change.

pvalue

Numeric. Raw p-value for the test of the gene's expression change.

padj

Numeric. Adjusted p-value for multiple testing corrections.


Attention Genes Dataset

Description

A dataset containing specific genes of interest referred to as "attention genes".

Usage

attention_genes

Format

A data frame with 10 rows and 7 variables:

genes

Character. Gene name or identifier.

baseMean

Numeric vector: Base mean expression level of genes

log2FoldChange

Numeric vector: Log2 Fold Change of gene expression

lfcSE

Numeric vector: Standard error for log2 fold change

stat

Numeric vector: Wald statistic for the gene's expression change

pvalue

Numeric vector: Raw p-value from Wald test

padj

Numeric vector: Adjusted p-value for multiple testing using the Benjamini-Hochberg procedure


Combine a ggplot Object with a Table of Genes

Description

This function takes a ggplot object and a data frame of gene details and produces a combined plot where the ggplot object is stacked above a table of gene details.

Usage

genes_table(plot_obj, data2)

Arguments

plot_obj

A ggplot object, typically the output of a plotting function.

data2

A data frame containing gene details. It should have columns named "genes", "baseMean", "log2FoldChange", "pvalue", and "padj".

Value

A gtable object showing the ggplot stacked above a table of gene details.

Examples

# Load example datasets
data(all_genes)
data(attention_genes)

# Create a volcano plot highlighting genes of interest
plot <- ggvolc(all_genes, attention_genes, add_seg = TRUE)

# Combine the plot with a table showing gene statistics
# The table includes: gene names, baseMean, log2FoldChange, pvalue, and padj
genes_table(plot, attention_genes)


Create a Volcano Plot

Description

This function creates a volcano plot using ggplot2 based on provided datasets. It is particularly useful for visualizing differential gene expression data.

Usage

ggvolc(
  data1,
  data2 = NULL,
  size_var = NULL,
  p_value = 0.05,
  fc = 1,
  not_sig_color = "#808080",
  down_reg_color = "#00798c",
  up_reg_color = "#d1495b",
  add_seg = FALSE
)

Arguments

data1

Data frame for the primary dataset.

data2

Data frame for the secondary dataset. Default is NULL.

size_var

Variable for determining the size of points. Options are "log2FoldChange" and "pvalue". Default is "log2FoldChange".

p_value

Threshold for statistical significance. Default is 0.05.

fc

Fold change threshold for determining upregulated or downregulated genes. Default is 1.

not_sig_color

Color for non-significant genes. Default is "grey82".

down_reg_color

Color for downregulated genes. Default is "#00798c".

up_reg_color

Color for upregulated genes. Default is "#d1495b".

add_seg

Logical. If TRUE, dashed lines will be added to the plot indicating the p-value and fold change thresholds. Default is FALSE.

Value

A ggplot2 object displaying the volcano plot.

Examples

# Load example datasets included in the package
data(all_genes)
data(attention_genes)

# Create a basic volcano plot with default settings
# Points are colored by significance (p < 0.05, |log2FC| > 1)
ggvolc(all_genes)

# Highlight specific genes of interest with labels
# These genes are shown with black borders and gene names
ggvolc(all_genes, attention_genes)

# Add dashed lines to indicate significance thresholds
ggvolc(all_genes, attention_genes, add_seg = TRUE)

# Customize colors for up- and down-regulated genes
ggvolc(all_genes, attention_genes,
       up_reg_color = "#E63946",
       down_reg_color = "#457B9D")

# Scale point size by p-value instead of default
ggvolc(all_genes, attention_genes, size_var = "pvalue")

# Adjust significance thresholds (p-value and fold change)
ggvolc(all_genes, p_value = 0.01, fc = 2)


Print Welcome Message and ASCII Art upon Loading 'ggvolc'

Description

This function is executed when the 'ggvolc' package is attached to the R session. It prints a welcome message and an ASCII representation related to the package.

See Also

library

Examples

# The function is automatically called when you use:
# library(ggvolc)