"Puri" <(E-Mail Removed)> wrote:

....

> $seq1 = "cagtttgtgtaagtgatcacgtnngatttacatatagccatcg";

> $seq2 = "ag";

> $seq2length = length($seq2);

>

> print "$seq1\n\n";

>

> $indexcount = 0;

> #$index[0] = aindex($seq2, ["i 0"], $seq1);

> $initial = 0;

>

> until ($index[$indexcount-1] == -1) {

> $index[$indexcount] = aindex($seq2, ["i 0 initial_position=$initial"],

> $seq1);

> $initial=($index[$indexcount]+$seq2length);

> $indexcount++;

> }

>

> pop @index;

>

> print "@index";

>

> ##End code

>

> This returns the following array @index: 1 10 35
At first I thought it was a counting problem, but now I see that problem is

that 'aa' is matching. If you change the code so that overlapping matches

are allowed, then it returns 1 10 11 35. I don't know why aa matches, and

I don't know enough about String::Approx to know if this is a bug or if it

is correct for some reason I don't understand.

Xho

--

--------------------

http://NewsReader.Com/ --------------------

Usenet Newsgroup Service $9.95/Month 30GB