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

Public Member Functions

 AAHash (std::string_view seq, uint8_t hash_num, uint16_t k, unsigned level, size_t pos=0)
 
 AAHash (const AAHash &aahash)
 
 AAHash (AAHash &&)=default
 
bool roll ()
 
const uint64_t * hashes () const
 
size_t get_pos () const
 
unsigned get_hash_num () const
 
unsigned get_k () const
 
uint64_t get_forward_hash () const
 
unsigned get_level () const
 
const char * get_seq () const
 

Friends

class SeedAAHash
 

Constructor & Destructor Documentation

◆ AAHash()

btllib::AAHash::AAHash ( std::string_view seq,
uint8_t hash_num,
uint16_t k,
unsigned level,
size_t pos = 0 )
inline

Constructor.

Parameters
seqString of DNA sequence to be hashed.
hash_numNumber of hashes to produce per k-mer.
kK-mer size.
posPosition in seq to start hashing from.
levelseed level to generate hash.

Member Function Documentation

◆ roll()

bool btllib::AAHash::roll ( )

Calculate the hash values of current k-mer and advance to the next. AAHash advances one amino acid at a time until it finds a k-mer with valid characters and skips over those with invalid characters. This method must be called before hashes() is accessed, for the first and every subsequent hashed kmer. get_pos() may be called at any time to obtain the position of last hashed k-mer or the k-mer to be hashed if roll() has never been called on this AAHash object. It is important to note that the number of roll() calls is NOT necessarily equal to get_pos(), if there are N or invalid characters in the hashed sequence.

Returns
true on success and false otherwise.

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