How To Batch Grab All Ko (Kegg Ontology) Terms Associated With Each Kegg Pathway?
4
8
Entering edit mode
11.3 years ago
JacobS ▴ 990

Hello,

I often use KEGG and enjoy their annotated pathways, of which there seem to be several hundred, or perhaps several thousand. For each pathway, I can follow it's hyperlink and arrive at a list of all of the KO terms associated with the pathway.

I have a bunch of KO annotated data, and I would like to study pathway enrichment by looking at the frequency these terms appear in each of the pathways, and compare these values between treatments. So, is there any convenient resource from KEGG for grabbing all of these KO terms per pathway, without actually clicking on every pathway??

Thanks!

kegg pathway • 19k views
ADD COMMENT
9
Entering edit mode
11.3 years ago
JacobS ▴ 990

Found it! Go to http://www.genome.jp/kegg-bin/get_htext?ko00001.keg and use the "download htext" link for a complete listing of all pathways/KO numbers!

ADD COMMENT
6
Entering edit mode
8.8 years ago
5heikki 11k

There's an API, why not use it?

#!/bin/bash
echo "Downloading pathway list"
(curl -# http://rest.kegg.jp/list/pathway > ./pathway.list)
if [ $? -eq 0 ]; then
    for next in $(cut -f1 pathway.list); do
    (curl -# http://rest.kegg.jp/link/ko/$next > ./$next.ko)
    if [ $? -eq 0 ]; then
        echo "Retrieved $next ko map"   
    else
        echo "There was a problem in data retrieval"
        exit 1
    fi
    done
    exit 0
else 
    echo "There was a problem in data retrieval"
    exit 1
fi
ADD COMMENT
0
Entering edit mode

I ran the API and worked out pretty well. I did not check yet if I have some K number without a path assigned but apparently this is what I was looking for a while! Thank you very much 5heikki

ADD REPLY
0
Entering edit mode

Sorry, I am not familiar with UNIX. How to run this API in windows?

ADD REPLY
1
Entering edit mode
8.3 years ago
Dchoy ▴ 40

The KEGG API page has a few ways to extract most formats of KEGG annotations. In your case, grabbing all the KO entries in a pathway would look like this:

/link/ko/map00010 or /link/ko/ko00010 will give you a list of all KO entries in pathway map00010 or ko00010

For r users, Dan Tenenbaum has a great r package for such a purpose. The method "keggLink" should be suitable for your purpose.

keggLink("ko","ko00010")

KEGG API link: http://www.genome.jp/kegg/rest/keggapi.html KEGGREST r package: https://www.bioconductor.org/packages/devel/bioc/manuals/KEGGREST/man/KEGGREST.pdf

ADD COMMENT
0
Entering edit mode
8.8 years ago
panconchoclo ▴ 10

In my case using the ko00001.keg file does not solve the problem at all because I have some "K numbers" which does not exist in this file.

Any idea where a suitable file with all the mappings is available?

Thanks!

ADD COMMENT
1
Entering edit mode

What about KEGG.db in R bioconductor?

Be aware though that: "KEGG.db contains mappings based on older data because the original resource was removed from the the public domain before the most recent update was produced"

ADD REPLY
0
Entering edit mode

I ll try use KEGG.db. Thanks!

ADD REPLY
0
Entering edit mode

I could not find many K numbers months before but I could find at least some of them later. There are updates in the .keg file frequently.

If the KEGG itself is not providing the updated K numbers to public, I don't think you will find anything elsewhere.

ADD REPLY
0
Entering edit mode

I see. Thanks a lot b.nota and Vari for your comments.

ADD REPLY

Login before adding your answer.

Traffic: 2368 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