美文网首页
基因功能注释

基因功能注释

作者: 医学小白学生信 | 来源:发表于2021-01-26 21:38 被阅读0次

ENTREZID SYMBOL ENSEMBLE 的相互转换

suppressMessages(library(org.Hs.eg.db))# 载入包
keytypes(org.Hs.eg.db) #查看支持对选项
rt=read.table("gene.txt",sep="\t",check.names=F,header=T)
rt<-as.data.frame(rt[,1])
class(rt)

#keys是自己的基因,columns是输出的类型,keytype是输入的类型
gene_list<-select(org.Hs.eg.db, keys=as.character(rt$`rt[, 1]`), columns=c("SYMBOL","ENTREZID"), keytype="ENSEMBL")
gene_list[1:4,1:3]
write.table(gene_list,file="a.txt",sep="\t",quote=F,row.names=F)

1 ID的转换

library("org.Hs.eg.db")
rt=read.table("symbol.txt",sep="\t",check.names=F,header=T)
genes=as.vector(rt[,1])
entrezIDs <- mget(genes, org.Hs.egSYMBOL2EG, ifnotfound=NA)
entrezIDs <- as.character(entrezIDs)
out=cbind(rt,entrezID=entrezIDs)
dim(out)
out<-out[(out$entrezID!='NA'),] #删除NA值
dim(out)

write.table(out,file="id.txt",sep="\t",quote=F,row.names=F)

2 GO分析

library("clusterProfiler")
library("org.Hs.eg.db")
library("enrichplot")
library("ggplot2")
rt=read.table("id.txt",sep="\t",header=T,check.names=F)
rt=rt[is.na(rt[,"entrezID"])==F,]

gene=rt$entrezID

#GO富集分析
kk <- enrichGO(gene = gene,
               OrgDb = org.Hs.eg.db, 
               pvalueCutoff =0.05, 
               qvalueCutoff = 0.05,
               ont="all",
               readable =T)
write.table(kk,file="GO.txt",sep="\t",quote=F,row.names = F)

#柱状图
tiff(file="barplot.tiff",width = 26,height = 20,units ="cm",compression="lzw",bg="white",res=600)
barplot(kk, drop = TRUE, showCategory =10,split="ONTOLOGY") + facet_grid(ONTOLOGY~., scale='free')
dev.off()

#气泡图
tiff(file="dotplot.tiff",width = 26,height = 20,units ="cm",compression="lzw",bg="white",res=600)
dotplot(kk,showCategory = 10,split="ONTOLOGY") + facet_grid(ONTOLOGY~., scale='free')
dev.off()

#热图
tiff(file="heatplot.tiff",width = 40,height = 20,units ="cm",compression="lzw",bg="white",res=600)
heatplot(kk,showCategory =20, foldChange=cor)
dev.off()

3 KEGG分析

library("clusterProfiler")
library("org.Hs.eg.db")
library("enrichplot")
library("ggplot2")

rt=read.table("id.txt",sep="\t",header=T,check.names=F)
rt=rt[is.na(rt[,"entrezID"])==F,]

gene=rt$entrezID


#kegg富集分析
kk <- enrichKEGG(gene = gene, organism = "hsa", pvalueCutoff =0.05, qvalueCutoff =0.05)
write.table(kk,file="KEGG.txt",sep="\t",quote=F,row.names = F)

#柱状图
tiff(file="barplot.tiff",width = 20,height = 12,units ="cm",compression="lzw",bg="white",res=600)
barplot(kk, drop = TRUE, showCategory = 20)
dev.off()

#气泡图
tiff(file="dotplot.tiff",width = 20,height = 12,units ="cm",compression="lzw",bg="white",res=600)
dotplot(kk, showCategory = 20)
dev.off()

#热图
tiff(file="heatplot.tiff",width = 25,height = 15,units ="cm",compression="lzw",bg="white",res=600)
heatplot(kk,showCategory =20, foldChange=cor)
dev.off()


#通路图
library("pathview")
keggxls=read.table("KEGG.txt",sep="\t",header=T)
for(i in keggxls$ID){
  pv.out <- pathview(gene.data = cor, pathway.id = i, species = "hsa", out.suffix = "pathview")
}

相关文章

  • 基因功能注释

    基因功能的注释依赖于上一步的基因结构预测,根据预测结果从基因组上提取翻译后的 蛋白序列 和主流的数据库进行比对,完...

  • 基因功能注释

    基因功能注释软件 InterproScan InterProScan 是 EBI 开发的一个集成了蛋白质结构域和功...

  • 基因功能注释

    ENTREZID SYMBOL ENSEMBLE 的相互转换 1 ID的转换 2 GO分析 3 KEGG分析

  • 基因功能注释

    根据已有的蛋白库,对从基因组上提取到的蛋白序列进行比对,从而获得相应的信息。 常用的数据库: Nr:NCBI官方非...

  • 基因功能注释

    1.InterPro注释 InterPro数据库简介 Interpro是EBI开发的一个整合的蛋白家族功能注释数据...

  • 对任何物种所有基因进行功能注释

    所有基因功能注释汇总表 1.注释结果统计 2.所有基因的注释信息 3.每个基因注释到 GO 数据库上的编号 4.对...

  • 基因功能注释方法

    基因组注释(Genome annotation) 是利用生物信息学方法和工具,对基因组所有基因的生物学功能进行高通...

  • GO注释结果整理

    对于非模式生物或者无参考基因组的项目,经常需要进行基因的功能注释,而GO注释是基因功能注释的重要部分。有很多软件能...

  • 非模式物种的GO富集分析

    对于非模式生物或者无参考基因组的项目,经常需要进行基因的功能注释,而GO注释是基因功能注释的重要部分。有很多软件能...

  • 使用TBtools提取基因组CDS并转换成蛋白文件

    基因功能注释需要蛋白文件,有时候注释或下载的基因组没有蛋白文件,需提取并转换,据师兄师弟说gffread提取结...

网友评论

      本文标题:基因功能注释

      本文链接:https://www.haomeiwen.com/subject/talwqktx.html