I have extracted a particular pattern position say TAT from a particular chromosome via BSgenome in R. Then I mapped my codon file with gtf file to check how many patterns are present in a particular gene. But what I found is, my codon number is crossing the length of gene. I am assuming why this happened is because
Lets assume that the sequence is "ATATATATGCAT" and its taking start and end position like this:
can I avoid this? Here what I want is, if once ant position is read it won't go back to trace the pattern.