[Biopython] Sequence object "find" is still case specific?

Michiel de Hoon mjldehoon at yahoo.com
Mon Mar 4 02:55:46 UTC 2013


--- On Sun, 3/3/13, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> We're going off topic here, but for the record I think
> that 'find' should continue to be case sensitive (like
> Python strings).

I would prefer find to be case-insensitive. Biochemically there is no difference between upper case and lower case nucleotides; lower case is just used for annotation purposes. I find it quite counter-intuitive that 
>>> s = Seq("ACGTttt")
>>> s.find("ACGTT")
returns -1.

While it is possible to change the sequences to upper case before executing .find, it has the disadvantage that then we won't be able to tell what the original case was (and therefore whether we are hitting a repeat region or not).

Best,
-Michiel.



More information about the Biopython mailing list