ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/tophat_cpp/qual.cpp
Revision: 29
Committed: Tue Aug 2 21:24:54 2011 UTC (8 years, 2 months ago) by gpertea
File size: 3363 byte(s)
Log Message:
adding tophat source work

Line File contents
1 /* NOTE: This file was written by Ben Langmead, and is borrowed from Bowtie */
2
3 /// An array that transforms Phred qualities into their maq-like
4 /// equivalents by dividing by ten and rounding to the nearest 10,
5 /// but saturating at 3.
6 unsigned char qualRounds[] = {
7 0, 0, 0, 0, 0, // 0 - 4
8 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, // 5 - 14
9 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, // 15 - 24
10 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 25 - 34
11 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 35 - 44
12 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 45 - 54
13 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 55 - 64
14 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 65 - 74
15 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 75 - 84
16 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 85 - 94
17 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 95 - 104
18 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 105 - 114
19 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 115 - 124
20 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 125 - 134
21 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 135 - 144
22 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 145 - 154
23 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 155 - 164
24 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 165 - 174
25 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 175 - 184
26 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 185 - 194
27 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 195 - 204
28 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 205 - 214
29 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 215 - 224
30 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 225 - 234
31 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 235 - 244
32 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, // 245 - 254
33 30 // 255
34 };
35
36 /**
37 * Lookup table for converting from Solexa-scaled (log-odds) quality
38 * values to Phred-scaled quality values.
39 */
40 unsigned char solToPhred[] = {
41 /* -10 */ 0, 1, 1, 1, 1, 1, 1, 2, 2, 3,
42 /* 0 */ 3, 4, 4, 5, 5, 6, 7, 8, 9, 10,
43 /* 10 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
44 /* 20 */ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
45 /* 30 */ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
46 /* 40 */ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
47 /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
48 /* 60 */ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
49 /* 70 */ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
50 /* 80 */ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
51 /* 90 */ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
52 /* 100 */ 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
53 /* 110 */ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
54 /* 120 */ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
55 /* 130 */ 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
56 /* 140 */ 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
57 /* 150 */ 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
58 /* 160 */ 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
59 /* 170 */ 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
60 /* 180 */ 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
61 /* 190 */ 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
62 /* 200 */ 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
63 /* 210 */ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
64 /* 220 */ 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
65 /* 230 */ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
66 /* 240 */ 240, 241, 242, 243, 244, 245, 246, 247, 248, 249,
67 /* 250 */ 250, 251, 252, 253, 254, 255
68 };