#ifndef _PUFFERFISHLOSSY_INDEX_HPP_ #define _PUFFERFISHLOSSY_INDEX_HPP_ #include #include "core/range.hpp" #include "cereal/archives/json.hpp" #include "CanonicalKmer.hpp" #include "CanonicalKmerIterator.hpp" #include "BooPHF.hpp" #include "Util.hpp" #include "PufferfishBaseIndex.hpp" #include "rank9sel.hpp" #include "rank9b.hpp" class PufferfishLossyIndex : public PufferfishBaseIndex { friend PufferfishBaseIndex; using hasher_t = pufferfish::types::hasher_t; using boophf_t = pufferfish::types::boophf_t; using pos_vector_t = PufferfishBaseIndex::pos_vector_t; using seq_vector_t = PufferfishBaseIndex::seq_vector_t; using edge_vector_t = PufferfishBaseIndex::edge_vector_t; using bit_vector_t = PufferfishBaseIndex::bit_vector_t; private: uint32_t k_{0}; uint32_t twok_{0}; uint64_t numKmers_{0}; uint64_t lastSeqPos_{0}; uint64_t numSampledKmers_{0}; bool haveEdges_{false}; bool haveRefSeq_{false}; bool haveEqClasses_{true}; std::vector eqClassIDs_; std::vector> eqLabels_; std::vector refNames_; std::vector refLengths_; std::vector completeRefLengths_; std::vector refExt_; std::vector contigTable_; compact::vector contigOffsets_{16}; uint64_t numContigs_{0}; bit_vector_t contigBoundary_; rank9sel rankSelDict; seq_vector_t seq_; edge_vector_t edge_; uint64_t numDecoys_{0}; uint64_t firstDecoyIndex_{0}; uint64_t firstDecoyEncodedIndex_{0}; //for lossy representation compact::vector presenceVec_; rank9b presenceRank_; pos_vector_t sampledPos_{16}; std::unique_ptr hash_{nullptr}; boophf_t* hash_raw_{nullptr}; public: compact::vector refseq_; std::vector refAccumLengths_; PufferfishLossyIndex(); PufferfishLossyIndex(const std::string& indexPath, pufferfish::util::IndexLoadingOpts opts = pufferfish::util::IndexLoadingOpts()); // Returns a ProjectedHits object that contains all of the // projected reference hits for the given kmer. auto getRefPos(CanonicalKmer& mer) -> pufferfish::util::ProjectedHits; auto getRefPos(CanonicalKmer& mer, pufferfish::util::QueryCache& qc) -> pufferfish::util::ProjectedHits; }; #endif // _PUFFERFISH_INDEX_HPP_