GO KEGG GSEA-ClusterProfiler

library(clusterProfiler)

setwd("D:/Desktop/")

a=read.table("universeGeneIDs.txt",header = F,sep = "\t")


gene=as.character(a[,1])


ego<-enrichGO(gene = gene,'org.Hs.eg.db',ont = 'BP',pvalueCutoff = 0.01,readable = T)

write.table(ego,"go.txt",sep = "\t",quote = F,row.names = F)


barplot(ego,showCategory = 15,title = "EnrichmentGO")


dotplot(ego,title="EnrichmentGO_dot")


library(ggThemeAssist)

p<-dotplot(ego,title="EnrichmentGO_dot")

ggThemeAssistGadget(p)


ekk<-enrichKEGG(gene = gene,organism = "hsa",pAdjustMethod = "BH",pvalueCutoff = 0.01)

write.table(ekk,"kegg.txt",sep = "\t",quote = F,row.names = F)


barplot(ekk,showCategory = 15,title = "EnrichmentKEGG")


dotplot(ekk,title="EnrichmentKEGG_dot")


此外,還能做GSEA富集

gmtfile<-?system.file("extdata", "c5.cc.v5.0.entrez.gmt", package="clusterProfiler")#選擇GSEA數(shù)據(jù)庫(kù)用的,http://software.broadinstitute.org/gsea/msigdb/collections.jsp,前面?zhèn)z行大概就是來(lái)選擇GSEA的數(shù)據(jù)庫(kù)用的,c5.cc.v5.0.entrez.gmt這里他事例用的是GO的cc數(shù)據(jù)庫(kù),這個(gè)可以調(diào)整的,參考GSEA的網(wǎng)站來(lái)選擇

egmt <- enricher(gene, TERM2GENE=c5)

write.table(egmt,"egmt.txt",sep = "\t",quote = F)


另外,多個(gè)基因集時(shí)(eg,WGCNA得到的不同module的基因集),用compareCluster。


1.基因ID轉(zhuǎn)換

2.代碼


3.畫圖



最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容