moin zev,

never used PDL::Char, but maybe PDL::EditDistance (on CPAN) might do what you 
want. If you just want to compare symbols pairs by absolute index position(i.e. 
inverse hamming distance), you might be better off just mapping your alphabet 
and plain pdl code:

 sub pstr { pdl [map {ord $_} @_]; }
 $a = pstr qw(a t c ^ c);
 $b = pstr qw(^ t c a c);
 $dist = sumover($a==$b)

PDL::EditDistance has the advantage that its arguments don't need to be of 
equal length.

marmosets,
 bryan

-- 
typed with my opposable thumbs!

----- Original message -----
> Greetings,
> 
> I am thinking about using PDL to compare strings (DNA) and count the
> shared positions.
> 
> for example:
> 
> a   = [a, t, c, ^, c]
> b   = [^, t, c, a, c]
> 
> The intersection of A and B would be 3 since they have the same value in
> columns 2, 3, 5.
> 
> I have started to look into PDL::Char, but don't know if what I am trying
> to do is easily achievable using PDL?
> I though I would ask before sinking a bunch of time into this.
> 
> Thanks!
> 
> 
> 
> -- 
> Zev Kronenberg
> Graduate Student
> University of Utah
> phone: 208-629-6224


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to