PbiIndexPrivate::PbiIndexPrivate(const PbiRawData& rawIndex) : filename_(rawIndex.Filename()) , version_(rawIndex.Version()) , sections_(rawIndex.FileSections()) , numReads_(rawIndex.NumReads()) , basicData_(rawIndex.BasicData()) , mappedData_(rawIndex.MappedData()) , referenceData_(rawIndex.ReferenceData()) , barcodeData_(rawIndex.BarcodeData()) { }
void PbiReferenceNameFilter::Initialize(const PbiRawData& idx) const { const auto pbiFilename = idx.Filename(); const auto bamFilename = pbiFilename.substr(0, pbiFilename.length() - 4); const auto bamFile = BamFile{ bamFilename }; // single-value if (rnameWhitelist_ == boost::none) { const auto tId = bamFile.ReferenceId(rname_); subFilter_ = PbiReferenceIdFilter{ tId, cmp_ }; } // multi-value whitelist else { subFilter_ = PbiFilter(PbiFilter::UNION); for (const auto& rname : rnameWhitelist_.get()) subFilter_.Add(PbiReferenceIdFilter{ bamFile.ReferenceId(rname) }); } initialized_ = true; }