scBarplotEnrichr: Barplot GO Enrichment Results by enrichplot

View source: R/Seurat.Utils.Visualization.R

scBarplotEnrichrR Documentation

Barplot GO Enrichment Results by enrichplot

Description

This function creates a bar plot of GO enrichment analysis results using the enrichplot::barplot.enrichResult function. It also allows saving the plot to a file.

Usage

scBarplotEnrichr(
  df.enrichment,
  tag = "...",
  universe = df.enrichment@universe,
  title = paste("GO Enriched Terms", tag),
  subtitle = kppws("Input: ", substitute_deparse(df.enrichment)),
  caption = paste0("Input genes: ", length(df.enrichment@gene), " | Enriched terms: ",
    nrow(df.enrichment), " | background genes: ", length(universe)),
  save = TRUE,
  w = 10,
  h = 10,
  also.pdf = FALSE,
  ...
)

Arguments

df.enrichment

Data frame. Enrichment results from GO analysis. Default: NULL.

tag

Character. Tag to be added to the title of the plot. Default: "in ...".

universe

Character. Background gene list (universe). Default: df.enrichment@universe.

title

Character. Title of the plot. Default: "GO Enrichment Analysis" followed by tag.

subtitle

Character. Subtitle of the plot. Default: NULL.

caption

Character. Caption of the plot. Default: constructed from input parameters.

save

Logical. Whether to save the plot to a file. Default: TRUE.

w

Width of the plot canvas, calculated as the width of an A4 page times scale; Default: 11.69 * scale.

h

Height of the plot canvas, calculated as the height of an A4 page times scale; Default: 8.27 * scale.

also.pdf

Save plot in both png and pdf formats.

...

Additional arguments passed to enrichplot::barplot.enrichResult.

Value

None. The function prints the plot and optionally saves it.

Examples

## Not run: ``
df.enrichment <- data.frame() # Example enrichment results data frame
plotGOEnrichment(df.enrichment)

## End(Not run)

vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.