美文网首页生信
使用kegg的restAPI对kegg数据库进行探索

使用kegg的restAPI对kegg数据库进行探索

作者: 一只烟酒僧 | 来源:发表于2020-07-14 16:37 被阅读0次

参考教程:
https://www.jianshu.com/p/9aef626abf94
https://bioconductor.org/packages/release/bioc/vignettes/KEGGREST/inst/doc/KEGGREST-vignette.html
目的:想找到kegg数据库中不同通路中的代谢物的list


######################################################## 
#-------------------------------------------------------
# Topic:使用keggREST探索kegg数据库
# Author:Wang Haiquan
# Date:Tue Jul 14 16:28:53 2020
# Mail:mg1835020@smail.nju.edu.cn
#-------------------------------------------------------
########################################################

library(KEGGREST)
listDatabases()

#基本思路:1、使用kegglist找到代谢物id与代谢物名字的匹配关系
          #2、使用kegglist找到pathway_id与其名字的匹配关系
          #3、找到pathway与代谢物id之间的关系
          #4、merge进行匹配

compound<-keggList("compound")
compound[1]
compound<-data.frame(id=names(compound),compound=compound)

pathway<-keggList("pathway")
pathway[1]
pathway<-data.frame(id=names(pathway),pathway=pathway)

pathway_compound_link<-keggLink("pathway","compound")
pathway_compound_link[1]
pathway_compound_link<-data.frame(compound_id=names(pathway_compound_link),
                                  pathway_id=pathway_compound_link)
head(pathway_compound_link)

pathway_compound_link_pathway<-merge(pathway_compound_link,pathway,by.x="pathway_id",by.y="id",all.x=T)
pathway_compound_link_pathway_compound<-merge(pathway_compound_link_pathway,compound,by.x="compound_id",by.y="id",all.x=T)

相关文章

网友评论

    本文标题:使用kegg的restAPI对kegg数据库进行探索

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