[Biopython-dev] [Bug 2883] Errors after unpickling of 1.49 seqrecords

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Jul 22 17:28:39 UTC 2009


biopython-bugzilla at maubp.freeserve.co.uk changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

------- Comment #4 from biopython-bugzilla at maubp.freeserve.co.uk  2009-07-22 13:28 EST -------
(In reply to comment #3)
> > As you may be aware, per-letter-annotation support was added in Biopython
> > 1.50 which is stored internally by a private property of the SeqRecord,
> > _per_letter_annotations. The seq property is also now stored internally
> > by a private property of the SeqRecord, _seq. This means if you unpickle
> > a pre-Biopython 1.50 SeqRecord on Biopython 1.50 or later, the
> > _per_letter_annotations and _seq properties never gets initialised. This
> > causes the two errors you saw.
> This is the problem. i've many example of seqrecord dump (that i use as a
> test) that due to the seqrecord modifications i cannot use anymore.
>  - I've to convert in the new type.
>  - or i've to design fully new tests that permit me to 
>    manage changing in the SeqRecord structure.

You can probably hack the missing per letter annotation with something
like record._per_letter_annotations = {}, but it looks like there is no
obvious way to get at the sequence information in the unpicked record.

Would you like to discuss your storage strategy on the mailing list?
I'm curious what you are doing that made you choose to use pickle like
this (instead of saving to a standard sequence file format, or BioSQL).

> > I don't think there is much we can do about this... not without
> > making the SeqRecord even more complicated, e.g.
> > http://code.activestate.com/recipes/521901/
> I understand. I thought SeqRecod was structurally stable.
> But it isn't. In this sense i can only pickle strings, lists and
> dictionaries... so i will redraw my tests to manage only SeqRecord
> stored data (representing it as a dictionary of dictionaries it would
> be a good solution).

Pickling complex objects is usually fine, unless the class changes -
like the SeqRecord did (and it may do in future, or more likely the
SeqFeature object may). 

> > P.S. Bug 2838 was a problem in the DBSeqRecord (used for BioSQL), and
> > shouldn't be relevant to the underlying SeqRecord object, or this issue.
> yes, but in the last part of the bug there was a similar error
> AttributeError: 'DBSeqRecord' object has no attribute
> _per_letter_annotations' and i thought it was due to the fact that
> DBSeqRecord didn't have that attribute and it was out of sync with
> respect to the new 1.50 seqrecord...

Yes, part of Bug 2838 was that the DBSeqRecord got out of sync with the

> PS: i think you could close the bug.

OK - marking as "won't fix".

Sorry about this,


Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the Biopython-dev mailing list