do_FunctionalAnnotationPlot: Compute functional annotation plots using GO or KEGG...

View source: R/do_FunctionalAnnotationPlot.R

do_FunctionalAnnotationPlotR Documentation

Compute functional annotation plots using GO or KEGG ontologies

Description

Compute functional annotation plots using GO or KEGG ontologies

Usage

do_FunctionalAnnotationPlot(
  genes,
  org.db,
  organism = "hsa",
  database = "GO",
  GO_ontology = "BP",
  min.overlap = NULL,
  p.adjust.cutoff = 0.05,
  pAdjustMethod = "BH",
  minGSSize = 10,
  maxGSSize = 500,
  font.size = 10,
  font.type = "sans",
  axis.text.x.angle = 45,
  xlab = NULL,
  ylab = NULL,
  plot.title = NULL,
  plot.subtitle = NULL,
  plot.caption = NULL,
  legend.type = "colorbar",
  legend.position = "bottom",
  legend.framewidth = 0.5,
  legend.tickwidth = 0.5,
  legend.length = 10,
  legend.width = 1,
  legend.framecolor = "grey50",
  legend.tickcolor = "white",
  number.breaks = 5,
  return_matrix = FALSE,
  grid.color = "white",
  border.color = "black",
  plot.title.face = "bold",
  plot.subtitle.face = "plain",
  plot.caption.face = "italic",
  axis.title.face = "bold",
  axis.text.face = "plain",
  legend.title.face = "bold",
  legend.text.face = "plain"
)

Arguments

genes

character | Vector of gene symbols to query for functional annotation.

org.db

OrgDB | Database object to use for the query.

organism

character | Supported KEGG organism.

database

character | Database to run the analysis on. One of:

  • GO.

  • KEGG.

GO_ontology

character | GO ontology to use. One of:

  • BP: For Biological Process.

  • MF: For Molecular Function.

  • CC: For Cellular Component.

min.overlap

numeric | Filter the output result to the terms which are supported by this many genes.

p.adjust.cutoff

numeric | Significance cutoff used to filter non-significant terms.

pAdjustMethod

character | Method to adjust for multiple testing. One of:

  • holm.

  • hochberg.

  • hommel.

  • bonferroni.

  • BH.

  • BY.

  • fdr.

  • none.

minGSSize

numeric | Minimal size of genes annotated by Ontology term for testing.

maxGSSize

numeric | Maximal size of genes annotated for testing.

font.size

numeric | Overall font size of the plot. All plot elements will have a size relationship with this font size.

font.type

character | Base font family for the plot. One of:

  • mono: Mono spaced font.

  • serif: Serif font family.

  • sans: Default font family.

axis.text.x.angle

numeric | Degree to rotate the X labels. One of: 0, 45, 90.

xlab, ylab

character | Titles for the X and Y axis.

plot.title, plot.subtitle, plot.caption

character | Title, subtitle or caption to use in the plot.

legend.type

character | Type of legend to display. One of:

  • normal: Default legend displayed by ggplot2.

  • colorbar: Redefined colorbar legend, using guide_colorbar.

legend.position

character | Position of the legend in the plot. One of:

  • top: Top of the figure.

  • bottom: Bottom of the figure.

  • left: Left of the figure.

  • right: Right of the figure.

  • none: No legend is displayed.

legend.framewidth, legend.tickwidth

numeric | Width of the lines of the box in the legend.

legend.length, legend.width

numeric | Length and width of the legend. Will adjust automatically depending on legend side.

legend.framecolor

character | Color of the lines of the box in the legend.

legend.tickcolor

character | Color of the ticks of the box in the legend.

number.breaks

numeric | Controls the number of breaks in continuous color scales of ggplot2-based plots.

return_matrix

logical | Returns the matrices with the enriched Terms for further use.

grid.color

character | Color of the grid in the plot. In heatmaps, color of the border of the cells.

border.color

character | Color for the border of the heatmap body.

plot.title.face, plot.subtitle.face, plot.caption.face, axis.title.face, axis.text.face, legend.title.face, legend.text.face

character | Controls the style of the font for the corresponding theme element. One of:

  • plain: For normal text.

  • italic: For text in itallic.

  • bold: For text in bold.

  • bold.italic: For text both in itallic and bold.

Value

A list containing a heatmap of the presence/absence of the genes in the enriched term, as well as a bar plot, dot plot and tree plot of the enriched terms.

Examples


  # Check Suggests.
  value <- SCpubr:::check_suggests(function_name = "do_FunctionalAnnotationPlot", passive = TRUE)

  if (isTRUE(value)){
    # Consult the full documentation in https://enblacar.github.io/SCpubr-book/

    # Need to load this library or equivalent.
    suppressMessages(library("org.Hs.eg.db"))

    # Define list of genes to query.
    genes.use <- c("CCR7", "CD14", "LYZ",
                   "S100A4", "MS4A1",
                   "MS4A7", "GNLY", "NKG7", "FCER1A",
                   "CST3", "PPBP")

    # Compute the grouped GO terms.
    out <- SCpubr::do_FunctionalAnnotationPlot(genes = genes.use,
                                               org.db = org.Hs.eg.db)

  } else if (base::isFALSE(value)){
    message("This function can not be used without its suggested packages.")
    message("Check out which ones are needed using `SCpubr::state_dependencies()`.")
  }


SCpubr documentation built on Oct. 11, 2023, 5:15 p.m.