Commit patch to not break on spaces.
[bowtie.git] / ref_aligner.cpp
1 /*
2  * ref_aligner.cpp
3  */
4
5 /**
6  * Maps an octet representing the XOR of two two-bit-per-base-encoded
7  * DNA sequences to the number of bases that mismatch between the two.
8  *
9  * Generated with this perl:
10  *
11  * print "const unsigned char u8toMms[] = {\n";
12  * for(my $i = 0; $i < 256; $i++) {
13  *      if(($i & 7) == 0) {
14  *              print "\t";
15  *      }
16  *      my $c = $i;
17  *      my $mms = 0;
18  *      for(my $j = 0; $j < 4; $j++) {
19  *              if(($c & 3) != 0) {
20  *                      $mms++;
21  *              }
22  *              $c >>= 2;
23  *      }
24  *      print "$mms, ";
25  *      if(($i & 7) == 7) {
26  *              print "\n";
27  *      }
28  * }
29  * print "};\n";
30  *
31  */
32 unsigned char u8toMms[] = {
33         0, 1, 1, 1, 1, 2, 2, 2,
34         1, 2, 2, 2, 1, 2, 2, 2,
35         1, 2, 2, 2, 2, 3, 3, 3,
36         2, 3, 3, 3, 2, 3, 3, 3,
37         1, 2, 2, 2, 2, 3, 3, 3,
38         2, 3, 3, 3, 2, 3, 3, 3,
39         1, 2, 2, 2, 2, 3, 3, 3,
40         2, 3, 3, 3, 2, 3, 3, 3,
41         1, 2, 2, 2, 2, 3, 3, 3,
42         2, 3, 3, 3, 2, 3, 3, 3,
43         2, 3, 3, 3, 3, 4, 4, 4,
44         3, 4, 4, 4, 3, 4, 4, 4,
45         2, 3, 3, 3, 3, 4, 4, 4,
46         3, 4, 4, 4, 3, 4, 4, 4,
47         2, 3, 3, 3, 3, 4, 4, 4,
48         3, 4, 4, 4, 3, 4, 4, 4,
49         1, 2, 2, 2, 2, 3, 3, 3,
50         2, 3, 3, 3, 2, 3, 3, 3,
51         2, 3, 3, 3, 3, 4, 4, 4,
52         3, 4, 4, 4, 3, 4, 4, 4,
53         2, 3, 3, 3, 3, 4, 4, 4,
54         3, 4, 4, 4, 3, 4, 4, 4,
55         2, 3, 3, 3, 3, 4, 4, 4,
56         3, 4, 4, 4, 3, 4, 4, 4,
57         1, 2, 2, 2, 2, 3, 3, 3,
58         2, 3, 3, 3, 2, 3, 3, 3,
59         2, 3, 3, 3, 3, 4, 4, 4,
60         3, 4, 4, 4, 3, 4, 4, 4,
61         2, 3, 3, 3, 3, 4, 4, 4,
62         3, 4, 4, 4, 3, 4, 4, 4,
63         2, 3, 3, 3, 3, 4, 4, 4,
64         3, 4, 4, 4, 3, 4, 4, 4,
65 };