Learn R Programming

annotaR (version 0.1.1)

plot_enrichment_dotplot: Plot GO Enrichment Results as a Dot Plot

Description

Creates a publication-ready dot plot from the results of an add_go_terms() call. The plot shows the top enriched terms, with dot size representing the number of genes and color representing the p-value.

Usage

plot_enrichment_dotplot(
  annotaR_object,
  n_terms = 20,
  title = "Top GO Enrichment Results"
)

Value

A ggplot object.

Arguments

annotaR_object

An object processed by add_go_terms(). Must contain term_name, p_value, and gene columns.

n_terms

The maximum number of top terms to display, ordered by p-value. Defaults to 20.

title

The title of the plot.

Examples

Run this code
# Create a dummy annotaR object with enrichment data
annotated_data <- tibble::tibble(
  gene = c("TP53", "TP53", "EGFR"),
  term_name = c("Cell cycle", "Apoptosis", "Cell cycle"),
  p_value = c(0.001, 0.005, 0.001),
  source = "GO:BP",
  intersection = "TP53,EGFR"
)

plot_enrichment_dotplot(annotated_data)

Run the code above in your browser using DataLab