plotGODot: Visualize GO enrichment test result in dot plot

View source: R/GSEA.R

plotGODotR Documentation

Visualize GO enrichment test result in dot plot

Description

Visualize GO enrichment test result in dot plot

Usage

plotGODot(
  result,
  group = NULL,
  query = c("Up", "Down"),
  pvalThresh = 0.05,
  n = 20,
  termIDMatch = "^GO",
  colorPalette = "E",
  colorDirection = 1,
  xlab = "-log10(P-value)",
  ylab = "Term name",
  ...
)

Arguments

result

Returned list object from runGOEnrich.

group

Character vector of group names, must be available in names(result). Default NULL make plots for all groups.

query

A single string selecting from which query to show the result. Choose from "Up" for results using up-regulated genes, "Down" for down-regulated genes. Default "Up".

pvalThresh

Numeric scalar, cutoff for p-value where smaller values are considered as significant. Default 0.05.

n

Number of top terms to be shown, ranked by p-value. Default 20.

termIDMatch

Regular expression pattern to match the term ID. Default "^GO" for only using GO terms from returned results.

colorPalette, colorDirection

Viridis palette options. Default "E" and 1.

xlab, ylab

Axis title for x and y axis. Default "-log10(P-value)" and "Term name", respectively.

...

Arguments passed on to .ggplotLigerTheme

legendColorTitle

Legend title text for color aesthetics, often used for categorical or continuous coloring of dots. Default NULL shows the original variable name.

legendSizeTitle

Legend title text for size aesthetics, often used for sizing dots by continuous variable. Default NULL shows the original variable name.

showLegend

Whether to show the legend. Default TRUE.

legendPosition

Text indicating where to place the legend. Choose from "top", "bottom", "left" or "right". Default "right".

baseSize

One-parameter control of all text sizes. Individual text element sizes can be controlled by other size arguments. "Title" sizes are 2 points larger than "text" sizes when being controlled by this.

titleSize,xTitleSize,yTitleSize,legendTitleSize

Size of main title, axis titles and legend title. Default NULL controls by baseSize + 2.

subtitleSize,xTextSize,yTextSize,legendTextSize

Size of subtitle text, axis texts and legend text. Default NULL controls by baseSize.

plotly

Whether to use plotly to enable web based interactive browsing for the plot. Requires installation of package "plotly". Default FALSE.

Value

A ggplot object if only one group or a list of ggplot objects.

Examples


defaultCluster(pbmc) <- pbmcPlot$leiden_cluster
# Test the DEG between "stim" and "ctrl", within each cluster
result <- runPairwiseDEG(
    pbmc,
    groupTest = "stim",
    groupCtrl = "ctrl",
    variable1 = "dataset",
    splitBy = "defaultCluster"
)
# Setting `significant = FALSE` because it's hard for a gene list obtained
# from small test dataset to represent real-life biology.
if (requireNamespace("gprofiler2", quietly = TRUE)) {
    go <- runGOEnrich(result, group = "0.stim", splitReg = TRUE, significant = FALSE)
    # The toy example won't have significant result.
    plotGODot(go)
}


rliger documentation built on Oct. 30, 2024, 1:07 a.m.