1
$\begingroup$

I have a list of ko IDs from which I want to get the pathway names. How can I get that? I have tried this link, but it does not give me any result. What to do?

  ko00010   ko00030 ko00061 ko00120 ko00121 ko00190 ko00195 ko00230 ko00250 ko00253 ko00270 ko00300 ko00330 ko00400 ko00401 ko00410 ko00430 ko00450 ko00460 ko00471 ko00472 ko00500 ko00511 ko00520 ko00521 ko00523 ko00531 ko00550 ko00562 ko00604 ko00620 ko00625 ko00640

Thanks

$\endgroup$

1 Answer 1

2
$\begingroup$

You can use the KEGG API:

ko_list="ko00010 ko00030 ko00061 ko00120 ko00121
         ko00190 ko00195 ko00230 ko00250 ko00253
         ko00270 ko00300 ko00330 ko00400 ko00401
         ko00410 ko00430 ko00450 ko00460 ko00471
         ko00472 ko00500 ko00511 ko00520 ko00521
         ko00523 ko00531 ko00550 ko00562 ko00604
         ko00620 ko00625 ko00640"

for i in ${ko_list}
do
    hit=$(curl -# http://rest.kegg.jp/list/pathway | grep -w "${i/ko/map}")
    echo -e "${i}\t${hit}" | cut -f1,3 >> ko_pathways.txt
done

Or if your list is too long you can change the input and use a file with a list of ids.

while read line
do
    hit=$(curl -# http://rest.kegg.jp/list/pathway | grep -w "${line/ko/map}")
    echo -e "${line}\t${hit}" | cut -f1,3 >> ko_pathways.txt
done < ko_list.txt

The result will be something like:

 ko00010    Glycolysis / Gluconeogenesis
 ko00030    Pentose phosphate pathway
 ko00061    Fatty acid biosynthesis
 ko00120    Primary bile acid biosynthesis
 ko00121    Secondary bile acid biosynthesis
$\endgroup$
5
  • $\begingroup$ Thanks a lot Zorbax, for your answer. It works. Besides that, is there any web server or something that can be used? Just wanted to know. $\endgroup$
    – deep771992
    Commented Jun 11, 2021 at 15:55
  • $\begingroup$ Hi Zorbax, I have a similar query. Is there a similar way I can use to get KEGG Module names from a list of Module IDs (e.g. M00002)? Many thanks $\endgroup$
    – deep771992
    Commented Jun 14, 2021 at 11:10
  • $\begingroup$ I don't know anything about a web server. And yes, to your second question, I think you can use the API request for the module instead pathway list. $\endgroup$
    – zorbax
    Commented Jun 14, 2021 at 11:18
  • $\begingroup$ This doesn't work anymore $\endgroup$
    – Biomage
    Commented Aug 4, 2022 at 14:32
  • $\begingroup$ Yes, it does. Use https instead http $\endgroup$
    – zorbax
    Commented Aug 4, 2022 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.