This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract KEGG Enzyme data

Hi Guyz Can someone tell me how to extract a enzyme file which looks like this (having thousands of entries)

ENTRY       EC 1.1.1.1                  Enzyme
NAME        alcohol dehydrogenase;
CLASS       Oxidoreductases;
ENTRY       EC 1.1.1.157                Enzyme
NAME        3-hydroxybutyryl-CoA dehydrogenase;
CLASS       Oxidoreductases;

and so on ..... I want a file like

Entry                         name                                                                                classs
EC1.1.1.1                  alcohol dehydrogenase                                                    Oxidoreductases;
Ec 1.1.1.157              3-hydroxybutyryl-CoA dehydrogenase;                           Oxidoreductases;

please do the needful...

genome
 import sys
 f=open(sys.argv[1])
 arr=[]
 for i in f:
     j = i.strip("\n").split('\t')[1]
     arr.append(j)
 print [arr[i:i + 3] for i in xrange(0, len(arr), 3)]

This should work for you, assuming that you files is tab seperated file.

0 answers

No answers yet.

Log in to answer this question.