source("http://www.bioconductor.org/biocLite.R")#启动bioconductor
biocLite("clusterProfiler")#安装clusterProfiler包
library(clusterProfiler)
##文件为一列gene entrezID, 文件名设为 enterz.txt
setwd("d:/") #设置目录
getwd() #查看目录
biocLite("org.Hs.eg.db")
library(org.Hs.eg.db)
ego <- enrichGO(OrgDb="org.Hs.eg.db", gene =genelist, ont = "CC", pvalueCutoff = 0.01, readable= TRUE)#GO富集分析
write.csv(summary(ego),"GO-enrich.csv",row.names=F) #写入文件
ekk <- enrichKEGG(gene=genelist,organism
write.csv(summary(ekk),"KEGG-enrich.csv",row.names=F) #写入文件
dotplot(ego,showCategory=10,title="Enrichment GOTop10") #泡泡图
barplot(ego, showCategory=20,title="EnrichmentGO")
联系客服