Suppose I have a KEGG organism code and wants to check the corresponding NCBI organism Taxonomic ID.
I am able to find this online tool available from KEGG.
Also, http://rest.kegg.jp/list/organism only returns the list of KEGG organisms with taxonomic classification, without NCBI taxid.
But, anyone here aware of any command-line API which can fetch NCBI organism Taxonomic ID based on KEGG organism code?
2 answers
Found a file in KEGG website - https://www.genome.jp/kegg-bin/download_htext?htext=br08610&format=htext&filedir= (I am surprised why this is not available in their standard rest API.)
Anyways, Here is a rough solution around the downloaded file br08610.keg using the above link.
For example, Arabidopsis Thaliana KEGG ID is ath and and NCBI tax ID is 7302
> kegg_id=ath
> grep -B 1 $kegg_id' ' br08610.keg | awk -F"TAX:" '/TAX:/{print $2}' | sed s/]//
7302
Any pure awk one-liner with more efficient extraction is most welcome.
This file though is a little bit strange.
With respect to the NCBI Taxonomy Id, it integrates all the strains at the species level.
For example:
J Plasmodium falciparum [TAX:5833] K pfa Plasmodium falciparum 3D7 K pfd Plasmodium falciparum Dd2 K pfh Plasmodium falciparum HB3
All these 3 KEGG genomes are links to the NCBI Taxonomy Id 5833 (https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=5833)
If you move in the show_organism tab though, you wil see the actual NCBI Taxonomy Id of the strain. For example: pfa Plasmodium falciparum 3D7 - https://www.genome.jp/kegg-bin/show_organism?org=pfa will link to NCBI Taxonomy Id 36329 - https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=36329
Log in to answer this question.