quality_coeffs.cpp 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * nvbio
  3. * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the NVIDIA CORPORATION nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  17. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. #include <nvbio/basic/types.h>
  28. namespace nvbio {
  29. namespace bowtie2 {
  30. /// map Phred quality scores into their maq equivalents
  31. ///
  32. unsigned char s_phred_to_maq[] = {
  33. 0, 0, 0, 0, 0,
  34. 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
  35. 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
  36. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  37. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  38. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  39. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  40. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  41. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  42. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  43. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  44. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  45. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  46. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  47. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  48. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  49. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  50. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  51. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  52. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  53. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  54. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  55. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  56. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  57. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  58. 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
  59. 30
  60. };
  61. /// map Solexa quality values to Phred scale
  62. ///
  63. unsigned char s_solexa_to_phred[] = {
  64. 0, 1, 1, 1, 1, 1, 1, 2, 2, 3,
  65. 3, 4, 4, 5, 5, 6, 7, 8, 9, 10,
  66. 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
  67. 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
  68. 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
  69. 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
  70. 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
  71. 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
  72. 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
  73. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
  74. 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
  75. 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
  76. 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
  77. 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
  78. 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
  79. 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
  80. 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
  81. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
  82. 170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
  83. 180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
  84. 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
  85. 200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
  86. 210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
  87. 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
  88. 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
  89. 240, 241, 242, 243, 244, 245, 246, 247, 248, 249,
  90. 250, 251, 252, 253, 254, 255
  91. };
  92. } // namespace bowtie2
  93. } // namespace nvbio