Skip to content

Commit 3c568dc

Browse files
committed
Rescue using partial hits, even in non-MCS mode
1 parent 9ea6fa5 commit 3c568dc

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/nam.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,21 @@ std::tuple<float, int, std::vector<Nam>> find_nams(
219219
}
220220
}
221221

222+
// Rescue using partial hits, even in non-MCS mode
223+
if (total_hits == 0 && !use_mcs) {
224+
for (const auto &q : query_randstrobes) {
225+
size_t partial_pos = index.find_partial(q.hash);
226+
if (partial_pos != index.end()) {
227+
total_hits++;
228+
if (index.is_partial_filtered(partial_pos)) {
229+
continue;
230+
}
231+
nr_good_hits++;
232+
add_to_matches_map_partial(matches_map[q.is_reverse], q.start, q.start + index.k(), index, partial_pos);
233+
}
234+
}
235+
}
236+
222237
float nonrepetitive_fraction = total_hits > 0 ? ((float) nr_good_hits) / ((float) total_hits) : 1.0;
223238
auto nams = merge_matches_into_nams_forward_and_reverse(matches_map, index.k(), use_mcs);
224239
return {nonrepetitive_fraction, nr_good_hits, nams};

0 commit comments

Comments
 (0)