in reply to Re: How can I count the number of substitutions of one letter in a string by another letter in the other string?
in thread How can I count the number of substitutions of one letter in a string by another letter in the other string?
Whilst orders of magnitude faster, as posted, your solution is missing some possibilities.
Given the input of:
$seq1 = 'AAAACCCCGGGGTTTT'; $seq2 = 'ACGTACGTACGTACGT';
It should produce 12 counts:
{ A2C => 1, A2G => 1, A2T => 1, C2A => 1, C2G => 1, C2T => 1, G2A => 1, G2C => 1, G2T => 1, T2A => 1, T2C => 1, T2G => 1, }
But only produces the following eight:
A2G=1; G2A=1; C2T=1; T2C=1; A2T=1; A2C=1; G2T=1; G2C=1.
I'm sure that this is eminently fixable.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How can I count the number of substitutions of one letter in a string by another letter in the other string?
by Eliya (Vicar) on May 11, 2012 at 23:19 UTC |