plotCommunitiesEnrichment: Plot community-based enrichment results

View source: R/plot.R

plotCommunitiesEnrichmentR Documentation

Plot community-based enrichment results

Description

Similarly to plotGeneralEnrichment, the results of the community-based enrichment analysis are plotted.. By default, the results for the 10 largest communities are displayed. Additionally, if a general enrichment analysis was previously generated, this function plots an additional heatmap to compare the general enrichment with the community based enrichment. A reduced version of this heatmap is also produced where terms are filtered out to improve visibility and display and highlight the most significant terms.

Usage

plotCommunitiesEnrichment(
  GRN,
  outputFolder = NULL,
  basenameOutput = NULL,
  display = "byRank",
  communities = NULL,
  topn_pvalue = 30,
  p = 0.05,
  nSignificant = 2,
  nID = 10,
  maxWidth_nchar_plot = 100,
  display_pAdj = FALSE,
  plotAsPDF = TRUE,
  pdf_width = 12,
  pdf_height = 12,
  pages = NULL,
  forceRerun = FALSE
)

Arguments

GRN

Object of class GRN

outputFolder

Character or NULL. Default NULL. If set to NULL, the default output folder as specified when initiating the object in link{initializeGRN} will be used. Otherwise, all output from this function will be put into the specified folder. We recommend specifying an absolute path.

basenameOutput

NULL or character. Default NULL. Basename of the output files that are produced. If set to NULL, a default basename is chosen. If a custom basename is specified, all output files will have the chosen basename as file prefix, be careful with not overwriting already existing files (if forceRerun is set to TRUE)

display

Character. Default "byRank". One of: "byRank", "byLabel". Specify whether the communities will by displayed based on their rank, where the largest community (with most vertices) would have a rank of 1, or by their label. Note that the label is independent of the rank.

communities

NULL or numeric vector. Default NULL. If set to NULL, the default, all communities enrichments that have been calculated before are plotted. If a numeric vector is specified: Depending on what was specified in the display parameter, this parameter indicates either the rank or the label of the communities to be plotted. i.e. for communities = c(1,4), if display = "byRank" the results for the first and fourth largest communities are plotted. if display = "byLabel", the results for the communities labeled "1", and "4" are plotted.

topn_pvalue

Numeric. Default 30. Maximum number of ontology terms that meet the p-value significance threshold to display in the enrichment dot plot

p

Numeric. Default 0.05. p-value threshold to determine significance.

nSignificant

Numeric. Default 3. Threshold to filter out an ontology term with less than nSignificant overlapping genes.

nID

Numeric. Default 10. For the reduced heatmap, number of top terms to select per community.

maxWidth_nchar_plot

Integer (>=10). Default 100. Maximum number of characters for a term before it is truncated.

display_pAdj

TRUE or FALSE. Default FALSE. Is the p-value being displayed in the plots the adjusted p-value? This parameter is relevant for KEGG, Disease Ontology, and Reactome enrichments, and does not affect GO enrichments.

plotAsPDF

TRUE or FALSE. Default TRUE.Should the plots be printed to a PDF file? If set to TRUE, a PDF file is generated, the name of which depends on the value of basenameOutput. If set to FALSE, all plots are printed to the currently active device. Note that most functions print more than one plot, which means you may only see the last plot depending on your active graphics device.

pdf_width

Number. Default 12. Width of the PDF, in cm.

pdf_height

Number. Default 12. Height of the PDF, in cm.

pages

Integer vector or NULL. Default NULL. Page number(s) to plot. Can be used to plot only specific pages to a PDF or the currently active graphics device.

forceRerun

TRUE or FALSE. Default FALSE. Force execution, even if the GRN object already contains the result. Overwrites the old results.

Value

The same GRN object, without modifications. A single PDF file is produced with the results.

Examples

# See the Workflow vignette on the GRaNIE website for examples
GRN = loadExampleObject()
GRN = plotCommunitiesEnrichment(GRN, plotAsPDF = FALSE)

chrarnold/GRaNIE documentation built on April 28, 2022, 2:18 a.m.