[Biopython-dev] [Bug 2507] Adding __getitem__ to SeqRecord for element access and slicing

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Jun 11 09:04:47 UTC 2008


------- Comment #7 from biopython-bugzilla at maubp.freeserve.co.uk  2008-06-11 05:04 EST -------
I raised the issue of evaluating a SeqRecord as a boolean with a proposal that
would could add __len__ but also add __nonzero__ to ensure that any SeqRecord
evaluates as True (even if the sequence is of length zero):

Michiel was in favour of this:
> +1 for adding a __len__ method, with a __nonzero__ method to let all SeqRecord
> objects evaluate as true.

The patch isn't ready yet because in addition it doesn't get deal with the
SeqFeature objects.  I think the SeqFeature class needs a _shift(offset) method
to return a copy of itself with its location (and the locations of any
sub-features) adjusted.

I'm still not sure about handling strides, and I am tempted to rule that if a
stride other than one is used then the features of the SeqRecord are lost.

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