Retrieve all compound ID, Description from a ko ID
2
0
Entering edit mode
6.0 years ago
jkim ▴ 190

Hello,

I am trying to get, reaction IDs, descriptions, compound IDs and their descriptions from ko IDs (e.g. K00163). I went through Biostars and KEGG rest APIs, but I can't find an answer.

For example, I have a K00163. My goal is ko:K00507 has R02222 (Reaction ID, description) has C00001(compound),C00007 (IDs, Definitions)
ko:K00507 has R12173 (Reaction ID, description) has C00999,C21072...(IDs, Definitions)

The kegg rest api doesn't have the chemical reaction info. I tried some other ways but can't find ways.

The url has some patterns.
https://www.genome.jp/dbget-bin/get_linkdb?-t+7+ko:K00163
https://www.genome.jp/dbget-bin/get_linkdb?-t+compound+rn:R02222

Maybe I could use some html parser and html libraries (like request) so request a ko ID html and parse it and then get reaction IDs html and parse it over and over again, but it doesn't seem a nice way.

Is there a nice way of doing it?
Thank you in advance.

KEGG REST API • 2.7k views
ADD COMMENT
1
Entering edit mode
5.5 years ago
AK ★ 2.2k

Hi jkkim,

You can use KEGGREST package in R:

library(KEGGREST)

ko <- "K00163"

reactions <- keggLink("reaction", ko)
compounds <- keggLink("compound", reactions)

df <-
  data.frame(
    ko = rep(ko, length(compounds)),
    rn = names(compounds),
    rn_desc = keggList(names(compounds)),
    cpd = compounds,
    cpd_desc = keggList(compounds)
  )

You'll get a dataframe like this: keggrest

Hope it helps.

ADD COMMENT
0
Entering edit mode
6.0 years ago
Sej Modha 5.3k

It is possible to download KEGG KO records in the flat file format using KEGG API and then parse the text file for any data.

For example, http://rest.kegg.jp/get/ko:K00507 and http://rest.kegg.jp/get/ko:K00163

ADD COMMENT
0
Entering edit mode

Thank you. I tried that way before, but it doesn't have the chemical reaction information.

ADD REPLY
0
Entering edit mode

Please do not delete the post after members of the community have provided feedback on your post.

ADD REPLY
0
Entering edit mode

I am sorry. For some reason, I removed the post. Sorry again.

ADD REPLY

Login before adding your answer.

Traffic: 2857 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6