createBasicEmap: Create a basic enrichment map

View source: R/methodsEmapInternal.R

createBasicEmapR Documentation

Create a basic enrichment map

Description

The function creates a basic enrichment map using functional enrichment results.

Usage

createBasicEmap(
  gostResults,
  backgroundGenes,
  showCategory,
  groupCategory,
  categoryLabel,
  categoryNode,
  significantMethod,
  line,
  force
)

Arguments

gostResults

a data.frame containing the enrichment results to be plot.

backgroundGenes

a vector of character string representing the name of the genes present in the request.

showCategory

a positive integer or a vector of characters representing terms. If a integer, the first n terms will be displayed. If vector of terms, the selected terms will be displayed.

groupCategory

a logical indicating if the categories should be grouped.

categoryLabel

a positive numeric representing the amount by which plotting category nodes label size should be scaled relative to the default (1).

categoryNode

a positive numeric representing the amount by which plotting category nodes should be scaled relative to the default (1).

significantMethod

a character string representing the name of the multiple testing correction method used on the results.

line

a non-negative numeric representing the scale of line width.

force

a logical indicating if the repulsion between overlapping text labels should be forced.

Value

a ggplot object representing the enrichment map.

Author(s)

Astrid DeschĂȘnes

Examples


## Load the result of an enrichment analysis done with gprofiler2
data(parentalNapaVsDMSOEnrichment)

## Only retain the results section
gostResults <- as.data.frame(parentalNapaVsDMSOEnrichment$result)

## Limit the results to Wikipathways
## and remove the root term
gostResults <- gostResults[which(gostResults$source == "WP"),]
gostResults <- gostResults[which(gostResults$term_id != "WIKIPATHWAYS"),]

## Extract meta data information
meta <- parentalNapaVsDMSOEnrichment$meta

## Get all background genes
backgroundGenes <- meta$query_metadata$queries[["parental_napa_vs_DMSO"]]

## Get significant method
significantMethod <- meta$query_metadata$significance_threshold_method

## Create basic enrichment map using Wikipathways terms
enrichViewNet:::createBasicEmap(gostResults=gostResults, 
    backgroundGenes=backgroundGenes, showCategory=30L, 
    groupCategory=FALSE, categoryLabel=1, categoryNode=1,
    significantMethod=significantMethod, line=1, force=FALSE)
    

adeschen/gprofiler2cytoscape documentation built on April 26, 2024, 9:33 p.m.