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
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!
4 answers
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!
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
Sorry, I am not familiar with UNIX. How to run this API in windows?
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
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!
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"
I ll try use KEGG.db. Thanks!
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.
I see. Thanks a lot b.nota and Vari for your comments.
Log in to answer this question.