do_GroupedGOTermPlot: Compute an overview of the GO terms associated with the input...

View source: R/do_GroupedGOTermPlot.R

do_GroupedGOTermPlotR Documentation

Compute an overview of the GO terms associated with the input list of genes.

Description

Compute an overview of the GO terms associated with the input list of genes.

Usage

do_GroupedGOTermPlot(
  genes,
  org.db,
  levels.use = NULL,
  GO_ontology = "BP",
  min.overlap = 3,
  flip = TRUE,
  colors.use = c(Present = "#1e3d59", Absent = "#bccbcd"),
  legend.position = "bottom",
  reverse.levels = TRUE,
  axis.text.x.angle = 45,
  font.size = 10,
  font.type = "sans",
  plot.title = paste0("GO | ", GO_ontology),
  plot.subtitle = NULL,
  plot.caption = NULL,
  verbose = FALSE,
  return_matrices = 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.

levels.use

numeric | Vector of numerics corresponding to the GO ontology levels to plot. If NULL will compute all recursively until there are no results.

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.

flip

logical | Whether to invert the axis of the displayed plot.

colors.use

character | Named vector with two colors assigned to the names Present and Absent.

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.

reverse.levels

logical | Whether to place the higher levels first when computing the joint heatmap.

axis.text.x.angle

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

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.

plot.title, plot.subtitle, plot.caption

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

verbose

logical | Whether to show extra comments, warnings,etc.

return_matrices

logical | Returns the matrices of grouped GO terms.

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 all the matrices for the respective GO levels and all the individual and combined heatmaps.

Examples


  # Check Suggests.
  value <- SCpubr:::check_suggests(function_name = "do_GroupedGOTermPlot", 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_GroupedGOTermPlot(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.