ntHash
Loading...
Searching...
No Matches
nthash::SeedNtHash Class Reference

Public Member Functions

 SeedNtHash (const char *seq, size_t seq_len, const std::vector< std::string > &seeds, typedefs::NUM_HASHES_TYPE num_hashes_per_seed, typedefs::K_TYPE k, size_t pos=0)
 
 SeedNtHash (const std::string &seq, const std::vector< std::string > &seeds, typedefs::NUM_HASHES_TYPE num_hashes_per_seed, typedefs::K_TYPE k, size_t pos=0)
 
 SeedNtHash (const char *seq, size_t seq_len, const std::vector< std::vector< unsigned > > &seeds, typedefs::NUM_HASHES_TYPE num_hashes_per_seed, typedefs::K_TYPE k, size_t pos=0)
 
 SeedNtHash (const std::string &seq, const std::vector< std::vector< unsigned > > &seeds, typedefs::NUM_HASHES_TYPE num_hashes_per_seed, typedefs::K_TYPE k, size_t pos=0)
 
 SeedNtHash (const SeedNtHash &obj)
 
 SeedNtHash (SeedNtHash &&)=default
 
bool roll ()
 
bool roll_back ()
 
bool peek ()
 
bool peek_back ()
 
bool peek (char char_in)
 
bool peek_back (char char_in)
 
const uint64_t * hashes () const
 
size_t get_pos () const
 
unsigned get_hash_num () const
 
typedefs::NUM_HASHES_TYPE get_hash_num_per_seed () const
 
typedefs::K_TYPE get_k () const
 
uint64_t * get_forward_hash () const
 
uint64_t * get_reverse_hash () const
 

Constructor & Destructor Documentation

◆ SeedNtHash() [1/4]

nthash::SeedNtHash::SeedNtHash ( const char *  seq,
size_t  seq_len,
const std::vector< std::string > &  seeds,
typedefs::NUM_HASHES_TYPE  num_hashes_per_seed,
typedefs::K_TYPE  k,
size_t  pos = 0 
)

Construct an ntHash object for spaced seeds.

Parameters
seqC-string of the sequence to be hashed
seq_lenLength of the sequence
seedsVector of spaced seed patterns as strings (1s as cares, 0s as don't cares, must be of size k)
num_hashes_per_seedNumber of hashes to generate per seed
kK-mer size
posPosition in seq to start hashing from

◆ SeedNtHash() [2/4]

nthash::SeedNtHash::SeedNtHash ( const std::string &  seq,
const std::vector< std::string > &  seeds,
typedefs::NUM_HASHES_TYPE  num_hashes_per_seed,
typedefs::K_TYPE  k,
size_t  pos = 0 
)
inline

Construct an ntHash object for spaced seeds.

Parameters
seqString of the sequence to be hashed
seedsVector of spaced seed patterns as strings (1s as cares, 0s as don't cares, must be of size k)
num_hashes_per_seedNumber of hashes to generate per seed
kK-mer size
posPosition in seq to start hashing from

◆ SeedNtHash() [3/4]

nthash::SeedNtHash::SeedNtHash ( const char *  seq,
size_t  seq_len,
const std::vector< std::vector< unsigned > > &  seeds,
typedefs::NUM_HASHES_TYPE  num_hashes_per_seed,
typedefs::K_TYPE  k,
size_t  pos = 0 
)

Construct an ntHash object for spaced seeds.

Parameters
seqC-string of the sequence to be hashed
seq_lenLength of the sequence
seedsVector of parsed spaced seed patterns (vectors of don't care positions)
num_hashes_per_seedNumber of hashes to generate per seed
kK-mer size
posPosition in seq to start hashing from

◆ SeedNtHash() [4/4]

nthash::SeedNtHash::SeedNtHash ( const std::string &  seq,
const std::vector< std::vector< unsigned > > &  seeds,
typedefs::NUM_HASHES_TYPE  num_hashes_per_seed,
typedefs::K_TYPE  k,
size_t  pos = 0 
)
inline

Construct an ntHash object for spaced seeds.

Parameters
seqString of the sequence to be hashed
seedsVector of parsed spaced seed patterns (vectors of don't care positions)
num_hashes_per_seedNumber of hashes to generate per seed
kK-mer size
posPosition in seq to start hashing from

Member Function Documentation

◆ get_forward_hash()

uint64_t * nthash::SeedNtHash::get_forward_hash ( ) const
inline

Get the hash values of the forward strand.

Returns
Array of forward hash value arrays for each seed

◆ get_hash_num()

unsigned nthash::SeedNtHash::get_hash_num ( ) const
inline

Get the length of the hash array.

Returns
Number of seeds times get_hash_num_per_seed()

◆ get_hash_num_per_seed()

typedefs::NUM_HASHES_TYPE nthash::SeedNtHash::get_hash_num_per_seed ( ) const
inline

Get the number of hashes generated per seed.

Returns
Number of hashes per seed

◆ get_k()

typedefs::K_TYPE nthash::SeedNtHash::get_k ( ) const
inline

Get the length of the k-mers.

Returns
k

◆ get_pos()

size_t nthash::SeedNtHash::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 * nthash::SeedNtHash::get_reverse_hash ( ) const
inline

Get the hash values of the reverse strand.

Returns
Array of reverse-complement hash value arrays for each seed

◆ hashes()

const uint64_t * nthash::SeedNtHash::hashes ( ) const
inline

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

Returns
Pointer to the hash array

◆ peek() [1/2]

bool nthash::SeedNtHash::peek ( )

Peeks the hash values as if roll() was called. Refer to NtHash::peek() for more information.

Returns
true on success and false otherwise.

◆ peek() [2/2]

bool nthash::SeedNtHash::peek ( char  char_in)

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

Returns
true on success and false otherwise.

◆ peek_back() [1/2]

bool nthash::SeedNtHash::peek_back ( )

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

Returns
true on success and false otherwise.

◆ peek_back() [2/2]

bool nthash::SeedNtHash::peek_back ( char  char_in)

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

Returns
true on success and false otherwise.

◆ roll()

bool nthash::SeedNtHash::roll ( )

Calculate the next hash value. Refer to NtHash::roll() for more information.

Returns
true on success and false otherwise.

◆ roll_back()

bool nthash::SeedNtHash::roll_back ( )

Like the roll() function, but advance backwards.

Returns
true on success and false otherwise.

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