Raptor 4.0.0-rc.1
A fast and space-efficient pre-filter
Loading...
Searching...
No Matches
insert_tb_and_parents.cpp File Reference

Implements raptor::detail::insert_tb_and_parents. More...

#include <optional>
#include <hibf/build/insert_into_ibf.hpp>
#include <raptor/index.hpp>
#include "is_fpr_exceeded.hpp"
#include "strong_types.hpp"
+ Include dependency graph for insert_tb_and_parents.cpp:

Functions

void raptor::detail::insert_into_ibf (robin_hood::unordered_flat_set< uint64_t > const &kmers, insert_location const &insert_location, raptor_index< index_structure::hibf > &index, std::optional< rebuild_location > &rebuild_index_tuple)
 Inserts kmers into the technical bins given by insert_location.
 
std::optional< rebuild_location > raptor::detail::insert_tb_and_parents (robin_hood::unordered_flat_set< uint64_t > const &kmers, insert_location insert_location, raptor_index< index_structure::hibf > &index)
 Inserts kmers at insert_location and into every merged bin on the path to the top-level IBF.
 

Detailed Description

Implements raptor::detail::insert_tb_and_parents.

Author
Enrico Seiler <enrico.seiler AT fu-berlin.de>

Function Documentation

◆ insert_into_ibf()

void raptor::detail::insert_into_ibf ( robin_hood::unordered_flat_set< uint64_t > const & kmers,
insert_location const & insert_location,
raptor_index< index_structure::hibf > & index,
std::optional< rebuild_location > & rebuild_index_tuple )

Inserts kmers into the technical bins given by insert_location.

Parameters
[in]kmersThe k-mers to insert.
[in]insert_locationWhere to insert.
[in,out]indexThe index to insert into.
[in,out]rebuild_index_tupleSet to insert_location if the insertion pushed the bin past its target FPR.

The k-mers are distributed evenly if insert_location spans more than one technical bin.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert_tb_and_parents()

std::optional< rebuild_location > raptor::detail::insert_tb_and_parents ( robin_hood::unordered_flat_set< uint64_t > const & kmers,
insert_location insert_location,
raptor_index< index_structure::hibf > & index )

Inserts kmers at insert_location and into every merged bin on the path to the top-level IBF.

Parameters
[in]kmersThe k-mers to insert.
[in]insert_locationWhere the user bin is stored.
[in,out]indexThe index to insert into.
Returns
The bin closest to the top-level IBF whose target FPR is exceeded, or std::nullopt if none is.

A query only reaches a lower-level IBF through the merged bins above it, hence the k-mers have to be present in all of them. Walking upwards means a returned location is the highest one that exceeds its FPR, i.e. rebuilding there also covers every exceeded bin below it.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
Hide me