ReadAccuracyQuery¶
#include <pbbam/ReadAccuracyQuery.h>
-
class
PacBio::BAM::
ReadAccuracyQuery
¶ The ReadAccuracyQuery class provides iterable access to a DataSet‘s BAM records, limiting results to those matching a read accuracy criterion.
Example:
// using C++11 range-based for loop ReadAccuracyQuery query(0.9, Compare::GREATER_THAN_EQUAL, dataset); for (const BamRecord& r : query) { assert(r.ReadAccuracy() >= 0.9); } // OR // using iterators directly ReadAccuracyQuery query(0.9, Compare::GREATER_THAN_EQUAL, dataset); auto iter = query.cbegin(); auto end = query.cend(); for (; iter != end; ++iter) { assert(iter->ReadAccuracy() >= 0.9); }
- Note
- Currently, all BAM files must have a corresponding ”.pbi” index file. Use BamFile::EnsurePacBioIndexExists before creating the query if one may not be present.
Inherits from IQuery
Public Functions
-
ReadAccuracyQuery
(const Accuracy accuracy, const Compare::Type compareType, const DataSet &dataset)¶ Creates a new ReadAccuracyQuery, limiting record results to only those matching a read accuracy criterion.
- See
- BamRecord::ReadAccuracy
- Parameters
accuracy
: read accuracy valuecompareType
: compare operatordataset
: input data source(s)
- Exceptions
std::runtime_error
: on failure to open/read underlying BAM or PBI files.
-
~ReadAccuracyQuery
()¶
-
bool
GetNext
(BamRecord &r)¶ Main iteration point for record access.
Most client code should not need to use this method directly. Use iterators instead.
-
uint32_t
NumReads
() const¶