xEnrichTreemap: Function to visualise enrichment results using a treemap

Description Usage Arguments Value Note See Also Examples

Description

xEnrichTreemap is supposed to visualise enrichment results using a treemap. The area is proportional to odds ratio, colored by the significance level. It returns an object of class "ggplot".

Usage

1
2
3
4
5
6
7
8
9
xEnrichTreemap(eTerm, top_num = 10, FDR.cutoff = 0.05, CI.one = T,
colormap = "spectral.top", ncolors = 64, zlim = NULL,
barwidth = NULL, barheight = 0.5, wrap.width = NULL,
font.family = "sans", drop = F, details = c("name", "name_FDR",
"name_FDR_members"), caption = T, treemap.grow = F,
treemap.reflow = F, treemap.place = "topleft",
treemap.color = "black", treemap.fontface = "bold.italic",
treemap.min.size = 4, area = c("adjp", "or"), area.fill = c("or",
"adjp", "zscore"))

Arguments

eTerm

an object of class "eTerm" or "ls_eTerm". Alterntively, it can be a data frame having all these columns (named as 'group','ontology','name','zscore','adjp','or','CIl','CIu','nOverlap','members_Overlap')

top_num

the number of the top terms (sorted according to OR). If it is 'auto', only the significant terms (see below FDR.cutoff) will be displayed

FDR.cutoff

FDR cutoff used to declare the significant terms. By default, it is set to 0.05

CI.one

logical to indicate whether to allow the inclusion of one in CI. By default, it is TURE (allowed)

colormap

short name for the colormap. It can be one of "jet" (jet colormap), "bwr" (blue-white-red colormap), "gbr" (green-black-red colormap), "wyr" (white-yellow-red colormap), "br" (black-red colormap), "yr" (yellow-red colormap), "wb" (white-black colormap), and "rainbow" (rainbow colormap, that is, red-yellow-green-cyan-blue-magenta). Alternatively, any hyphen-separated HTML color names, e.g. "blue-black-yellow", "royalblue-white-sandybrown", "darkgreen-white-darkviolet". A list of standard color names can be found in http://html-color-codes.info/color-names

ncolors

the number of colors specified over the colormap

zlim

the minimum and maximum z values for which colors should be plotted, defaulting to the range of the -log10(FDR)

barwidth

the width of the colorbar. Default value is 'legend.key.width' or 'legend.key.size' in 'theme' or theme

barheight

the height of the colorbar. Default value is 'legend.key.height' or 'legend.key.size' in 'theme' or theme

wrap.width

a positive integer specifying wrap width of name

font.family

the font family for texts

drop

logical to indicate whether all factor levels not used in the data will automatically be dropped. If FALSE (by default), all factor levels will be shown, regardless of whether or not they appear in the data

details

how to label. It can be one of 'name', 'name_FDR' (FDR/OR also appended to the name), and 'name_FDR_members' (FDR/OR plus members appended to the name; in this case, treemap.grow and treemap.reflow is forced to be true)

caption

logical to indicate whether the caption is shown on the bottom-right

treemap.grow

logical to indicate whether text will be grown as well as shrunk to fill the box

treemap.reflow

logical to indicate whether text will be reflowed (wrapped) to better fit the box

treemap.place

where inside the box to place the text. Default is "centre"; other options are "bottom", "top", "topleft", "topright", etc

treemap.color

the color of the text

treemap.fontface

the fontface of the text

treemap.min.size

the minimum font size, in points. If provided, text that would need to be shrunk below this size to fit the box will not be drawn. Defaults to 4 pt

area

which statistics will be used for the area. It can be "adjp" for adjusted p value (FDR) and "or" for odds ratio

area.fill

which statistics will be used for the area fill color. It can be "or" for the odds ratio, "adjp" for adjusted p value (FDR) and "zscore" for enrichment z-score

Value

an object of class "ggplot"

Note

none

See Also

xEnricherGenes, xEnricherSNPs, xEnrichViewer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## Not run: 
# Load the library
library(XGR)
RData.location <- "http://galahad.well.ox.ac.uk/bigdata/"
library(treemapify)

# provide the input Genes of interest (eg 100 randomly chosen human genes)
## load human genes
org.Hs.eg <- xRDataLoader(RData='org.Hs.eg',
RData.location=RData.location)
set.seed(825)
data <- as.character(sample(org.Hs.eg$gene_info$Symbol, 100))
data

# optionally, provide the test background (if not provided, all human genes)
#background <- as.character(org.Hs.eg$gene_info$Symbol)

# 1) Gene-based enrichment analysis using REACTOME pathways
# perform enrichment analysis
eTerm <- xEnricherGenes(data, ontology="REACTOME",
RData.location=RData.location)
## forest plot of enrichment results
gp <- xEnrichTreemap(eTerm, top_num=20, FDR.cutoff=0.05,
treemap.reflow=F, treemap.place="topleft")

# 2) Gene-based enrichment analysis using ontologies (REACTOME and GOMF)
# perform enrichment analysis
ls_eTerm <- xEnricherGenesAdv(data, ontologies=c("REACTOME","GOMF"),
RData.location=RData.location)
## forest plot of enrichment results
gp <- xEnrichTreemap(ls_eTerm, FDR.cutoff=0.1)

## End(Not run)

XGR documentation built on June 18, 2019, 3:01 p.m.

Related to xEnrichTreemap in XGR...