Learn R Programming

gprofiler2 (version 0.2.3)

publish_gostplot: 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
)

Value

The output is a ggplot object.

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.

Author

Liis Kolberg <liis.kolberg@ut.ee>

Examples

Run this code
 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"))

Run the code above in your browser using DataLab