That's because you didn't mention the "N" in your original post :)

The idea of the transliteration is that the XOR value computed for every (directed) comparison of characters is different. This can only be determined for a predefined set of allowed characters.

To also allow "N", you could (for example) use the transliteration tr/ATCGN/J4XD7/. With this, the XOR values for the respective changes would compute as:

XOR val change \x0b => A->A * ( "A" ^ "J" ) \x19 => A->C ( "A" ^ "X" ) \x05 => A->G ( "A" ^ "D" ) \x76 => A->N ... \x75 => A->T \x09 => C->A \x1b => C->C * \x07 => C->G \x74 => C->N \x77 => C->T \x0d => G->A \x1f => G->C \x03 => G->G * \x70 => G->N \x73 => G->T \x04 => N->A \x16 => N->C \x0a => N->G \x79 => N->N * \x7a => N->T \x1e => T->A \x0c => T->C \x10 => T->G \x63 => T->N \x60 => T->T *

The ones marked with "*" are the "no-changes", which should make up the exclusion character set in the final match. I.e., with the above modified transliteration, you should change that to

while ($diff =~ /([^\x0b\x1b\x03\x79\x60])/g) {

In reply to Re^6: mismatching characters in dna sequence by Eliya
in thread mismatching characters in dna sequence by prbndr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.