PbiFilterTypes¶
#include <pbbam/PbiFilterTypes.h>
Defines the built-in PBI filters.
-
namespace
PacBio
¶ -
namespace
BAM
¶ -
struct
PbiAlignedEndFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiAlignedEndFilter class provides a PbiFilter-compatible filter on aligned end.
Example:
PbiFilterQuery query(PbiAlignedEndFilter{3000, Compare::GREATER_THAN}); for (const BamRecord& record : query) { assert(record.AlignedEnd() > 3000); }
Inherits from PacBio::BAM::internal::MappedDataFilterBase< uint32_t, MappedLookupData::A_END >
-
struct
PbiAlignedLengthFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiAlignedLengthFilter class provides a PbiFilter-compatible filter on aligned length.
Example:
PbiFilterQuery query(PbiAlignedLengthFilter{1000, Compare::GREATER_THAN}); for (const BamRecord& record : query) { assert((record.AlignedEnd() - record.AlignedStart()) > 1000); }
Inherits from PacBio::BAM::internal::FilterBase< uint32_t >
Public Functions
-
PbiAlignedLengthFilter
(const uint32_t length, const Compare::Type cmp = Compare::EQUAL)¶ Creates a filter on aligned length.
- Parameters
length
: value to compare oncmp
: compare type
-
bool
Accepts
(const PbiRawData &idx, const size_t row) const¶ Performs the actual index lookup.
Most client code should not need to use this method directly.
-
-
struct
PbiAlignedStartFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiAlignedStartFilter class provides a PbiFilter-compatible filter on aligned start.
Example:
PbiFilterQuery query(PbiAlignedStartFilter{3000, Compare::GREATER_THAN}); for (const BamRecord& record : query) { assert(record.AlignedStart() > 3000); }
Inherits from PacBio::BAM::internal::MappedDataFilterBase< uint32_t, MappedLookupData::A_START >
-
struct
PbiAlignedStrandFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiAlignedStrandFilter class provides a PbiFilter-compatible filter on aligned strand.
Example:
PbiFilterQuery query(PbiAlignedStrandFilter{Strand::FORWARD}); for (const BamRecord& record : query) { assert(record.AlignedStrand() == Strand::FORWARD); }
Inherits from PacBio::BAM::internal::MappedDataFilterBase< Strand, MappedLookupData::STRAND >
-
struct
PbiBarcodeFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiBarcodeFilter class provides a PbiFilter-compatible filter on barcode ID.
Any record with this barcode ID (forward or reverse) will pass this filter.
Example:
// single value PbiFilter filter{ PbiBarcodeFilter{17} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { const auto barcodes = record.Barcodes(); assert(barcodes.first == 17 || barcodes.second == 17); } // whitelist vector<int16_t> whitelist = { 50, 100 }; PbiFilter filter{ PbiBarcodeFilter{whitelist} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { const auto barcodes = record.Barcodes(); assert(barcodes.first == 50 || barcodes.second == 50 || barcodes.first == 100 || barcodes.second == 100); }
Public Functions
-
PbiBarcodeFilter
(const int16_t barcode, const Compare::Type cmp = Compare::EQUAL)¶ Creates a single-value barcode filter.
- Parameters
barcode
: barcode ID to compare oncmp
: compare type
-
PbiBarcodeFilter
(const std::vector<int16_t> &whitelist)¶ Creates a ‘whitelisted’ barcode filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly, in either bc_forward or bc_reverse.
- Parameters
whitelist
: barcode IDs to compare on
-
PbiBarcodeFilter
(std::vector<int16_t> &&whitelist)¶ Creates a ‘whitelisted’ barcode filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly, in either bc_forward or bc_reverse.
- Parameters
whitelist
: barcode IDs to compare on
-
bool
Accepts
(const PbiRawData &idx, const size_t row) const¶ Performs the actual index lookup.
Most client code should not need to use this method directly.
-
-
struct
PbiBarcodeForwardFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiBarcodeForwardFilter class provides a PbiFilter-compatible filter on forward barcode ID.
Example:
// single value PbiFilter filter{ PbiBarcodeForwardFilter{50} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.BarcodeForward() == 50); } // whitelist vector<int16_t> whitelist = { 50, 100 }; PbiFilter filter{ PbiBarcodeForwardFilter{whitelist} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.BarcodeForward() == 50 || record.BarcodeForward() == 100); }
Inherits from PacBio::BAM::internal::BarcodeDataFilterBase< int16_t, BarcodeLookupData::BC_FORWARD >
Public Functions
-
PbiBarcodeForwardFilter
(const int16_t bcFwdId, const Compare::Type cmp = Compare::EQUAL)¶ Creates a single-value forward barcode filter.
- Parameters
bcFwdId
: (forward) barcode ID to compare oncmp
: compare type
-
PbiBarcodeForwardFilter
(const std::vector<int16_t> &whitelist)¶ Creates a ‘whitelisted’ forward barcode filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly, in bc_forward.
- Parameters
whitelist
: barcode IDs to compare on
-
PbiBarcodeForwardFilter
(std::vector<int16_t> &&whitelist)¶ Creates a ‘whitelisted’ forward barcode filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly, in bc_forward.
- Parameters
whitelist
: barcode IDs to compare on
-
-
struct
PbiBarcodeQualityFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiBarcodeQualityFilter class provides a PbiFilter-compatible filter on barcode quality.
Example:
PbiFilter filter{ PbiBarcodeQualityFilter{42, Compare::GREATER_THAN_EQUAL} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.BarcodeQuality() >= 42); }
Inherits from PacBio::BAM::internal::BarcodeDataFilterBase< uint8_t, BarcodeLookupData::BC_QUALITY >
-
struct
PbiBarcodeReverseFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiBarcodeReverseFilter class provides a PbiFilter-compatible filter on forward barcode ID.
Example:
// single value PbiFilter filter{ PbiBarcodeReverseFilter{50} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.BarcodeReverse() == 50); } // whitelist vector<int16_t> whitelist = { 50, 100 }; PbiFilter filter{ PbiBarcodeReverseFilter{whitelist} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.BarcodeReverse() == 50 || record.BarcodeReverse() == 100); }
Inherits from PacBio::BAM::internal::BarcodeDataFilterBase< int16_t, BarcodeLookupData::BC_REVERSE >
Public Functions
-
PbiBarcodeReverseFilter
(const int16_t bcRevId, const Compare::Type cmp = Compare::EQUAL)¶ Creates a single-value reverse barcode filter.
- Parameters
bcRevId
: (reverse) barcode ID to compare oncmp
: compare type
-
PbiBarcodeReverseFilter
(const std::vector<int16_t> &whitelist)¶ Creates a ‘whitelisted’ reverse barcode filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly, in bc_reverse.
- Parameters
whitelist
: barcode IDs to compare on
-
PbiBarcodeReverseFilter
(std::vector<int16_t> &&whitelist)¶ Creates a ‘whitelisted’ reverse barcode filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly, in bc_reverse.
- Parameters
whitelist
: barcode IDs to compare on
-
-
struct
PbiBarcodesFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiBarcodesFilter class provides a PbiFilter-compatible filter on both forward & reverse barcode IDs.
A record must match both IDs to pass the filter.
Example:
PbiFilter filter{ PbiBarcodesFilter{17, 18} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.BarcodeForward() == 17 && record.BarcodeReverse() == 18); }
Public Functions
-
PbiBarcodesFilter
(const std::pair<int16_t, int16_t> barcodes, const Compare::Type cmp = Compare::EQUAL)¶ Creates a barcodes filter from a std::pair of IDs.
pair.first -> BarcodeForward pair.second -> BarcodeReverse
- Parameters
barcodes
: barcode IDs to compare oncmp
: compare type
-
PbiBarcodesFilter
(const int16_t bcForward, const int16_t bcReverse, const Compare::Type cmp = Compare::EQUAL)¶ Creates a barcodes filter from forward & reverse IDs.
- Parameters
bcForward
: forward barcode ID to compare onbcReverse
: reverse barcode ID to compare oncmp
: compare type
-
bool
Accepts
(const PbiRawData &idx, const size_t row) const¶ Performs the actual index lookup.
Most client code should not need to use this method directly.
-
-
struct
PbiIdentityFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiIdentityFilter class provides a PbiFilter-compatible filter on read identity (% aligned match).
Read identity is equivalent to: 1.0 - (nMM + nDel + nIns)/readLength.
Example:
// single value PbiFilter filter{ PbiIdentityFilter{ 0.5, Compare::GREATER_THAN_EQUAL } }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { // ... at least 50% of record was aligned ... }
Inherits from PacBio::BAM::internal::FilterBase< float >
Public Functions
-
PbiIdentityFilter
(const float identity, const Compare::Type cmp = Compare::EQUAL)¶ Creates a read identity filter.
- Parameters
identity
: value to compare oncmp
: compare type
-
bool
Accepts
(const PbiRawData &idx, const size_t row) const¶ Performs the actual index lookup.
Most client code should not need to use this method directly.
-
-
struct
PbiLocalContextFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiLocalContextFilter class provides a PbiFilter-compatible filter on local context (adapter, barcode, etc.).
The primary Compare::Type operators intended for this filter are: Compare::EQUAL, Compare::NOT_EQUAL, Compare::CONTAINS, and Compare::NOT_CONTAINS.
Example:
// -------------------- // has adapter_before // -------------------- PbiFilter filter{ PbiLocalContextFilter{LocalContextFlags::ADAPTER_BEFORE, Compare::CONTAINS} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { const bool hasAdapterBefore = (record.LocalContextFlags() & LocalContextFlags::ADAPTER_BEFORE) != 0; assert(hasAdapterBefore); } // ---------------------------------- // has any adapters, barcodes, etc. // ---------------------------------- PbiFilter filter{ PbiLocalContextFilter{LocalContextFlags::NO_LOCAL_CONTEXT, Compare::NOT_EQUAL} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { const bool hasContext = (record.LocalContextFlags() != LocalContextFlags::NO_LOCAL_CONTEXT); assert(hasContext); }
Inherits from PacBio::BAM::internal::BasicDataFilterBase< LocalContextFlags, BasicLookupData::CONTEXT_FLAG >
Public Functions
-
PbiLocalContextFilter
(const LocalContextFlags &flags, const Compare::Type cmp = Compare::EQUAL)¶
-
-
struct
PbiMapQualityFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiMapQualityFilter class provides a PbiFilter-compatible filter on mapping quality.
Example:
PbiFilter filter{ PbiMapQualityFilter{75, Compare::GREATER_THAN_EQUAL} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.MapQuality() >= 75); }
Inherits from PacBio::BAM::internal::MappedDataFilterBase< uint8_t, MappedLookupData::MAP_QUALITY >
-
struct
PbiMovieNameFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiMovieNameFilter class provides a PbiFilter-compatible filter on movie name.
Example:
// single value PbiFilter filter{ PbiMovieFilter{ "foo" } }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.MovieName() == "foo"); } // whitelist vector<string> whitelist = { "foo", "bar" }; PbiFilter filter{ PbiMovieNameFilter{whitelist} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.MovieName() == "foo" || record.MovieName() == "bar"); }
Public Functions
-
PbiMovieNameFilter
(const std::string &movieName)¶ Creates a single-value movie name filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match movie name, exactly.
- Parameters
movieName
: movie name to compare on
-
PbiMovieNameFilter
(const std::vector<std::string> &whitelist)¶ Creates a ‘whitelisted’ movie name filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: movie names to compare on
-
PbiMovieNameFilter
(std::vector<std::string> &&whitelist)¶ Creates a ‘whitelisted’ movie name filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: movie names to compare on
-
bool
Accepts
(const PbiRawData &idx, const size_t row) const¶ Performs the actual index lookup.
Most client code should not need to use this method directly.
-
-
struct
PbiNumDeletedBasesFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiNumDeletedBasesFilter class provides a PbiFilter-compatible filter on the number of deleted bases.
Example:
PbiFilter filter{ PbiNumDeletedBasesFilter{50, Compare::LESS_THAN} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.NumDeletedBases() < 50); }
Inherits from PacBio::BAM::internal::MappedDataFilterBase< size_t, MappedLookupData::N_DEL >
-
struct
PbiNumInsertedBasesFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiNumInsertededBasesFilter class provides a PbiFilter-compatible filter on the number of inserted bases.
Example:
PbiFilter filter{ PbiNumInsertedBasesFilter{50, Compare::LESS_THAN} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.NumInsertedBases() < 50); }
Inherits from PacBio::BAM::internal::MappedDataFilterBase< size_t, MappedLookupData::N_INS >
-
struct
PbiNumMatchesFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiNumMatchesFilter class provides a PbiFilter-compatible filter on the number of matched bases.
Example:
PbiFilter filter{ PbiNumMatchesFilter{2000, Compare::GREATER_THAN_EQUAL} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.NumMatches() >= 2000); }
Inherits from PacBio::BAM::internal::MappedDataFilterBase< size_t, MappedLookupData::N_M >
-
struct
PbiNumMismatchesFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiNumMismatchesFilter class provides a PbiFilter-compatible filter on the number of mismatched bases.
Example:
PbiFilter filter{ PbiNumMismatchesFilter{500, Compare::LESS_THAN} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.NumMismatches() < 500); }
Inherits from PacBio::BAM::internal::MappedDataFilterBase< size_t, MappedLookupData::N_MM >
-
struct
PbiQueryEndFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiQueryEndFilter class provides a PbiFilter-compatible filter on query end.
Example:
PbiFilter filter{ PbiQueryEndFilter{3000, Compare::GREATER_THAN} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.QueryEnd() > 3000); }
Inherits from PacBio::BAM::internal::BasicDataFilterBase< int32_t, BasicLookupData::Q_END >
-
struct
PbiQueryLengthFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiQueryLengthFilter class provides a PbiFilter-compatible filter on query length.
queryLength = (queryEnd - queryStart)
Example:
PbiFilter filter{ PbiQueryLengthFilter{2000, Compare::GREATER_THAN} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert( (record.QueryEnd() - record.QueryStart()) > 2000 ); }
Inherits from PacBio::BAM::internal::FilterBase< int32_t >
Public Functions
-
PbiQueryLengthFilter
(const int32_t length, const Compare::Type cmp = Compare::EQUAL)¶ Creates a filter on query length.
- Parameters
length
: value to compare oncmp
: compare type
-
bool
Accepts
(const PbiRawData &idx, const size_t row) const¶ Performs the actual index lookup.
Most client code should not need to use this method directly.
-
-
struct
PbiQueryNameFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiQueryNameFilter class provides a PbiFilter-compatible filter on name length.
Example:
// single value PbiFilter filter{ PbiQueryNameFilter{ "movie_1/42/100_200" } }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.FullName() == "movie_1/42/100_200"); } // whitelist vector<string> whitelist = { "movie_1/42/100_200", "movie_3/24/300_500" }; PbiFilter filter{ PbiQueryNameFilter{whitelist} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.FullName() == "movie_1/42/100_200" || record.FullName() == "movie_3/24/300_500"); }
Public Functions
-
PbiQueryNameFilter
(const std::string &qname)¶ Creates a single-value query name filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match query name, exactly.
- Parameters
qname
: query name to compare on
-
PbiQueryNameFilter
(const std::vector<std::string> &whitelist)¶ Creates a ‘whitelisted’ query name filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: query names to compare on
-
PbiQueryNameFilter
(const PbiQueryNameFilter &other)¶
-
~PbiQueryNameFilter
()¶
-
bool
Accepts
(const PbiRawData &idx, const size_t row) const¶ Performs the actual index lookup.
Most client code should not need to use this method directly.
Private Members
-
std::unique_ptr<PbiQueryNameFilterPrivate>
d_
¶
-
-
struct
PbiQueryStartFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiQueryStartFilter class provides a PbiFilter-compatible filter on query start.
Example:
PbiFilter filter{ PbiQueryStartFilter{3000, Compare::GREATER_THAN} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.QueryStart() > 3000); }
Inherits from PacBio::BAM::internal::BasicDataFilterBase< int32_t, BasicLookupData::Q_START >
-
struct
PbiReadAccuracyFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiReadAccuracyFilter class provides a PbiFilter-compatible filter on read accuracy.
Example:
PbiFilter filter{ PbiReadAccuracyFilter{0.8, Compare::GREATER_THAN_EQUAL} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReadAccuracy() >= 0.8); }
Inherits from PacBio::BAM::internal::BasicDataFilterBase< Accuracy, BasicLookupData::READ_QUALITY >
-
struct
PbiReadGroupFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiReadGroupFilter class provides a PbiFilter-compatible filter on read group.
Example:
// ------------------------- // numeric ID // ------------------------- // single value PbiFilter filter{ PbiReadGroupFilter{ 2458765 } }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReadGroupNumericId() == 2458765); } // whitelist vector<int32_t> whitelist = { 2458765, -32143 }; PbiFilter filter{ PbiReadGroupFilter{whitelist} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReadGroupNumericId() == 2458765 || record.ReadGroupNumericId() == -32143); } // ------------------------- // printable ID // ------------------------- // single value PbiFilter filter{ PbiReadGroupFilter{ "12B33F00" } }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReadGroupId() == "12B33F00"); } // whitelist vector<string> whitelist = { "12B33F00", "123ABC77" }; PbiFilter filter{ PbiReadGroupFilter{whitelist} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReadGroupId() == "12B33F00" || record.ReadGroupId() == "123ABC77"); } // ------------------------- // read group // ------------------------- BamFile file("foo.bam"); BamHeader header = file.Header(); assert(header.ReadGroups().size() > 1); // single value PbiFilter filter{ PbiReadGroupFilter{ header.ReadGroups()[0] } }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReadGroup() == header.ReadGroups()[0]); } // whitelist vector<ReadGroupInfo> whitelist = { header.ReadGroups()[0], header.ReadGroups()[1] }; PbiFilter filter{ PbiReadGroupFilter{whitelist} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReadGroup() == header.ReadGroups()[0] || record.ReadGroup() == header.ReadGroups()[1]); }
Inherits from PacBio::BAM::internal::BasicDataFilterBase< int32_t, BasicLookupData::RG_ID >
Public Functions
-
PbiReadGroupFilter
(const int32_t rgId, const Compare::Type cmp = Compare::EQUAL)¶ Creates a filter on read group (numeric) ID value.
- See
- BamRecord::ReadGroupNumericId
- Parameters
rgId
: numeric read group IDcmp
: compare type
-
PbiReadGroupFilter
(const std::string rgId, const Compare::Type cmp = Compare::EQUAL)¶ Creates a filter on printable read group ID value.
- See
- BamRecord::ReadGroupId
- Parameters
rgId
: read group ID stringcmp
: compare type
-
PbiReadGroupFilter
(const ReadGroupInfo &rg, const Compare::Type cmp = Compare::EQUAL)¶ Creates a filter on read group (object).
- See
- BamRecord::ReadGroup
- Parameters
rg
: read group objectcmp
: compare type
-
PbiReadGroupFilter
(const std::vector<int32_t> &whitelist)¶ Creates a ‘whitelisted’ filter on read group numeric IDs.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: read group IDs to compare on
-
PbiReadGroupFilter
(std::vector<int32_t> &&whitelist)¶ Creates a ‘whitelisted’ filter on read group numeric IDs.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: read group IDs to compare on
-
PbiReadGroupFilter
(const std::vector<std::string> &whitelist)¶ Creates a ‘whitelisted’ filter on read group printable IDs.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: read group ID strings to compare on
-
PbiReadGroupFilter
(std::vector<std::string> &&whitelist)¶ Creates a ‘whitelisted’ filter on read group printable IDs.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: read group ID strings to compare on
-
PbiReadGroupFilter
(const std::vector<ReadGroupInfo> &whitelist)¶ Creates a ‘whitelisted’ filter using read group objects.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: read group objects to compare on
-
PbiReadGroupFilter
(std::vector<ReadGroupInfo> &&whitelist)¶ Creates a ‘whitelisted’ filter using read group objects.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: read group objects to compare on
-
-
struct
PbiReferenceEndFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiReferenceEndFilter class provides a PbiFilter-compatible filter on reference end.
Example:
PbiFilter filter{ PbiReferenceEndFilter{ 2000 } }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReferenceEnd() == 2000); }
Inherits from PacBio::BAM::internal::MappedDataFilterBase< uint32_t, MappedLookupData::T_END >
-
struct
PbiReferenceIdFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiReferenceIdFilter class provides a PbiFilter-compatible filter on reference ID.
Example:
// single value PbiFilter filter{ PbiReferenceIdFilter{ 4 } }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReferenceId() == 4); } // whitelist vector<int32_t> whitelist = { 0, 1 }; PbiFilter filter{ PbiReferenceIdFilter{whitelist} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReferenceId() == 0 || record.ReferenceId() == 1); }
Inherits from PacBio::BAM::internal::MappedDataFilterBase< int32_t, MappedLookupData::T_ID >
Public Functions
-
PbiReferenceIdFilter
(const int32_t tId, const Compare::Type cmp = Compare::EQUAL)¶ Creates a single-value reference ID filter.
- Parameters
tId
: reference ID to compare oncmp
: compare type
-
PbiReferenceIdFilter
(const std::vector<int32_t> &whitelist)¶ Creates a ‘whitelisted’ reference ID filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: reference IDs to compare on
-
PbiReferenceIdFilter
(std::vector<int32_t> &&whitelist)¶ Creates a ‘whitelisted’ reference ID filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: reference IDs to compare on
-
-
struct
PbiReferenceNameFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiReferenceNameFilter class provides a PbiFilter-compatible filter on reference name.
Example:
// single value PbiFilter filter{ PbiReferenceNameFilter{ "chr1" } }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReferenceName() == "chr1"); } // whitelist vector<string> whitelist = { "chr1", "chr5" }; PbiFilter filter{ PbiReferenceNameFilter{whitelist} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReferenceName() == "chr1" || record.ReferenceName() == "chr5"); }
Public Functions
-
PbiReferenceNameFilter
(std::string rname, Compare::Type cmp = Compare::EQUAL)¶ Creates a single-value reference name filter.
- Parameters
rname
: reference ID to compare oncmp
: compare type
-
PbiReferenceNameFilter
(const std::vector<std::string> &whitelist)¶ Creates a ‘whitelisted’ reference name filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: reference names to compare on
-
PbiReferenceNameFilter
(std::vector<std::string> &&whitelist)¶ Creates a ‘whitelisted’ reference name filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: reference names to compare on
-
bool
Accepts
(const PbiRawData &idx, const size_t row) const¶ Performs the actual index lookup.
Most client code should not need to use this method directly.
Private Functions
-
void
Initialize
(const PbiRawData &idx) const¶
-
-
struct
PbiReferenceStartFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiReferenceStartFilter class provides a PbiFilter-compatible filter on reference start.
Example:
PbiFilter filter{ PbiReferenceStartFilter{ 2000 } }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.ReferenceStart() == 2000); }
Inherits from PacBio::BAM::internal::MappedDataFilterBase< uint32_t, MappedLookupData::T_START >
-
struct
PbiZmwFilter
¶ - #include <pbbam/PbiFilterTypes.h>
The PbiZmwFilter class provides a PbiFilter-compatible filter on ZMW hole number.
Example:
// single value PbiFilter filter{ PbiZmwFilter{ 4000 } }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.HoleNumber() == 4000); } // whitelist vector<int32_t> whitelist = { 4000, 8000 }; PbiFilter filter{ PbiZmwFilter{whitelist} }; PbiFilterQuery query(filter); for (const BamRecord& record : query) { assert(record.HoleNumber() == 4000 || record.HoleNumber() == 8000); }
Inherits from PacBio::BAM::internal::BasicDataFilterBase< int32_t, BasicLookupData::ZMW >
Public Functions
-
PbiZmwFilter
(const int32_t zmw, const Compare::Type cmp = Compare::EQUAL)¶ Creates a single-value ZMW hole number filter.
- Parameters
zmw
: value to compare oncmp
: compare type
-
PbiZmwFilter
(const std::vector<int32_t> &whitelist)¶ Creates a ‘whitelisted’ ZMW hole number filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: ZMW hole numbers to compare on
-
PbiZmwFilter
(std::vector<int32_t> &&whitelist)¶ Creates a ‘whitelisted’ ZMW hole number filter.
- Note
- There is no compare type parameter here, it is always Compare::EQUAL. Records will match at least one value from the whitelist, exactly.
- Parameters
whitelist
: ZMW hole numbers to compare on
-
-
struct
-
namespace