UnorderedLookup¶
#include <pbbam/PbiLookupData.h>
- template <typename T>
-
class
PacBio::BAM::
UnorderedLookup
¶ The UnorderedLookup class provides a quick lookup structure for PBI index data, where key values are not sorted.
The main, underlying lookup structure is essentailly a std::unordered_map, where the key is some value (e.g. read group ID) and the value is the list of indices (i-th record) in the BAM file.
This lookup class is one of the main building blocks for the PBI index lookup components.
- Parameters
T
: type of key stored (Accuracy for readAccuracy, int32_t for ZMW, etc.)
Constructors & Related Methods
-
UnorderedLookup
()¶ Creates an empty UnorderedLookup structure.
-
UnorderedLookup
(const container_type &data)¶ Creates an UnorderedLookup struture, from another’s underlying lookup container.
- Parameters
data
: lookup data container
-
UnorderedLookup
(container_type &&data)¶ Creates an UnorderedLookup struture, from another’s underlying lookup container.
- Parameters
data
: lookup data container
-
UnorderedLookup
(const std::vector<T> &rawData)¶ Creates an UnorderedLookup struture, from raw data.
- Parameters
rawData
: raw data values, where i is the index into the BAM file, and rawData[i] is the key value
-
UnorderedLookup
(std::vector<T> &&rawData)¶ Creates an UnorderedLookup struture, from raw data.
- Parameters
rawData
: raw data values, where i is the index into the BAM file, and rawData[i] is the key value
Operators
-
bool
operator==
(const UnorderedLookup<T> &other) const¶ - Return
- true if this lookup is same as
other
-
bool
operator!=
(const UnorderedLookup<T> &other) const¶ - Return
- true if this lookup is not the same as
other
STL-Compatibility Methods
-
iterator
begin
()¶ - Return
- an iterator to the first element in the underlying container
-
const_iterator
begin
() const¶ - Return
- a const iterator to the first element in the underlying container
-
const_iterator
cbegin
() const¶ - Return
- a const iterator to the first element in the underlying
-
iterator
end
()¶ - Return
- an iterator after the last element in the underlying container
-
const_iterator
end
() const¶ - Return
- a const iterator after the last element in the underlying container
-
const_iterator
cend
() const¶ - Return
- a const iterator after the last element in the underlying container
-
bool
empty
() const¶ - Return
- true if underlying container is empty
-
size_t
size
() const¶ - Return
- number of keys in the container
Lookup Data
-
IndexList
LookupIndices
(const key_type &key, const Compare::Type &compare) const¶ Performs a lookup into the underlying data.
- Return
- sorted list of unique indices that satisfy the lookup key & compare type
- Parameters
key
: key value to lookupcompare
: compare type
-
std::vector<T>
Unpack
() const¶ Converts the lookup structure back into its raw data.
- Return
- raw data values, where i is the index into the BAM file, and rawData[i] is the key value
Public Types
-
template<>
usingkey_type
= T¶
-
template<>
usingvalue_type
= IndexList¶
-
template<>
usingcontainer_type
= std::unordered_map<key_type, value_type>¶
-
template<>
usingiterator
= typename container_type::iterator¶
-
template<>
usingconst_iterator
= typename container_type::const_iterator¶