btllib
|
#include <nthash.hpp>
Public Member Functions | |
BlindNtHash (const char *seq, size_t seq_len, unsigned hash_num, unsigned k, size_t pos=0) | |
BlindNtHash (const std::string &seq, unsigned hash_num, unsigned k, size_t pos=0) | |
BlindNtHash (const BlindNtHash &nthash) | |
BlindNtHash (BlindNtHash &&)=default | |
bool | roll (char char_in) |
bool | roll_back (char char_in) |
bool | peek (char char_in) |
bool | peek_back (char char_in) |
void | sub (const std::vector< unsigned > &positions, const std::vector< unsigned char > &new_bases) |
const uint64_t * | hashes () const |
size_t | get_pos () const |
bool | forward () const |
unsigned | get_hash_num () const |
unsigned | get_k () const |
uint64_t | get_forward_hash () const |
uint64_t | get_reverse_hash () const |
void | change_seq (const std::string &new_seq, size_t new_pos=0) |
Similar to NtHash class, but instead of rolling on a predefined sequence, BlindNtHash needs to be fed the new character on each roll. This is useful when traversing an implicit de Bruijn Graph, as we need to query all bases to know the possible extensions.
btllib::BlindNtHash::BlindNtHash | ( | const char * | seq, |
size_t | seq_len, | ||
unsigned | hash_num, | ||
unsigned | k, | ||
size_t | pos = 0 |
||
) |
Constructor.
seq | C string of DNA sequence to start hashing from. |
seq_len | Length of seq. |
hash_num | Number of hashes to produce per k-mer. |
k | K-mer size. |
pos | Position in seq to start hashing from. |
btllib::BlindNtHash::BlindNtHash | ( | const std::string & | seq, |
unsigned | hash_num, | ||
unsigned | k, | ||
size_t | pos = 0 |
||
) |
Constructor.
seq | String of DNA sequence to start hashing from. |
hash_num | Number of hashes to produce per k-mer. |
k | K-mer size. |
pos | Position in seq to start hashing from. |
|
inline |
bool btllib::BlindNtHash::peek | ( | char | char_in | ) |
Like NtHash::peek(), but as if roll(char char_in) was called.
bool btllib::BlindNtHash::peek_back | ( | char | char_in | ) |
Like peek(char char_in), but as if roll_back(char char_in) was called.
bool btllib::BlindNtHash::roll | ( | char | char_in | ) |
Like the NtHash::roll() function, but instead of advancing in the sequence BlindNtHash object was constructed on, the provided character char_in
is used as the next base. Useful if you want to query for possible paths in an implicit de Bruijn graph graph.
bool btllib::BlindNtHash::roll_back | ( | char | char_in | ) |
Like the roll(char char_in) function, but advance backwards.