MCPcopy Create free account
hub / github.com/BirolLab/abyss / rollLeft

Method rollLeft

BloomDBG/RollingHash.h:110–124  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

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

Callers 2

TEST_FFunction · 0.80
shiftMethod · 0.80

Calls 3

emptyMethod · 0.45
shiftMethod · 0.45
c_strMethod · 0.45

Tested by 1

TEST_FFunction · 0.64