[Biopython-dev] Quality scores (and per-letter-annotation) in a SeqRecord?
lpritc at scri.ac.uk
Tue Feb 24 13:04:09 UTC 2009
On 24/02/2009 12:46, "Peter" <biopython at maubp.freeserve.co.uk> wrote:
> On Tue, Feb 24, 2009 at 10:24 AM, Jose Blanca <jblanca at btc.upv.es> wrote:
>> An alternternative implementation using weakref to link the RestrictedDict
>> with the SeqRecord.
> Your code seems a little more complicated, but should work too. It
> would mean that if the parent SeqRecord's seq property was altered,
> the per-letter-annotation dictionary would know the new length. This
> is better - but if someone did change the parent SeqRecord's seq, then
> perhaps we should also automatically clear the per-letter-annotation?
> We could do this by using a full property for the seq attribute, which
> would also us to clear any existing per-letter-annotation by replacing
> it with a new restricted dictionary using the new length.
I can think of two particular incompatible situations here:
1) I change the parent SeqRecord sequence, by slicing it to a region I'm
interested in. I want to keep the per-symbol-annotation, but adjusted to
the new sequence.
2) I change the parent SeqRecord sequence by adding some more symbols to it.
I've just destroyed the association between the per-symbol-annotation and my
sequence without even realising it. I'd prefer a warning that this is going
to happen before it destroys my earlier work, so I can make the change in a
duplicate SeqRecord object.
I think it's worth considering which behaviours we would find desirable, and
how to handle others. We'll all have different use cases, I imagine...
Dr Leighton Pritchard MRSC
D131, Plant Pathology Programme, SCRI
Errol Road, Invergowrie, Perth and Kinross, Scotland, DD2 5DA
e:lpritc at scri.ac.uk w:http://www.scri.ac.uk/staff/leightonpritchard
gpg/pgp: 0xFEFC205C tel:+44(0)1382 562731 x2405
SCRI, Invergowrie, Dundee, DD2 5DA.
The Scottish Crop Research Institute is a charitable company limited by
Registered in Scotland No: SC 29367.
Recognised by the Inland Revenue as a Scottish Charity No: SC 006662.
This email is from the Scottish Crop Research Institute, but the views
expressed by the sender are not necessarily the views of SCRI and its
subsidiaries. This email and any files transmitted with it are
to the intended recipient at the e-mail address to which it has been
addressed. It may not be disclosed or used by any other than that
If you are not the intended recipient you are requested to preserve this
confidentiality and you must not use, disclose, copy, print or rely on
e-mail in any way. Please notify postmaster at scri.ac.uk quoting the
name of the sender and delete the email from your system.
Although SCRI has taken reasonable precautions to ensure no viruses are
present in this email, neither the Institute nor the sender accepts any
responsibility for any viruses, and it is your responsibility to scan
the email and the attachments (if any).
More information about the Biopython-dev