Biopython's .count()
methods, like Python's str.count()
, perform a non-overlapping count, how can I do an overlapping one?
For example, these code snippets return 2
, but I want the answer 3
:
>>> from Bio.Seq import Seq
>>> Seq('AAAA').count('AA')
2
>>> 'AAAA'.count('AA')
2