4#include "digest/digester.hpp"
5#include "digest/window_minimizer.hpp"
35 Syncmer(
const char *seq,
size_t len,
unsigned k,
unsigned large_window,
38 :
WindowMin<P, T>(seq, len, k, large_window, start, minimized_h) {}
51 Syncmer(
const std::string &seq,
unsigned k,
unsigned large_window,
54 :
Syncmer<P, T>(seq.c_str(), seq.size(), k, large_window, start,
68 while (this->ds_size + 1 < this->large_window and this->is_valid_hash) {
70 this->ds.insert(this->
get_pos(), this->chash);
73 this->ds.insert(this->
get_pos(), this->fhash);
75 this->ds.insert(this->
get_pos(), this->rhash);
82 while (this->is_valid_hash and vec.size() < amount) {
83 Syncmer::roll_ds_sync(vec);
97 std::vector<std::pair<uint32_t, uint32_t>> &vec)
override {
100 while (this->ds_size + 1 < this->large_window and this->is_valid_hash) {
102 this->ds.insert(this->
get_pos(), this->chash);
105 this->ds.insert(this->
get_pos(), this->fhash);
107 this->ds.insert(this->
get_pos(), this->rhash);
114 while (this->is_valid_hash and vec.size() < amount) {
115 Syncmer::roll_ds_sync(vec);
125 void roll_ds_sync(std::vector<uint32_t> &vec) {
127 this->ds.insert(this->
get_pos(), this->chash);
130 this->ds.insert(this->
get_pos(), this->fhash);
132 this->ds.insert(this->
get_pos(), this->rhash);
134 this->ds.min_syncmer(vec);
144 void roll_ds_sync(std::vector<std::pair<uint32_t, uint32_t>> &vec) {
146 this->ds.insert(this->
get_pos(), this->chash);
149 this->ds.insert(this->
get_pos(), this->fhash);
151 this->ds.insert(this->
get_pos(), this->rhash);
153 this->ds.min_syncmer(vec);
bool roll_one()
moves the internal pointer to the next valid k-mer. Time Complexity: O(1)
Definition digester.hpp:138
MinimizedHashType get_minimized_h()
Definition digester.hpp:289
size_t get_pos()
Definition digester.hpp:177
This class inherits from WindowMinimizer (implementation reasons), but the represent very different t...
Definition syncmer.hpp:21
void roll_minimizer(unsigned amount, std::vector< uint32_t > &vec) override
adds up to amount of positions of syncmers into vec. Here a large window is considered a syncmer if t...
Definition syncmer.hpp:65
Syncmer(const char *seq, size_t len, unsigned k, unsigned large_window, size_t start=0, MinimizedHashType minimized_h=MinimizedHashType::CANON)
Definition syncmer.hpp:35
Syncmer(const std::string &seq, unsigned k, unsigned large_window, size_t start=0, MinimizedHashType minimized_h=MinimizedHashType::CANON)
Definition syncmer.hpp:51
void roll_minimizer(unsigned amount, std::vector< std::pair< uint32_t, uint32_t > > &vec) override
adds up to amount of positions and hashes of syncmers into vec. Here a large window is considered a s...
Definition syncmer.hpp:96
Child class of Digester that defines a minimizer as a kmer whose hash is minimal among those in the l...
Definition window_minimizer.hpp:33
digest code.
Definition data_structure.hpp:27
MinimizedHashType
Enum values for the type of hash to minimize.
Definition digester.hpp:41