1#ifndef KAORI_DUAL_BARCODES_SINGLE_END_WITH_DIAGNOSTICS_HPP
2#define KAORI_DUAL_BARCODES_SINGLE_END_WITH_DIAGNOSTICS_HPP
25template<
size_t max_size,
size_t num_variable>
37 const char* template_seq,
38 size_t template_length,
39 const std::vector<BarcodePool>& barcode_pools,
42 dual_handler(template_seq, template_length, barcode_pools, options),
44 combo_handler(template_seq, template_length, barcode_pools,
60 DualBarcodesSingleEnd<max_size> dual_handler;
61 CombinatorialBarcodesSingleEnd<max_size, num_variable> combo_handler;
69 State(
typename DualBarcodesSingleEnd<max_size>::State ds,
typename CombinatorialBarcodesSingleEnd<max_size, num_variable>::State cs) : dual_state(std::move(ds)), combo_state(std::move(cs)) {}
74 typename DualBarcodesSingleEnd<max_size>::State dual_state;
75 typename CombinatorialBarcodesSingleEnd<max_size, num_variable>::State combo_state;
81 State initialize()
const {
82 return State(dual_handler.initialize(), combo_handler.initialize());
85 void reduce(State& s) {
86 dual_handler.reduce(s.dual_state);
87 combo_handler.reduce(s.combo_state);
90 constexpr static bool use_names =
false;
99 void process(State& state,
const std::pair<const char*, const char*>& x)
const {
101 if (!dual_handler.process(state.dual_state, x)) {
102 combo_handler.process(state.combo_state, x);
115 combo_handler.sort();
124 return dual_handler.get_counts();
132 return combo_handler.get_combinations();
139 return dual_handler.get_total();
Process single-end combinatorial barcodes.
Process single-end dual barcodes.
Handler for dual barcodes with extra diagnostics.
Definition DualBarcodesSingleEndWithDiagnostics.hpp:26
DualBarcodesSingleEndWithDiagnostics(const char *template_seq, size_t template_length, const std::vector< BarcodePool > &barcode_pools, const typename DualBarcodesSingleEnd< max_size >::Options &options)
Definition DualBarcodesSingleEndWithDiagnostics.hpp:36
int get_total() const
Definition DualBarcodesSingleEndWithDiagnostics.hpp:138
const std::vector< std::array< int, num_variable > > & get_combinations() const
Definition DualBarcodesSingleEndWithDiagnostics.hpp:131
const std::vector< int > & get_counts() const
Definition DualBarcodesSingleEndWithDiagnostics.hpp:123
void sort()
Definition DualBarcodesSingleEndWithDiagnostics.hpp:114
Namespace for the kaori barcode-matching library.
Definition BarcodePool.hpp:13
Optional parameters for CombinatorialBarcodeSingleEnd.
Definition CombinatorialBarcodesSingleEnd.hpp:36
SearchStrand strand
Definition CombinatorialBarcodesSingleEnd.hpp:50
int max_mismatches
Definition CombinatorialBarcodesSingleEnd.hpp:40
bool use_first
Definition CombinatorialBarcodesSingleEnd.hpp:45
DuplicateAction duplicates
Definition CombinatorialBarcodesSingleEnd.hpp:55
Optional parameters for DualBarcodeSingleEnd.
Definition DualBarcodesSingleEnd.hpp:36
SearchStrand strand
Definition DualBarcodesSingleEnd.hpp:50
bool use_first
Definition DualBarcodesSingleEnd.hpp:45
int max_mismatches
Definition DualBarcodesSingleEnd.hpp:40