cluster差異基因?qū)ふ壹癎O、KEGG注釋

library(Seurat)

library(dplyr)

library(clusterProfiler)

library(ggplot2)

for( j in 0:12)

{

cluster.markers <- FindMarkers(object = combined, ident.1 =j, logfc.threshold = 0.25, test.use = "bimod", only.pos = TRUE)

cluster<- row.names.data.frame(cluster.markers)

cluster=bitr(cluster,fromType = "SYMBOL",toType = c("ENTREZID"),OrgDb = "org.Hs.eg.db")

cluster.go<-enrichGO(gene=cluster[,"ENTREZID"],keyType = "ENTREZID",OrgDb=org.Hs.eg.db,ont = "ALL",pAdjustMethod = "BH",pvalueCutoff = 0.01,qvalueCutoff = 0.05,readable = TRUE)

assign(paste0("cluster",j,".go"),cluster.go)

pdf(file = paste0("cluster",j,"go.pdf"),,width=20,height=10)

barplot(cluster.go,showCategory=50)

dev.off()

這里可以分別對一個個cluster進行注釋。

cluster.kegg<-enrichKEGG(gene = cluster[,"ENTREZID"],organism = 'hsa', pvalueCutoff = 0.05,pAdjustMethod = 'BH', minGSSize = 10,maxGSSize = 500,qvalueCutoff = 0.2,use_internal_data = FALSE)

assign(paste0("cluster",j,".kegg"),cluster.kegg)

pdf(file = paste0("cluster",j,"kegg.pdf"),,width=20,height=10)

dotplot(cluster.kegg,showCategory=50)

dev.off()

write.csv(x=cluster.markers,file=paste0("cluster",j,".csv"))

}

作者:阿糖胞苷_SYSU

鏈接:http://www.itdecent.cn/p/0b80b24b0d03

來源:簡書

著作權(quán)歸作者所有。商業(yè)轉(zhuǎn)載請聯(lián)系作者獲得授權(quán),非商業(yè)轉(zhuǎn)載請注明出處。

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

相關閱讀更多精彩內(nèi)容

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