Skip to content

Commit

Permalink
adding syncmers at the ends of reads as seeds without 'aucillary' (co…
Browse files Browse the repository at this point in the history
…ntext) hash. Increases the number of seeds per read with 2*w_min seeds'
  • Loading branch information
ksahlin committed Apr 18, 2024
1 parent ba2aec4 commit a8bbb03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/randstrobes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ Randstrobe RandstrobeIterator::get(unsigned int strobe1_index) const {
uint64_t min_val = std::numeric_limits<uint64_t>::max();
Syncmer strobe2 = strobe1;

if (syncmers.size() < w_start) {
return Randstrobe{
randstrobe_hash(strobe1.hash, 0, aux_len),
static_cast<uint32_t>(strobe1.position),
static_cast<uint32_t>(strobe1.position), true
};
}

for (auto i = w_start; i <= w_end && syncmers[i].position <= max_position; i++) {
assert(i < syncmers.size());

Expand Down
2 changes: 1 addition & 1 deletion src/randstrobes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class RandstrobeIterator {
}

bool has_next() {
return strobe1_index + w_min < syncmers.size();
return strobe1_index < syncmers.size();
}

private:
Expand Down

0 comments on commit a8bbb03

Please sign in to comment.