kaori
A C++ library for barcode extraction and matching
Loading...
Searching...
No Matches
Classes | Functions
kaori Namespace Reference

Namespace for the kaori barcode-matching library. More...

Classes

class  AnyMismatches
 Search for barcodes with mismatches anywhere. More...
 
struct  BarcodePool
 Pool of barcode sequences for a variable region. More...
 
class  CombinatorialBarcodesPairedEnd
 Handler for paired-end combinatorial barcodes. More...
 
class  CombinatorialBarcodesSingleEnd
 Handler for single-end combinatorial barcodes. More...
 
class  DualBarcodesPairedEnd
 Handler for dual barcodes. More...
 
class  DualBarcodesPairedEndWithDiagnostics
 Handler for dual barcodes with extra diagnostics. More...
 
class  DualBarcodesSingleEnd
 Handler for single-end dual barcodes. More...
 
class  DualBarcodesSingleEndWithDiagnostics
 Handler for dual barcodes with extra diagnostics. More...
 
class  FastqReader
 Stream reads from a FASTQ file. More...
 
class  MismatchTrie
 Base class for the mismatch search. More...
 
class  RandomBarcodeSingleEnd
 Handler for single-end random barcodes. More...
 
class  ScanTemplate
 Scan a read sequence for the template sequence. More...
 
class  SegmentedBarcodeSearch
 Search for known barcode sequences with segmented mismatches. More...
 
class  SegmentedMismatches
 Search for barcodes with segmented mismatches. More...
 
class  SimpleBarcodeSearch
 Search for known barcode sequences. More...
 
class  SimpleSingleMatch
 Search for a template with a single variable region. More...
 
class  SingleBarcodePairedEnd
 Handler for paired-end single barcodes. More...
 
class  SingleBarcodeSingleEnd
 Handler for single-end single barcodes. More...
 

Functions

template<class Handler >
void process_single_end_data (byteme::Reader *input, Handler &handler, int num_threads=1, int block_size=100000)
 
template<class Handler >
void process_paired_end_data (byteme::Reader *input1, byteme::Reader *input2, Handler &handler, int num_threads=1, int block_size=100000)
 

Detailed Description

Namespace for the kaori barcode-matching library.

Function Documentation

◆ process_paired_end_data()

template<class Handler >
void kaori::process_paired_end_data ( byteme::Reader *  input1,
byteme::Reader *  input2,
Handler &  handler,
int  num_threads = 1,
int  block_size = 100000 
)

Run a handler for each read in paired-end data, by calling handler.process() on each read pair. It is expected that the results are stored in handler for retrieval by the caller.

Template Parameters
HandlerA class that implements a handler for paired-end data.
Parameters
input1A Reader object containing data from the first FASTQ file in the pair.
input2A Reader object containing data from the second FASTQ file in the pair.
handlerInstance of the Handler class.
num_threadsNumber of threads to use for processing.
block_sizeNumber of reads in each thread.

Handler requirements

The Handler class is expected to implement the following methods:

  • initialize(): this should be a const method that returns a state object (denoted here as having type State, though the exact name may vary). The idea is to store results in the state object for thread-safe execution. The state object should be default-constructible.
  • reduce(State& state): this should merge the results from the state object into the Handler instance. This will be called in a serial section and does not have to be thread-safe.

The Handler should have a static constexpr variable use_names, indicating whether or not names should be passed to the process() method.

If use_names is false, the Handler class should implement:

  • process(State& state, const std::pair<const char*, const char*>& seq1, const std::pair<const char*, const char*>& seq2): this should be a const method that processes the paired reads in seq1 and seq2, and stores its results in state. seq1 and seq2 will contain pointers to the start and one-past-the-end of the sequences of the paired reads.

Otherwise, if use_names is true, the class should implement:

  • process(State& state, const std::pair<const char*, const char*>& name1, const std::pair<const char*, const char*>& seq1, const std::pair<const char*, const char*>& name2, const std::pair<const char*, const char*>& seq2): this should be a const method that processes the paired reads in seq1 and seq2, and stores its results in state. name1 and name2 will contain pointers to the start and one-past-the-end of the read names. seq1 and seq2 will contain pointers to the start and one-past-the-end of the read sequences.

◆ process_single_end_data()

template<class Handler >
void kaori::process_single_end_data ( byteme::Reader *  input,
Handler &  handler,
int  num_threads = 1,
int  block_size = 100000 
)

Run a handler for each read in single-end data. This is done by calling handler.process() on each read. It is expected that the results are stored in handler for retrieval by the caller.

Template Parameters
HandlerA class that implements a handler for single-end data.
Parameters
inputA Reader object containing data from a single-end FASTQ file.
handlerInstance of the Handler class.
num_threadsNumber of threads to use for processing.
block_sizeNumber of reads in each thread.

Handler requirements

The Handler class is expected to implement the following methods:

  • initialize(): this should be a const method that returns a state object (denoted here as having type State, though the exact name may vary). The idea is to store results in the state object for thread-safe execution. The state object should be default-constructible.
  • reduce(State& state): this should merge the results from the state object into the Handler instance. This will be called in a serial section and does not have to be thread-safe.

The Handler should have a static constexpr variable use_names, indicating whether or not names should be passed to the process() method.

If use_names is false, the Handler class should implement:

  • process(State& state, const std::pair<const char*, const char*>& seq): this should be a const method that processes the read in seq and stores its results in state. seq will contain pointers to the start and one-past-the-end of the read sequence.

Otherwise, if use_names is true, the class should implement:

  • process(State& state, const std::pair<const char*, const char*>& name, const std::pair<const char*, const char*>& seq): this should be a const method that processes the read in seq and stores its results in state. name will contain pointers to the start and one-past-the-end of the read name. seq will contain pointers to the start and one-past-the-end of the read sequence.