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
14namespace 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
21const uint8_t CP_OFF = 0x07;
22
23// shift for gerenerating multiple hash values
24const int MULTISHIFT = 27;
25
26// seed for gerenerating multiple hash values
27static const uint64_t MULTISEED = 0x90b45d39fb6da1fa;
28
29// 64-bit random seeds corresponding to bases and their complements
30static const uint64_t SEED_A = 0x3c8bfbb395c60474;
31static const uint64_t SEED_C = 0x3193c18562a02b4c;
32static const uint64_t SEED_G = 0x20323ed082572324;
33static const uint64_t SEED_T = 0x295549f54be24456;
34static const uint64_t SEED_N = 0x0000000000000000;
35
36static const int ASCII_SIZE = 256;
37
38extern const uint64_t SEED_TAB[ASCII_SIZE];
39
40extern const uint64_t A33R[33];
41extern const uint64_t A31L[31];
42
43extern const uint64_t C33R[33];
44extern const uint64_t C31L[31];
45
46extern const uint64_t G33R[33];
47extern const uint64_t G31L[31];
48
49extern const uint64_t T33R[33];
50extern const uint64_t T31L[31];
51
52extern const uint64_t N33R[33];
53extern const uint64_t N31L[31];
54
55extern const uint64_t* const MS_TAB_33R[ASCII_SIZE];
56extern const uint64_t* const MS_TAB_31L[ASCII_SIZE];
57
58extern const uint8_t CONVERT_TAB[ASCII_SIZE];
59extern const uint8_t RC_CONVERT_TAB[ASCII_SIZE];
60
61extern const uint64_t DIMER_TAB[4 * 4];
62extern const uint64_t TRIMER_TAB[4 * 4 * 4];
63extern const uint64_t TETRAMER_TAB[4 * 4 * 4 * 4];
64
65} // namespace btllib
66
67#endif
Definition: bloom_filter.hpp:16