1#ifndef KAORI_DUAL_BARCODES_PAIRED_END_WITH_DIAGNOSTICS_HPP
2#define KAORI_DUAL_BARCODES_PAIRED_END_WITH_DIAGNOSTICS_HPP
25template<
size_t max_size>
45 const char* template_seq1,
size_t template_length1,
const BarcodePool& barcode_pool1,
46 const char* template_seq2,
size_t template_length2,
const BarcodePool& barcode_pool2,
49 dual_handler(template_seq1, template_length1, barcode_pool1, template_seq2, template_length2, barcode_pool2, options),
63 combopt.strand1 = options.
strand1;
65 combopt.strand2 = options.
strand2;
68 combopt.duplicates = DuplicateAction::FIRST;
69 combopt.random = options.
random;
76 DualBarcodesPairedEnd<max_size> dual_handler;
77 CombinatorialBarcodesPairedEnd<max_size> combo_handler;
85 State(
typename DualBarcodesPairedEnd<max_size>::State ds,
typename CombinatorialBarcodesPairedEnd<max_size>::State cs) : dual_state(std::move(ds)), combo_state(std::move(cs)) {}
90 typename DualBarcodesPairedEnd<max_size>::State dual_state;
91 typename CombinatorialBarcodesPairedEnd<max_size>::State combo_state;
97 State initialize()
const {
98 return State(dual_handler.initialize(), combo_handler.initialize());
101 void reduce(State& s) {
102 dual_handler.reduce(s.dual_state);
103 combo_handler.reduce(s.combo_state);
106 constexpr static bool use_names =
false;
115 void process(State& state,
const std::pair<const char*, const char*>& r1,
const std::pair<const char*, const char*>& r2)
const {
117 if (!dual_handler.process(state.dual_state, r1, r2)) {
118 combo_handler.process(state.combo_state, r1, r2);
131 combo_handler.sort();
140 return dual_handler.get_counts();
148 return combo_handler.get_combinations();
155 return dual_handler.get_total();
162 return combo_handler.get_barcode1_only();
169 return combo_handler.get_barcode2_only();
177template<
size_t max_size>
178using DualBarcodesWithDiagnostics = DualBarcodesPairedEndWithDiagnostics<max_size>;
Process paired-end combinatorial barcodes.
Handler for paired-end combinatorial barcodes.
Definition CombinatorialBarcodesPairedEnd.hpp:29
Handler for dual barcodes with extra diagnostics.
Definition DualBarcodesPairedEndWithDiagnostics.hpp:26
const std::vector< std::array< int, 2 > > & get_combinations() const
Definition DualBarcodesPairedEndWithDiagnostics.hpp:147
const std::vector< int > & get_counts() const
Definition DualBarcodesPairedEndWithDiagnostics.hpp:139
DualBarcodesPairedEndWithDiagnostics(const char *template_seq1, size_t template_length1, const BarcodePool &barcode_pool1, const char *template_seq2, size_t template_length2, const BarcodePool &barcode_pool2, const typename DualBarcodesPairedEnd< max_size >::Options &options)
Definition DualBarcodesPairedEndWithDiagnostics.hpp:44
int get_barcode2_only() const
Definition DualBarcodesPairedEndWithDiagnostics.hpp:168
void sort()
Definition DualBarcodesPairedEndWithDiagnostics.hpp:130
int get_barcode1_only() const
Definition DualBarcodesPairedEndWithDiagnostics.hpp:161
int get_total() const
Definition DualBarcodesPairedEndWithDiagnostics.hpp:154
Namespace for the kaori barcode-matching library.
Definition BarcodePool.hpp:13
Pool of barcode sequences for a variable region.
Definition BarcodePool.hpp:21
Optional parameters for DualBarcodesPairedEnd.
Definition DualBarcodesPairedEnd.hpp:32
int max_mismatches1
Definition DualBarcodesPairedEnd.hpp:42
bool random
Definition DualBarcodesPairedEnd.hpp:71
int max_mismatches2
Definition DualBarcodesPairedEnd.hpp:53
SearchStrand strand2
Definition DualBarcodesPairedEnd.hpp:59
bool use_first
Definition DualBarcodesPairedEnd.hpp:37
SearchStrand strand1
Definition DualBarcodesPairedEnd.hpp:48