Set a base by byte number/ sub index beware, this does not check for out of bounds access
| 395 | //Set a base by byte number/ sub index |
| 396 | // beware, this does not check for out of bounds access |
| 397 | static 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. */ |
| 415 | uint8_t Kmer::at(unsigned i) const |
no outgoing calls
no test coverage detected