[BioPython] The count method of a Seq (or MutableSeq) object

Peter biopython at maubp.freeserve.co.uk
Fri Mar 6 12:07:57 UTC 2009


On Fri, Mar 6, 2009 at 11:52 AM, Michiel de Hoon <mjldehoon at yahoo.com> wrote:
>> > Another option is to continue to use count() for a Python-style count,
>> > and to add a new method that does a overlapping-type count. For this
>> > new method we'd need a clear but short name, and I can't think of
>> > anything now.
>>
>> Did you like plan (c), which preserves the Python string style count
>> as the default but offers the non-overlapping count via an optional
>> argument?
>
> It's also OK, but if we use a different method name we can leave count() untouched altogether.

Looking back, Sebastian Bassi raised this issue back in 2003 on this
mailing list, and his overlap-aware-count implementation is used
internally by Bio.SeqUtils.MeltingTemp, see:
http://lists.open-bio.org/pipermail/biopython/2003-November/001741.html
http://lists.open-bio.org/pipermail/biopython/2003-November/001742.html
etc

Sebastian also posted an enhancement request for adding an overlap
aware counting method to the python base string, with "overcount" as a
possible name.   I don't know what happened to his bug report, it
seems to have been marked private:
http://mail.python.org/pipermail/python-bugs-list/2003-November/021239.html

I don't really like the name "overcount", but as another suggestion
how about "count_ol" which is short for count-with-overlaps?

Peter



More information about the Biopython mailing list