btllib
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
btllib::RollingHash Class Reference

#include <rolling_hash.hpp>

Inheritance diagram for btllib::RollingHash:
btllib::SeedRollingHash

Public Member Functions

 RollingHash (const char *seq, size_t seq_len, unsigned k, unsigned hash_num)
 
 RollingHash (const std::string &seq, unsigned k, unsigned hash_num)
 
bool roll ()
 
const uint64_t * hashes () const
 
size_t get_pos () const
 
unsigned get_k () const
 
unsigned get_hash_num () const
 

Protected Member Functions

bool init ()
 

Protected Attributes

const char * seq
 
const size_t seq_len
 
const unsigned k
 
const unsigned hash_num
 
size_t pos = 0
 
std::vector< uint64_t > hashes_vector
 
uint64_t forward_hash = 0
 
uint64_t reverse_hash = 0
 

Detailed Description

Iterate over hash values for k-mers in a given DNA sequence.

This implementation uses ntHash function to efficiently calculate hash values for successive k-mers.

Constructor & Destructor Documentation

◆ RollingHash() [1/2]

btllib::RollingHash::RollingHash ( const char *  seq,
size_t  seq_len,
unsigned  k,
unsigned  hash_num 
)
inline

Constructor.

Parameters
seqDNA sequence to be hashed
seq_lenlength of seq
kk-mer size
hash_numnumber of hashes

◆ RollingHash() [2/2]

btllib::RollingHash::RollingHash ( const std::string &  seq,
unsigned  k,
unsigned  hash_num 
)
inline

Constructor.

Parameters
seqDNA sequence to be hashed
kk-mer size
hash_numnumber of hashes

Member Function Documentation

◆ init()

bool btllib::RollingHash::init ( )
protected

Initialize internal state of iterator


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