publish_gostplot: Create and save an annotated Manhattan plot of enrichment...

View source: R/gprofiler2.R

publish_gostplotR Documentation

Create and save an annotated Manhattan plot of enrichment results.

Description

This function allows to highlight a list of selected terms on the Manhattan plot created with the gprofiler2::gostplot() function. The resulting plot is saved to a publication ready image if 'filename' is specified. The plot is very similar to the one shown in the g:GOSt web tool after clicking on circles.

Usage

publish_gostplot(
  p,
  highlight_terms = NULL,
  filename = NULL,
  width = NA,
  height = NA
)

Arguments

p

ggplot object from gostplot(gostres, interactive = FALSE) function

highlight_terms

vector of selected term IDs from the analysis or a (subset) data.frame that has a column called 'term_id'. No annotation is added if set to NULL.

filename

file name to create on disk and save the annotated plot. Filename extension should be from c("png", "pdf", "jpeg", "tiff", "bmp").

width

plot width in inches. If not supplied, the size of current graphics device is used.

height

plot height in inches. If not supplied, the size of current graphics device is used.

Value

The output is a ggplot object.

Author(s)

Liis Kolberg <liis.kolberg@ut.ee>

Examples

 gostres <- gost(c("Klf4", "Pax5", "Sox2", "Nanog"), organism = "mmusculus")
 p <- gostplot(gostres, interactive = FALSE)
 publish_gostplot(p, highlight_terms = c("GO:0001010", "REAC:R-MMU-8939245"))

gprofiler2 documentation built on July 9, 2023, 6:06 p.m.