I'm having some trouble with the re.finditer() method in python. For example:
>>>sequence = 'atgaggagccccaagcttactcgatttaacgcccgcagcctcgccaaaccaccaaacacacca'
>>>[[m.start(),m.end()] for m in re.finditer(r'(?=gatttaacg)',sequence)]
out: [[22,22]]
As you can see, the start()
and end()
methods are giving the same value. I've noticed this before and just ended up using m.start()+len(query_sequence)
, instead of m.end()
, but I am very confused why this is happening.