Reverse-complement this sequence. */
| 276 | |
| 277 | /** Reverse-complement this sequence. */ |
| 278 | void 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 | |
| 297 | bool Kmer::isCanonical() const |
| 298 | { |