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

Method shiftPrepend

Common/Kmer.cpp:342–363  ·  view source on GitHub ↗

Shift the sequence right and prepend a new base at the front. * @return the base shifted out */

Source from the content-addressed store, hash-verified

340 * @return the base shifted out
341 */
342uint8_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
365uint8_t Kmer::leftShiftByte(char* pSeq,
366 unsigned byteNum, unsigned index, uint8_t base)

Callers

nothing calls this directly

Calls 4

seqIndexToByteNumberFunction · 0.85
seqIndexToBaseIndexFunction · 0.85
getBaseCodeFunction · 0.85
setBaseCodeFunction · 0.85

Tested by

no test coverage detected