| Title: | Create Volcano Plots for Differential Gene Expression Data |
|---|---|
| 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. |
| Authors: | Loukas Theodosiou [aut, cre] (ORCID: <https://orcid.org/0000-0001-6418-4652>) |
| Maintainer: | Loukas Theodosiou <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-21 07:55:35 UTC |
| Source: | https://github.com/loukesio/ggvolc |
A dataset containing gene expression analysis results. It has seven columns capturing various statistics related to gene expression.
all_genesall_genes
A data frame with the following columns:
Character. Gene name or identifier.
Numeric. The base mean value for the gene across samples.
Numeric. The log2 fold change of gene expression. Positive values indicate upregulation and negative values indicate downregulation.
Numeric. Standard error of the log2 fold change.
Numeric. The Wald statistic for the gene's expression change.
Numeric. Raw p-value for the test of the gene's expression change.
Numeric. Adjusted p-value for multiple testing corrections.
A dataset containing specific genes of interest referred to as "attention genes".
attention_genesattention_genes
A data frame with 10 rows and 7 variables:
Character. Gene name or identifier.
Numeric vector: Base mean expression level of genes
Numeric vector: Log2 Fold Change of gene expression
Numeric vector: Standard error for log2 fold change
Numeric vector: Wald statistic for the gene's expression change
Numeric vector: Raw p-value from Wald test
Numeric vector: Adjusted p-value for multiple testing using the Benjamini-Hochberg procedure
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.
genes_table(plot_obj, data2)genes_table(plot_obj, data2)
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". |
A gtable object showing the ggplot stacked above a table of gene details.
# 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)# 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)
This function creates a volcano plot using ggplot2 based on provided datasets. It is particularly useful for visualizing differential gene expression data.
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 )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 )
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. |
A ggplot2 object displaying the volcano plot.
# 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)# 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)