对于非模式生物或者无参考基因组的项目,经常需要进行基因的功能注释,而GO注释是基因功能注释的重要部分。有很多软件能够获得GO注释的信息,例如interproscan、eggnog-mapper和blas2go等。
这里主要介绍得到基因对应GO结果后,在R中进行富集分析及可视化过程。
准备文件
1.待富集基因列表
2.背景基因与对应的GO号列表(go2gene)

3.所有GO号所对应的term及description(go2name)

使用
#从GO.db导出所有GO注释信息备用
library(GO.db)
godb <- select(GO.db, keys(GO.db), columns(GO.db))
write.csv(godb, "go2name.csv",row.names=F)
library("clusterProfiler")
# 导入基因列表
gene <- read.csv("geneslist.csv",header=T)
head(gene)
gene <- as.factor(gene$GeneID)
# 导入注释文件
term2gene <- read.csv("go2gene.csv",header=F,sep=",")
term2name <- read.csv("go2name.csv",header = F,sep=",")
# 富集分析
x <- enricher(gene,TERM2GENE=term2gene,TERM2NAME=term2name,pvalueCutoff = 0.05, pAdjustMethod = "BH", qvalueCutoff = 0.05)
# 输出结果
write.csv(x,"GO_enrichment_result.csv",row.names=F)
# 绘制条形图
barplot(x)
# 绘制气泡图
dotplot(x)


网友评论