Skip to content

Commit

Permalink
Add syncmers at the ends of reads as seeds without auxiliary hash
Browse files Browse the repository at this point in the history
Increases the number of seeds per read by 2*w_min seeds
  • Loading branch information
ksahlin authored and marcelm committed Oct 3, 2024
1 parent b6dffd1 commit 701c472
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/randstrobes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ 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 701c472

Please sign in to comment.