enrichmentPlot: plot enrichment results

Description Usage Arguments Value Examples

View source: R/enrichmentPlot.R

Description

Plot the GO/KEGG/reactome enrichment results

Usage

1
2
3
4
5
6
enrichmentPlot(
  res,
  n = 20,
  strlength = 30,
  orderBy = c("pvalue", "termId", "none")
)

Arguments

res

output of getEnrichedGO, getEnrichedPATH.

n

number of terms to be plot.

strlength

shorten the description of term by the number of char.

orderBy

order the data by pvalue, termId or none.

Value

an object of ggplot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(enrichedGO)
enrichmentPlot(enrichedGO)
if (interactive()||Sys.getenv("USER")=="jianhongou") {
     
     library(org.Hs.eg.db)
     library(GO.db)
     bed <- system.file("extdata", "MACS_output.bed", package="ChIPpeakAnno")
     gr1 <- toGRanges(bed, format="BED", header=FALSE) 
     gff <- system.file("extdata", "GFF_peaks.gff", package="ChIPpeakAnno")
     gr2 <- toGRanges(gff, format="GFF", header=FALSE, skip=3)
     library(EnsDb.Hsapiens.v75) ##(hg19)
     annoData <- toGRanges(EnsDb.Hsapiens.v75)
     gr1.anno <- annoPeaks(gr1, annoData)
     gr2.anno <- annoPeaks(gr2, annoData)
     over <- lapply(GRangesList(gr1=gr1.anno, gr2=gr2.anno), 
                    getEnrichedGO, orgAnn="org.Hs.eg.db",
                    maxP=.05, minGOterm=10, condense=TRUE)
     enrichmentPlot(over)
 }

ChIPpeakAnno documentation built on April 1, 2021, 6:01 p.m.