Hi John and David,
Thanks so much for your reply. I forgot to mentioned another variances of scoring apart from this two
....... ....... ...... GATTACGAGTGGCGCTCGTGTAACGGCA #Score 21 GATTACG GCGCTCG AACGGCA
CASE B: .. .. #Score 4 GATTACGAGTGGCGCTCGTGTAACGGCA GG GG
They are cases where they overlap:
CASE C:
......... ....... #score 16 GATTACGAGTGGCGCTCGTGTAACGGCA GATTACG TTACGAG CGTGTAA
CASE D:
GCTCGTG #score 17 .................. GATTACGAGTGGCGCTCGTGTAACGGCA TACGAGT GTGGCGC
my @ar2 = ('GATTACG','TTACGAG','CGTGTAA'); #16 my @ar3 = ('TACGAGT','GTGGCGC','GCTCGTG'); #17
And Dave's modification below (that includes $offset) works just fine for it.
__BEGIN__ #!/usr/bin/perl -w
[snip]my %position_score;my $offset = 0;
my $idx = index($str, $frag, $offset) + 1;[snip]
$offset = $idx;
Don't mean to nitpick. Just wondering if it's possible to modify Krahn's snippet to accomodate the overlapping cases?
yet another fans request ;-)
-- Edward WIJAYA Singapore
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>