[Biopython-dev] Fwd: Re: sequence class proposal

Peter biopython at maubp.freeserve.co.uk
Mon Jun 2 19:51:30 UTC 2008


Jose wrote:
> > I've filed Bug 2507 to try and show what I had in mind for the
> > __getitem__ method.
> > http://bugzilla.open-bio.org/show_bug.cgi?id=2507
>
> I think that would be great.

Good :)

Does anyone else want to comment?

>  I've just added to the bug a question about the .seq property of SeqRecord.

http://bugzilla.open-bio.org/show_bug.cgi?id=2507#c2 reads:
> Does this means that SeqRecord would deprecate the .seq attribute?
> If the .seq attribute is not removed slicing could be used in it like:
> my_seq[1:100] and my_seq.seq[1:100].

I was not intending to deprecate the SeqRecord's .seq property at this
time (I think that should happen in preparation for if/when the
SeqRecord becomes a subclass of the Seq object).

With my idea described on bug 2507, given a SeqRecord object my_seq_record:

my_seq_record[1:100] -> another SeqRecord (with annotation)
my_seq_record.seq[1:100] -> just a Seq object (no annotation)
my_seq_record.seq.tostring()[1:100] -> just a string (no annotation or alphabet)
str(my_seq_record.seq)[1:100] -> just a string (no annotation or alphabet)

These trivial examples would all "contain" the same sequence string.
This enhancement could be done right now, and shouldn't impeed any
future per-letter-annotation enhancements.

Perhaps per-letter-annotation enhancements could be added to the
SeqRecord class directly... I need to fully digest the discussion on
the BioSQL list, see:
http://lists.open-bio.org/pipermail/biosql-l/2008-May/thread.html

Peter



More information about the Biopython-dev mailing list