Shift the sequence right and prepend a new base at the front. * @return the base shifted out */
| 340 | * @return the base shifted out |
| 341 | */ |
| 342 | uint8_t Kmer::shiftPrepend(uint8_t base) |
| 343 | { |
| 344 | unsigned numBytes = bytes(); |
| 345 | |
| 346 | unsigned lastBaseByte = seqIndexToByteNumber(s_length - 1); |
| 347 | unsigned lastBaseIndex = seqIndexToBaseIndex(s_length - 1); |
| 348 | |
| 349 | // save the last base (which gets shifted out) |
| 350 | uint8_t lastBase = getBaseCode(m_seq, |
| 351 | lastBaseByte, lastBaseIndex); |
| 352 | // Zero the last base, which is required by compare. |
| 353 | setBaseCode(m_seq, lastBaseByte, lastBaseIndex, 0); |
| 354 | |
| 355 | uint8_t shiftIn = base; |
| 356 | for(unsigned i = 0; i <= numBytes - 1; i++) |
| 357 | { |
| 358 | // index is always zero |
| 359 | unsigned index = 0; |
| 360 | shiftIn = rightShiftByte(m_seq, i, index, shiftIn); |
| 361 | } |
| 362 | return lastBase; |
| 363 | } |
| 364 | |
| 365 | uint8_t Kmer::leftShiftByte(char* pSeq, |
| 366 | unsigned byteNum, unsigned index, uint8_t base) |
nothing calls this directly
no test coverage detected