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

Function setBaseCode

Common/Kmer.cpp:397–412  ·  view source on GitHub ↗

Set a base by byte number/ sub index beware, this does not check for out of bounds access

Source from the content-addressed store, hash-verified

395//Set a base by byte number/ sub index
396// beware, this does not check for out of bounds access
397static void setBaseCode(char* pSeq,
398 unsigned byteNum, unsigned index, uint8_t base)
399{
400 // shift the value into position
401 unsigned shiftValue = 2*(3 - index);
402 base <<= shiftValue;
403
404 // clear the value
405 uint8_t mask = 0x3;
406 mask <<= shiftValue;
407 mask = ~mask;
408 pSeq[byteNum] &= mask;
409
410 // set the appropriate value with an OR
411 pSeq[byteNum] |= base;
412}
413
414/** Return the base at the specified index. */
415uint8_t Kmer::at(unsigned i) const

Callers 4

shiftPrependMethod · 0.85
leftShiftByteMethod · 0.85
rightShiftByteMethod · 0.85
setMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected