[BioPython] KEGG enzyme error

Peter biopython at maubp.freeserve.co.uk
Tue Feb 3 11:35:17 UTC 2009


On Mon, Feb 2, 2009 at 9:33 PM, Ragini Pandey <rapandey at iupui.edu> wrote:
> Hi,
>
> I am trying to parse KEGG enzyme. The parser is failing for    EC 1.1.1.49
> The data line where it is failing is-
> "DRE: 100148915 570579(wu:fj78b06)"
> There are several other data lines in this format.
>
> The error I am getting is:
> line 227, in parse
>    key, values = data.split(":")
> ValueError: too many values to unpack

The problem is the code expects a single ":" character which can be
used to split the string into the key ("DRE") and the data, here
"100148915 570579(wu:fj78b06)" but the extra ":" is causing the split
to give three parts.  Try editing that line to read:
    key, values = data.split(":",1)

> Here is my code:
>
> import urllib
> from Bio.KEGG import Enzyme
> dataFile = open(myFile)
> for record in Enzyme.parse(dataFile):
>    print record.entry
>
> Would appreciate your help on this.

Which file exactly are you using?  The problem data line you gave
doesn't match http://www.expasy.ch/enzyme/1.1.1.49.txt

Peter



More information about the Biopython mailing list