1#ifndef KAORI_DUAL_BARCODES_PAIRED_END_WITH_DIAGNOSTICS_HPP
2#define KAORI_DUAL_BARCODES_PAIRED_END_WITH_DIAGNOSTICS_HPP
25template<SeqLength max_size_>
65 typename CombinatorialBarcodesPairedEnd<max_size_>::Options combopt;
69 combopt.strand1 = options.
strand1;
71 combopt.strand2 = options.
strand2;
74 combopt.duplicates = DuplicateAction::FIRST;
75 combopt.random = options.
random;
82 DualBarcodesPairedEnd<max_size_> my_dual_handler;
83 CombinatorialBarcodesPairedEnd<max_size_> my_combo_handler;
91 State(
typename DualBarcodesPairedEnd<max_size_>::State ds,
typename CombinatorialBarcodesPairedEnd<max_size_>::State cs) : dual_state(std::move(ds)), combo_state(std::move(cs)) {}
96 typename DualBarcodesPairedEnd<max_size_>::State dual_state;
97 typename CombinatorialBarcodesPairedEnd<max_size_>::State combo_state;
103 State initialize()
const {
104 return State(my_dual_handler.initialize(), my_combo_handler.initialize());
107 void reduce(State& s) {
108 my_dual_handler.reduce(s.dual_state);
109 my_combo_handler.reduce(s.combo_state);
112 constexpr static bool use_names =
false;
121 void process(State& state,
const std::pair<const char*, const char*>& r1,
const std::pair<const char*, const char*>& r2)
const {
123 if (!my_dual_handler.process(state.dual_state, r1, r2)) {
124 my_combo_handler.process(state.combo_state, r1, r2);
138 return my_dual_handler.get_counts();
146 return my_combo_handler.get_combinations();
153 return my_dual_handler.get_total();
160 return my_combo_handler.get_barcode1_only();
167 return my_combo_handler.get_barcode2_only();
175template<SeqLength max_size_>
176using DualBarcodesWithDiagnostics = DualBarcodesPairedEndWithDiagnostics<max_size_>;
Process paired-end combinatorial barcodes.
Pool of barcode sequences.
Definition BarcodePool.hpp:24
Hash a combination of barcode indices.
Definition utils.hpp:286
Handler for dual barcodes with extra diagnostics.
Definition DualBarcodesPairedEndWithDiagnostics.hpp:26
DualBarcodesPairedEndWithDiagnostics(const char *template_seq1, SeqLength template_length1, const BarcodePool &barcode_pool1, const char *template_seq2, SeqLength template_length2, const BarcodePool &barcode_pool2, const typename DualBarcodesPairedEnd< max_size_ >::Options &options)
Definition DualBarcodesPairedEndWithDiagnostics.hpp:43
Count get_barcode1_only() const
Definition DualBarcodesPairedEndWithDiagnostics.hpp:159
Count get_total() const
Definition DualBarcodesPairedEndWithDiagnostics.hpp:152
Count get_barcode2_only() const
Definition DualBarcodesPairedEndWithDiagnostics.hpp:166
const std::unordered_map< std::array< BarcodeIndex, 2 >, Count, CombinationHash< 2 > > & get_combinations() const
Definition DualBarcodesPairedEndWithDiagnostics.hpp:145
const std::vector< Count > & get_counts() const
Definition DualBarcodesPairedEndWithDiagnostics.hpp:137
Namespace for the kaori barcode-matching library.
Definition BarcodePool.hpp:16
std::size_t SeqLength
Definition utils.hpp:37
unsigned long long Count
Definition utils.hpp:67
Optional parameters for DualBarcodesPairedEnd.
Definition DualBarcodesPairedEnd.hpp:32
SearchStrand strand2
Definition DualBarcodesPairedEnd.hpp:59
int max_mismatches1
Definition DualBarcodesPairedEnd.hpp:42
bool use_first
Definition DualBarcodesPairedEnd.hpp:37
SearchStrand strand1
Definition DualBarcodesPairedEnd.hpp:48
bool random
Definition DualBarcodesPairedEnd.hpp:71
int max_mismatches2
Definition DualBarcodesPairedEnd.hpp:53
Utilites for sequence matching.