btllib

nthash_consts.hpp
1/*
2 * nthash_consts.hpp
3 * Author: Hamid Mohamadi
4 * Genome Sciences Centre,
5 * British Columbia Cancer Agency
6 */
7
8#ifndef BTLLIB_NTHASH_CONSTS_HPP
9#define BTLLIB_NTHASH_CONSTS_HPP
10
11#include <cmath>
12#include <cstdint>
13
14 namespace btllib {
15
16#define MS_TAB(CHAR, ROT) \
17 (MS_TAB_31L[CHAR][(ROT) < 31 ? (ROT) : (ROT) % 31] | /* NOLINT */ \
18 MS_TAB_33R[CHAR][(ROT) < 33 ? (ROT) : (ROT) % 33]) /* NOLINT */
19
20// offset for the complement base in the random seeds table
21 const uint8_t CP_OFF = 0x07;
22
23// shift for gerenerating multiple hash values
24 const int MULTISHIFT = 27;
25
26// seed for gerenerating multiple hash values
27 static const uint64_t MULTISEED = 0x90b45d39fb6da1fa;
28
29// 64-bit random seeds corresponding to bases and their complements
30 static const uint64_t SEED_A = 0x3c8bfbb395c60474;
31 static const uint64_t SEED_C = 0x3193c18562a02b4c;
32 static const uint64_t SEED_G = 0x20323ed082572324;
33 static const uint64_t SEED_T = 0x295549f54be24456;
34 static const uint64_t SEED_N = 0x0000000000000000;
35
36 static const int ASCII_SIZE = 256;
37
38 extern const uint64_t SEED_TAB[ASCII_SIZE];
39
40 extern const uint64_t A33R[33];
41 extern const uint64_t A31L[31];
42
43 extern const uint64_t C33R[33];
44 extern const uint64_t C31L[31];
45
46 extern const uint64_t G33R[33];
47 extern const uint64_t G31L[31];
48
49 extern const uint64_t T33R[33];
50 extern const uint64_t T31L[31];
51
52 extern const uint64_t N33R[33];
53 extern const uint64_t N31L[31];
54
55 extern const uint64_t* const MS_TAB_33R[ASCII_SIZE];
56 extern const uint64_t* const MS_TAB_31L[ASCII_SIZE];
57
58 extern const uint8_t CONVERT_TAB[ASCII_SIZE];
59 extern const uint8_t RC_CONVERT_TAB[ASCII_SIZE];
60
61 extern const uint64_t DIMER_TAB[4 * 4];
62 extern const uint64_t TRIMER_TAB[4 * 4 * 4];
63 extern const uint64_t TETRAMER_TAB[4 * 4 * 4 * 4];
64
65} // namespace btllib
66
67#endif
btllib
Definition: bloom_filter.hpp:16