[Biopython-dev] SwissProt parser: Feature ID kept in description string

Peter biopython at maubp.freeserve.co.uk
Mon Sep 13 06:29:32 EDT 2010


Hi Michiel at al,

I'm looking at the SwissProt plain text parser (for Bug 2235, making
SeqFeature objects in SeqIO for "swiss" format), and noticed something
that puzzles me in the new parser in Bio/SwissProt/__init__.py:

The parser spots /FTId= entries and extracts the feature ID, which
is good, but leaves this string in the description string, which I find
odd. Essentially I'd like to change this bit:

    if line[29:35]==r"/FTId=":
        ft_id = line[35:70].rstrip()[:-1]
    else:
        ft_id =""

too:

    if line[29:35]==r"/FTId=":
        ft_id = line[35:70].rstrip()[:-1]
        description = ""
    else:
        ft_id =""

What do you think?

Peter


More information about the Biopython-dev mailing list