|laziness, impatience, and hubris|
Mismatch Positions of Ambiguous Stringby monkfan (Curate)
|on Jan 25, 2006 at 09:32 UTC||Need Help??|
monkfan has asked for the wisdom of the Perl Monks concerning the following question:
I have two strings that I want to compute the number of mismatches between them. These two strings are of the "same" size. Let's call them 'source' string and 'target' string. Now, the problem is that the 'source' string may come in ambiguous form, meaning that in one position they may contain more than 1 (upto 4) characters. The ambiguous position is marked with square bracketed [ATCG] region.
Is there an efficient way I can compute the number of mismatch between "source" and "target", of the above situation? The example is as follows:
Example 1 (where the source is ambiguous):
I have no problem when dealing when 'source' string is not ambigous like this
Example 2 (where the source is NOT ambiguous):
For example I can use bitwise operator to do it. But for ambigous case I'm lost.
PS: "target" string can be assumed to be never ambiguous.