2020-11-17
2020-11-17 本文已影响0人
Dcam
Day1-jam
效率工具
chrome(一直就是使用谷歌,推荐风车云马这一款梯子,主要是稳定)
Everthing
snipaste
桌面版微信
笔记整理
幕布(学生可以免费领取一年会员)
image.pngXmind(使用过,不及幕布)
学习一段代码如下(使用compareCluster函数)对应帖子
if(!require("clusterProfiler")) BiocManager::install("clusterProfiler",ask = F,update = F)
library(clusterProfiler)
if(!require("org.Mm.eg.db")) BiocManager::install("org.Mm.eg.db",ask = F,update = F)
library(org.Mm.eg.db)
tmp <- bitr(group_g$gene,fromType = "ENSEMBL",
toType = "ENTREZID",
OrgDb = "org.Mm.eg.db")
de_gene_cluster <- merge(tmp,group_g,by.x="ENSEMBL",by.y="gene")
table(de_gene_cluster$group)
###run go analysis
formula_res <- compareCluster(
ENTREZID~group,
data = de_gene_cluster,
fun = "enrichGO",
OrgDb = "org.Mm.eg.db",
style="margin: 0px; padding: 0px; font-size: inherit; line-height: inherit; color: rgb(80, 161, 79); overflow-wrap: inherit !important; word-break: inherit !important;">"BP",
pAdjustMethod = "BH",
pvalueCutoff = 0.01,
qvalueCutoff = 0.05
)
lineage1_ego <-simplify(
formula_res,
cutoff=0.5,
by="p.adjust",
select_fun=min
)
save(group_g,formula_res,lineage1_ego,file="step5_GOananlysis.Rdata")
#出图
pdf("figures/step5_Microglia_GO_term_DE.pdf",width = 15,height = 15)
dotplot(lineage1_ego,showCategory=10)
dev.off()
write.csv(lineage1_ego@compareClusterResult,
file="figures/Microglia_GO_term_DE.csv")