[BioPython] Adding startswith and endswith methods to the Seq object

Martin MOKREJŠ mmokrejs at ribosome.natur.cuni.cz
Mon Apr 13 14:44:14 UTC 2009


Hi Peter,

Peter wrote:
> Hi all,
> 
> I've filed enhancement bug 2809 with a patch to add startswith and
> endswith methods to the Seq object,
> http://bugzilla.open-bio.org/show_bug.cgi?id=2809

> 
> e.g. I want to be able to do this:
> 
> primer = "TGACCTGAAAAGAC"
> crop = len(primer)
> #record is a SeqRecord object
> if record.seq.startswith(primer) :
>    record = record[crop:]
> 

> 
> Does this seem like a sensible addition to the Seq object?  It is
> consistent with making the Seq object more like a python string.

Yes, I like this new approach.

Martin



More information about the Biopython mailing list