[Biopython-dev] DeprecationWorning SProt.py

Peter biopython at maubp.freeserve.co.uk
Mon Feb 23 13:16:56 UTC 2009


On Mon, Feb 23, 2009 at 12:22 PM, Andrea <andrea at biodec.com> wrote:
> Goodmorning,
> my name is Andrea Zauli.
> using the last version of biopyhthon (1.49) i received this
> DeprecationWarning:
> /usr/lib/python2.5/site-packages/biopython-1.49-py2.5-linux-x86_64.egg/Bio/SwissProt/SProt.py:147:
> DeprecationWarning:
> Bio.SwissProt.SProt.Iterator is deprecated.
> Please use the function Bio.SwissProt.parse instead if you want to get a
> SwissProt.SProt.Record, or Bio.SeqIO.parse if you want to get a SeqRecord.
> If these solutions do not work for you, please get in contact with the Biopython
> developers (biopython-dev at biopython.org). DeprecationWarning)
> But i still need to use it.
>
> I'm going to explain my problem.
> I noticed that the seq record parser SProt.SequenceParser (or the newest
> Bio.SeqIO.parse) aren't able to parse uniprot Feature (and generate
> SeqFeature Objects). I noticed also that SProt.RecordParser is able to
> parse uniprot Feature (and it generates a list of tuple for the parsed features).

The real solution is for us to finish fixing Bug 2235 so that the
parsing SwissProt files as SeqRecord objects includes SeqFeature
objects.  I need to update the patch on that bug to record the
SeqFeature object's qualifiers more like the GenBank parser.  I don't
personally use SwissProt files much, so If you are willing to help
test these changes, I'd be a lot happier about committing this.
http://bugzilla.open-bio.org/show_bug.cgi?id=2235

> So to generate a "featured SeqRecord" i need to parse
> each uniprot "record" with both (SProt.SequenceParser, SProt.RecordParser)
> and than transform easily each Feature tuple into a SeqFeature instance .

That sounds ugly, but I guess it worked.

> If this method is deprecated, i'd be forced to use Bio.SeqIO.parse and
> Bio.SwissProt.parse, but each have to act on their own handle (so i've to
> open 2 file handles)..... and i'm not sure  (ok i would be reasonably sure)
> that i'm working exactly on the same "record" every each "".next()"" .

You should be able to use two separate handles for the two parsers,
and they should iterate over the records correctly.  Perhaps add an
assert using the record identifier to make sure the records really are
in sync.

Peter



More information about the Biopython-dev mailing list