GO 注释
ego <- enrichGO(gene = gene_diff,
universe = gene_all,
OrgDb = org.Hs.eg.db,
ont = 'BP' , # 'BP','MF','CC'
pAdjustMethod = "BH",
pvalueCutoff = 0.99,
qvalueCutoff = 0.99,
readable = TRUE)
enrich_GO=dotplot(ego)
print(enrich_GO)
KEGG注释
kk.up <- enrichKEGG(gene = gene_up,
organism = 'hsa',
universe = gene_all,
pvalueCutoff = 0.01,
qvalueCutoff =0.01)
head(kk.up)[,1:6]
# browseKEGG(kk.up,'hsa05323') ### 查看通路富集图
browseKEGG(kk.up,'hsa04512')
g_kegg_up=dotplot(kk.up)
print(g_kegg_up)
kegg_up_dt <- as.data.frame(kk.up)
write.csv(kegg_up_dt,file='kegg_up_dt.csv')
Go注释批量导出结果
for (i in 1:3){
for (j in 1:3){
fn=paste0('./figure/dotplot_',n1[i],'_',n2[j],'.png')
cat(paste0(fn,'\n'))
png(fn,res=150,width = 1080)
print(dotplot(go_enrich_results[[i]][[j]] ))
dev.off()
}
}
for (i in 1:3){
for (j in 1:3){
fn=paste0('./figure/dotplot_',n1[i],'_',n2[j],'.csv')
cat(paste0(fn,'\n'))
result <- as.data.frame(go_enrich_results[[i]][[j]])[as.data.frame(go_enrich_results[[i]][[j]])$p.adjust< 0.05,]
write.csv(result,file = fn)
}
}
网友评论