17#include <seqan3/alphabet/nucleotide/dna4.hpp>
18#include <seqan3/search/views/kmer_hash.hpp>
23namespace raptor::threshold
82 size_t const text_length = text.
size();
86 uint64_t
const max_number_of_minimiser = text_length -
window_size + 1u;
93 auto apply_xor = [
this](uint64_t
const value)
97 auto kmer_view = text | seqan3::views::kmer_hash(
shape) | std::views::transform(apply_xor);
104 for (uint64_t i = 0; i < kmers_per_window; ++i)
113 for (uint64_t i = kmers_per_window; i < max_number_of_minimiser; ++i)
116 uint64_t
const new_hash{
forward_hashes[i + kmers_per_window - 1]};
119 if (new_hash < min->second)
Provides raptor::adjust_seed.
T emplace_back(T... args)
Definition: forward_strand_minimiser.hpp:28
uint64_t window_size
The window size of the minimiser.
Definition: forward_strand_minimiser.hpp:31
forward_strand_minimiser(window const window_size_, seqan3::shape const shape_)
Constructs a minimiser from given k-mer, window size and a seed.
Definition: forward_strand_minimiser.hpp:56
std::vector< uint64_t > forward_hashes
Stores the k-mer hashes of the forward strand.
Definition: forward_strand_minimiser.hpp:39
forward_strand_minimiser(forward_strand_minimiser &&)=default
Defaulted.
forward_strand_minimiser & operator=(forward_strand_minimiser const &)=default
Defaulted.
uint64_t seed
Random but fixed value to xor k-mers with. Counteracts consecutive minimisers.
Definition: forward_strand_minimiser.hpp:37
forward_strand_minimiser & operator=(forward_strand_minimiser &&)=default
Defaulted.
forward_strand_minimiser()=default
Defaulted.
void resize(window const window_size_, seqan3::shape const shape_)
Resize the minimiser.
Definition: forward_strand_minimiser.hpp:69
uint8_t shape_size
The size of the shape.
Definition: forward_strand_minimiser.hpp:35
~forward_strand_minimiser()=default
Defaulted.
std::vector< uint64_t > minimiser_begin
Stores the begin positions of the minimisers.
Definition: forward_strand_minimiser.hpp:43
seqan3::shape shape
The shape to use.
Definition: forward_strand_minimiser.hpp:33
forward_strand_minimiser(forward_strand_minimiser const &)=default
Defaulted.
Strong type for passing the window size.
Definition: strong_types.hpp:22