btllib
Loading...
Searching...
No Matches
btllib::BlindNtHash Class Reference

#include <nthash_kmer.hpp>

Public Member Functions

 BlindNtHash (const std::string &seq, hashing_internals::NUM_HASHES_TYPE num_hashes, hashing_internals::K_TYPE k, long pos=0)
 
 BlindNtHash (const BlindNtHash &obj)
 
 BlindNtHash (BlindNtHash &&)=default
 
void roll (char char_in)
 
void roll_back (char char_in)
 
void peek (char char_in)
 
void peek_back (char char_in)
 
const uint64_t * hashes () const
 
long get_pos () const
 
hashing_internals::NUM_HASHES_TYPE get_hash_num () const
 
hashing_internals::K_TYPE get_k () const
 
uint64_t get_forward_hash () const
 
uint64_t get_reverse_hash () const
 

Detailed Description

Similar to the 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.

Constructor & Destructor Documentation

◆ BlindNtHash()

btllib::BlindNtHash::BlindNtHash ( const std::string & seq,
hashing_internals::NUM_HASHES_TYPE num_hashes,
hashing_internals::K_TYPE k,
long pos = 0 )
inline

Construct an ntHash object for hashing k-mers on-the-fly.

Parameters
seqSequence data. Only the first k characters will be used, starting from pos.
hash_numNumber of hashes to generate per k-mer
kK-mer size
posPosition in sequence to start hashing from

Member Function Documentation

◆ get_forward_hash()

uint64_t btllib::BlindNtHash::get_forward_hash ( ) const
inline

Get the hash value of the forward strand.

Returns
Forward hash value

◆ get_hash_num()

hashing_internals::NUM_HASHES_TYPE btllib::BlindNtHash::get_hash_num ( ) const
inline

Get the number of hashes generated per k-mer.

Returns
Number of hashes per k-mer

◆ get_k()

hashing_internals::K_TYPE btllib::BlindNtHash::get_k ( ) const
inline

Get the length of the k-mers.

Returns
k

◆ get_pos()

long btllib::BlindNtHash::get_pos ( ) const
inline

Get the position of last hashed k-mer or the k-mer to be hashed if roll() has never been called on this NtHash object.

Returns
Position of the most recently hashed k-mer's first base-pair

◆ get_reverse_hash()

uint64_t btllib::BlindNtHash::get_reverse_hash ( ) const
inline

Get the hash value of the reverse strand.

Returns
Reverse-complement hash value

◆ hashes()

const uint64_t * btllib::BlindNtHash::hashes ( ) const
inline

Get the array of current hash values (length = get_hash_num())

Returns
Pointer to the hash array

◆ peek()

void btllib::BlindNtHash::peek ( char char_in)
inline

Like NtHash::peek(), but as if roll(char char_in) was called.

◆ peek_back()

void btllib::BlindNtHash::peek_back ( char char_in)
inline

Like peek(char char_in), but as if roll_back(char char_in) was called.

◆ roll()

void btllib::BlindNtHash::roll ( char char_in)
inline

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.

◆ roll_back()

void btllib::BlindNtHash::roll_back ( char char_in)
inline

Like the roll(char char_in) function, but advance backwards.


The documentation for this class was generated from the following file: