[Biopython-dev] Quality scores (and per-letter-annotation) in a SeqRecord?

Peter biopython at maubp.freeserve.co.uk
Fri Feb 27 12:12:11 UTC 2009


> p.s. on your patch
> (http://bugzilla.open-bio.org/attachment.cgi?id=1249), on the third
> change, you modify this in SeqRecord.__init__:
>
> 95c120
> <         self.seq = seq
> ---
>>         self._seq = seq
>
> can it be an error? Why self.seq has been moved to self._seq?

It is deliberate.  Before the patch, the SeqRecord's .seq was a
"naked" attribute.  After the patch, the actual sequence hidden in the
private attribute ._seq and is publicly exposed using a property (also
known as a "managed attribute") with a get and set method (and a doc
string).  The reason for doing this is I want to have some code run
when ever anyone tries to set the seq property to a new value (in
order prevent the seq and per-letter-annotation getting out of sync).

Peter




More information about the Biopython-dev mailing list