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

Method reverseComplement

Common/Kmer.cpp:278–295  ·  view source on GitHub ↗

Reverse-complement this sequence. */

Source from the content-addressed store, hash-verified

276
277/** Reverse-complement this sequence. */
278void Kmer::reverseComplement()
279{
280 Seq seq = load((uint8_t*)m_seq);
281
282 // Complement the bits.
283 if (!opt::colourSpace)
284 seq.flip();
285
286 // Shift the bits flush to the right of the double word.
287 seq >>= seq.size() - 2*s_length;
288
289 storeReverse((uint8_t*)m_seq, seq);
290
291 // Reverse the pairs of bits withing a byte.
292 unsigned numBytes = bytes();
293 for (unsigned i = 0; i < numBytes; i++)
294 m_seq[i] = swapBases[(uint8_t)m_seq[i]];
295}
296
297bool Kmer::isCanonical() const
298{

Callers 9

TEST_FFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
getCodeMethod · 0.45
isPalindromeMethod · 0.45
nextMethod · 0.45
reverseComplementFunction · 0.45
connectPairsFunction · 0.45
isCanonicalMethod · 0.45

Calls 4

loadFunction · 0.85
storeReverseFunction · 0.85
flipMethod · 0.80
sizeMethod · 0.45

Tested by 3

TEST_FFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36