* Compute hash values for next k-mer to the left and * update internal state. * @param prevKmer k-mer we are rolling into * @param kmer current k-mer */
| 108 | * @param kmer current k-mer |
| 109 | */ |
| 110 | void rollLeft(char charIn, const char* kmer) |
| 111 | { |
| 112 | NTC64L(kmer[m_k-1], charIn, m_k, m_hash1, m_rcHash1); |
| 113 | m_hash = canonicalHash(m_hash1, m_rcHash1); |
| 114 | |
| 115 | if (!MaskedKmer::mask().empty()) { |
| 116 | // TODO: copying the k-mer and shifting is very inefficient; |
| 117 | // we need a specialized nthash function that rolls and masks |
| 118 | // simultaneously |
| 119 | LightweightKmer next(kmer); |
| 120 | next.shift(ANTISENSE, charIn); |
| 121 | m_hash = maskHash(m_hash1, m_rcHash1, MaskedKmer::mask().c_str(), |
| 122 | next.c_str(), m_k); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Get the seed hash value for the current k-mer. The seed hash |