@@ -223,10 +223,6 @@ std::tuple<float, int, std::vector<Nam>> find_nams(
223
223
const StrobemerIndex& index,
224
224
bool use_mcs
225
225
) {
226
- std::vector<PartialHit> partial_queried; // TODO: is a small set more efficient than linear search in a small vector?
227
- if (use_mcs) {
228
- partial_queried.reserve (10 );
229
- }
230
226
std::array<robin_hood::unordered_map<unsigned int , std::vector<Match>>, 2 > matches_map;
231
227
matches_map[0 ].reserve (100 );
232
228
matches_map[1 ].reserve (100 );
@@ -243,24 +239,18 @@ std::tuple<float, int, std::vector<Nam>> find_nams(
243
239
add_to_matches_map_full (matches_map[q.is_reverse ], q.start , q.end , index , position);
244
240
}
245
241
else if (use_mcs) {
246
- PartialHit ph{q.hash & index .get_main_hash_mask (), q.start , q.is_reverse };
247
- if (std::find (partial_queried.begin (), partial_queried.end (), ph) != partial_queried.end ()) {
248
- // already queried
249
- continue ;
250
- }
251
242
size_t partial_pos = index .find_partial (q.hash );
252
243
if (partial_pos != index .end ()) {
253
244
total_hits++;
254
245
if (index .is_partial_filtered (partial_pos)) {
255
- partial_queried.push_back (ph);
256
246
continue ;
257
247
}
258
248
nr_good_hits++;
259
249
add_to_matches_map_partial (matches_map[q.is_reverse ], q.start , q.start + index .k (), index , partial_pos);
260
250
}
261
- partial_queried.push_back (ph);
262
251
}
263
252
}
253
+
264
254
float nonrepetitive_fraction = total_hits > 0 ? ((float ) nr_good_hits) / ((float ) total_hits) : 1.0 ;
265
255
auto nams = merge_matches_into_nams_forward_and_reverse (matches_map, index .k (), use_mcs);
266
256
return {nonrepetitive_fraction, nr_good_hits, nams};
@@ -290,8 +280,6 @@ std::pair<int, std::vector<Nam>> find_nams_rescue(
290
280
< std::tie (rhs.count , rhs.query_start , rhs.query_end );
291
281
}
292
282
};
293
- std::vector<PartialHit> partial_queried; // TODO: is a small set more efficient than linear search in a small vector?
294
- partial_queried.reserve (10 );
295
283
std::array<robin_hood::unordered_map<unsigned int , std::vector<Match>>, 2 > matches_map;
296
284
std::vector<RescueHit> hits_fw;
297
285
std::vector<RescueHit> hits_rc;
@@ -312,11 +300,6 @@ std::pair<int, std::vector<Nam>> find_nams_rescue(
312
300
}
313
301
}
314
302
else if (use_mcs) {
315
- PartialHit ph = {qr.hash & index .get_main_hash_mask (), qr.start , qr.is_reverse };
316
- if (std::find (partial_queried.begin (), partial_queried.end (), ph) != partial_queried.end ()) {
317
- // already queried
318
- continue ;
319
- }
320
303
size_t partial_pos = index .find_partial (qr.hash );
321
304
if (partial_pos != index .end ()) {
322
305
unsigned int partial_count = index .get_count_partial (partial_pos);
@@ -327,7 +310,6 @@ std::pair<int, std::vector<Nam>> find_nams_rescue(
327
310
hits_fw.push_back (rh);
328
311
}
329
312
}
330
- partial_queried.push_back (ph);
331
313
}
332
314
}
333
315
0 commit comments