xEnrichLadderR Documentation

Function to visualise enrichment results using ladder-like plot

Description

xEnrichLadder is supposed to visualise enrichment results using ladder-like plot in which rows for terms and columns for its members. The members are sorted first by sharings and then by individual terms. It returns an object of class "ggplot".

Usage

xEnrichLadder(eTerm, sortBy = c("or", "adjp", "fdr", "pvalue",
"zscore", "fc",
"nAnno", "nOverlap", "none"), top_num = 10, FDR.cutoff = 0.05,
CI.one = T, colormap = "skyblue-darkblue", verbose = T)

Arguments

eTerm

an object of class "eTerm"

sortBy

which statistics will be used for sorting and viewing gene sets (terms). It can be "adjp" or "fdr" for adjusted p value (FDR), "pvalue" for p value, "zscore" for enrichment z-score, "fc" for enrichment fold change, "nAnno" for the number of sets (terms), "nOverlap" for the number in overlaps, "or" for the odds ratio, and "none" for ordering according to ID of terms

top_num

the number of the top terms (sorted according to FDR or adjusted p-values). 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

verbose

logical to indicate whether the messages will be displayed in the screen

Value

an object of class "ggplot"

Note

none

See Also

xEnrichViewer, xHeatmap

Examples

## Not run: 
# Load the XGR package and specify the location of built-in data
library(XGR)
RData.location <- "http://galahad.well.ox.ac.uk/bigdata_dev/"

data(Haploid_regulators)
## only IRF1 positive regulators
data <- subset(Haploid_regulators, Phenotype=='IRF1' &
MI<0)[,c('Gene')]

# 1) KEGGenvironmental
eTerm <- xEnricherGenes(data, ontology="KEGGenvironmental",
size.range=c(10,2000), min.overlap=5, RData.location=RData.location)
gp_ladder <- xEnrichLadder(eTerm)

# 2) PSG
eTerm <- xEnricherGenes(data,
ontology=c("PSG","Approved","GWAS","CGL")[1], size.range=c(1,20000),
min.overlap=0, RData.location=RData.location)
gp_ladder <- xEnrichLadder(eTerm, sortBy="none", top_num="auto",
FDR.cutoff=1)

# 3) save into the file "xEnrichLadder.pdf"
mat <- xSparseMatrix(gp_ladder$data)
pdf("xEnrichLadder.pdf", width=2+ncol(mat)*0.075,
height=2+nrow(mat)*0.1, compress=T)
print(gp_ladder)
dev.off()

## End(Not run)