[Bioperl-l] Help with String::Approx

Waibhav Tembe tembe at bioanalysis.org
Mon Mar 14 12:19:59 EST 2005


Thanks for the advice to use String::Approx.

I installed String::Approx and it seems to be functional. Just as a 
check, I am trying to run different utilities such as adist, aindex etc. 
by following the examples on CPAN's string::approx page and can't seem 
to run aslice utility. For the following code, adist and aindex seem to 
work fine. But aslice outputs something unexpected.

$F = "xxxx";
$S = "zzzxxyxyyy";
print "Edit = ", adist($F, $S), "\n";
$index = aindex($F, $S);
print "Matches at ", $index, "\n";
($index, $size) = aslice($F, $S);
print "Matches at ", $index, "\tSize is ", $size, "\n";
($index, $size, $d) = aslice($F, $S);
print "Matches at ", $index, "\tSize is ", $size, "Distance is ", $d, "\n";

Edit = 1
Matches at 3
Matches at ARRAY(0x9cc9d98)     Size is
Matches at ARRAY(0x9ddfbc0)     Size is Distance is

Any help to fix this and to use Approx utility for:
1. Extracting the approximate match from $S
2. At least finding the length of the match and correct index in $S

will be appreciated.



Andrew Walsh wrote:

> Hello,
> The following cpan module may be of interest:
> String::Approx
> Cheers,
> Andrew
> Waibhav Tembe wrote:
>> Hello,
>> I was wondering if there is any Perl implementation for 
>> "k-differences" string matching algorithm using dynamic programming. 
>> More precisely, given two string s1 and s2, the program finds an 
>> alignment, if one exists, that has less than or equal to k (a 
>> parameter) no. of differences. The differences include mismatches and 
>> indels.
>> Any pointers will be welcome.
>> Thanks.
>> Tembe
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at portal.open-bio.org
>> http://portal.open-bio.org/mailman/listinfo/bioperl-l

More information about the Bioperl-l mailing list