vg
tools for working with variation graphs
Public Types | Public Member Functions | Public Attributes | Private Member Functions | List of all members
vg::ParallelKFFReader Class Reference

#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
 
ParallelKFFReaderoperator= (const ParallelKFFReader &)=delete
 

Detailed Description

A wrapper over Kff_reader that allows reading kmers safely from multiple threads.

Member Typedef Documentation

◆ kmer_type

typedef gbwtgraph::Key64::value_type vg::ParallelKFFReader::kmer_type

Constructor & Destructor Documentation

◆ ParallelKFFReader() [1/2]

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.

◆ ParallelKFFReader() [2/2]

vg::ParallelKFFReader::ParallelKFFReader ( const ParallelKFFReader )
privatedelete

Member Function Documentation

◆ operator=()

ParallelKFFReader& vg::ParallelKFFReader::operator= ( const ParallelKFFReader )
privatedelete

◆ read()

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.

Member Data Documentation

◆ buffer

std::deque<std::pair<kmer_type, size_t> > vg::ParallelKFFReader::buffer

Buffer from unused kmers from the latest block.

◆ data_bytes

size_t vg::ParallelKFFReader::data_bytes

Number of bytes reserved for each kmer count.

◆ encoding

std::uint8_t vg::ParallelKFFReader::encoding[4]

Encoding used for the kmers.

◆ k

size_t vg::ParallelKFFReader::k

Length of the kmers.

◆ max_kmers_per_block

size_t vg::ParallelKFFReader::max_kmers_per_block

Maximum number of kmers per block.

◆ mtx

std::mutex vg::ParallelKFFReader::mtx

Mutex for accessing reader and buffer.

◆ reader

Kff_reader vg::ParallelKFFReader::reader

KFF reader.

◆ recoding

kff_recoding_t vg::ParallelKFFReader::recoding

Recoding from KFF kmers to minimizer index kmers.


The documentation for this class was generated from the following files: