45 SearchStrand
strand = SearchStrand::FORWARD;
75 counts(barcode_pool.size()),
76 use_first(options.use_first)
86 State(
typename SimpleSingleMatch<max_size>::State s,
size_t nvar) : search(std::move(s)), counts(nvar) {}
88 typename SimpleSingleMatch<max_size>::State search;
89 std::vector<int> counts;
93 void process(State& state,
const std::pair<const char*, const char*>& r1,
const std::pair<const char*, const char*>& r2)
const {
95 if (matcher.search_first(r1.first, r1.second - r1.first, state.search)) {
96 ++state.counts[state.search.index];
97 }
else if (matcher.search_first(r2.first, r2.second - r2.first, state.search)) {
98 ++state.counts[state.search.index];
101 bool found1 = matcher.search_best(r1.first, r1.second - r1.first, state.search);
102 auto id1 = state.search.index;
103 auto mm1 = state.search.mismatches;
105 bool found2 = matcher.search_best(r2.first, r2.second - r2.first, state.search);
106 auto id2 = state.search.index;
107 auto mm2 = state.search.mismatches;
109 if (found1 && !found2) {
111 }
else if (!found1 && found2) {
113 }
else if (found1 && found2) {
116 }
else if (mm1 > mm2) {
118 }
else if (id1 == id2) {
126 static constexpr bool use_names =
false;
135 State initialize()
const {
136 return State(matcher.initialize(), counts.size());
139 void reduce(State& s) {
140 matcher.reduce(s.search);
141 for (
size_t i = 0; i < counts.size(); ++i) {
142 counts[i] += s.counts[i];
151 SimpleSingleMatch<max_size> matcher;
152 std::vector<int> counts;
154 bool use_first =
true;
SingleBarcodePairedEnd(const char *template_seq, size_t template_length, const BarcodePool &barcode_pool, const Options &options)
Definition SingleBarcodePairedEnd.hpp:62