This document describes how to use the EnrichR package. Below is a simple manual for using the package

Introduction

You can do enrichment analysis for different type of annotation data (GO,KEGG,Reactome(may need reactome.db if you work with Human,PFAM and InterPro)

Quick tour

set.seed(1234)   
library(EnrichR)   
# To check if your the current species if supported !!!
showData()   
#showensemble()  
#showplant()
# Make the GO and KEGG Pathway data for your analysis
# find suitable species name by using showensemble()    
hsa_go<-makeGOdat(species="human",keytype="SYMBOL")
hsa_ko<-makeKOdat(species = "human",keytype="SYMBOL",builtin = F)
# find suitable species name supported by reactome by using showAvailableRO()
# if you want have RO data just run
# hsa_ro<-makeROdata(species = "Homo_sapiens") 

Make annotation from Ensemble

# rice_go<-makeplantann(species="Oryza sativa Japonica",ann_type = "GO")   #check the species name by using showplant()
# rice_ko<-makeplantann(species="Oryza sativa Japonica",ann_type = "KEGG") 
# rice_pfam<-makeplantann(species="Oryza sativa Japonica",ann_type = "PFAM")
# rice_inter<-makeplantann(species="Oryza sativa Japonica",ann_type = "InterPro")
# rice_ro<-makePlantROdat(species = "Oryza_sativa") #check the species name by using showAvailablePlants()
## MSU version GO and KEGG infromation also supported named ricego,riceko   
## Zea may V2 GO and KEGG annotation data also supported named zm_v2_go and zm_v2_ko
# we also collect Reactome database for plant, you can just use makePlantROdat function to get RO data.   

Functional Enrichment Analysis

Gene ontology enrichment analysis

df<-data.frame(gene=sample(unique(hsa_go$SYMBOL),2000),padj=abs(rnorm(2000,0,0.01)))
rownames(df)<-df$gene
res<-GE(df,GO_FILE = hsa_go,gene.cutoff = 0.01)
head(res)
## Gene ontology enrichment analysis results
GE.plot(resultFis =res,top=20,usePadj=F,pvalue.cutoff=0.05)
## You can use default paramters, the command above just to show if you want use pvalue as cut off value.
## Rich Factor: The proportion of numbers of genes in specific GO terms and numbers of all genes in the specific GO terms among the whole genomes. Color scale indicates significance level. 

KEGG pathway enrichment analysis

## KEGG pathway Enrichment analysis results
resk<-KE(df,KO_FILE = hsa_ko,gene.cutoff = 0.05,builtin = F)
head(resk)
KE.plot(resultFis = resk,top=10,pvalue.cutoff = 0.05)
## Size indicates gene numbers in specific KEGG pathway          

Network Generation with enrichment results

You can also get network graphic for any type of enrichment analysis result and also combine different enrichment result

richplot(res,top=20,usePadj=F)
netmap(df=df,rhs=res,top=20,pvalue.cutoff = 0.05,weightcut = 0.01,visNet = T,nodeselect=T)
## df could be the vector you used for enrichment analysis
gnet(df=df,rhs=res,top=20,pvalue.cutoff = 0.05,weightcut = 0.01,vertex.label.cex=4)
mnetmap(df=df,gores=res[1:30,],kores=resk,pvalue.cutoff = 0.05,top=50)

Get details include the input information

resgo<-getdetail(res,df);
head(resgo,6);
resko<-getdetail(resk,df);
head(resko,6)

Have funs!



guokai8/Enrichr documentation built on May 16, 2020, 10:24 p.m.