vg
tools for working with variation graphs
|
#include <kff.hpp>
Public Types | |
typedef gbwtgraph::Key64::value_type | kmer_type |
Public Member Functions | |
ParallelKFFReader (const std::string &filename) | |
std::vector< std::pair< kmer_type, size_t > > | read (size_t n) |
Public Attributes | |
Kff_reader | reader |
KFF reader. More... | |
std::deque< std::pair< kmer_type, size_t > > | buffer |
Buffer from unused kmers from the latest block. More... | |
std::mutex | mtx |
Mutex for accessing reader and buffer . More... | |
size_t | k |
Length of the kmers. More... | |
size_t | max_kmers_per_block |
Maximum number of kmers per block. More... | |
size_t | data_bytes |
Number of bytes reserved for each kmer count. More... | |
std::uint8_t | encoding [4] |
Encoding used for the kmers. More... | |
kff_recoding_t | recoding |
Recoding from KFF kmers to minimizer index kmers. More... | |
Private Member Functions | |
ParallelKFFReader (const ParallelKFFReader &)=delete | |
ParallelKFFReader & | operator= (const ParallelKFFReader &)=delete |
A wrapper over Kff_reader
that allows reading kmers safely from multiple threads.
typedef gbwtgraph::Key64::value_type vg::ParallelKFFReader::kmer_type |
vg::ParallelKFFReader::ParallelKFFReader | ( | const std::string & | filename | ) |
Creates a new reader for the given file. Throws std::runtime_error
if the file cannot be opened or the sanity checks fail.
|
privatedelete |
|
privatedelete |
std::vector< std::pair< ParallelKFFReader::kmer_type, size_t > > vg::ParallelKFFReader::read | ( | size_t | n | ) |
Reads the next n
kmers and counts from the file. This can be called safely from multiple threads. If the returned vector contains fewer than n
kmers this indicates that the reader has reached the end of the file.
std::deque<std::pair<kmer_type, size_t> > vg::ParallelKFFReader::buffer |
Buffer from unused kmers from the latest block.
size_t vg::ParallelKFFReader::data_bytes |
Number of bytes reserved for each kmer count.
std::uint8_t vg::ParallelKFFReader::encoding[4] |
Encoding used for the kmers.
size_t vg::ParallelKFFReader::k |
Length of the kmers.
size_t vg::ParallelKFFReader::max_kmers_per_block |
Maximum number of kmers per block.
std::mutex vg::ParallelKFFReader::mtx |
Mutex for accessing reader
and buffer
.
Kff_reader vg::ParallelKFFReader::reader |
KFF reader.
kff_recoding_t vg::ParallelKFFReader::recoding |
Recoding from KFF kmers to minimizer index kmers.