1#ifndef KAORI_BARCODE_POOL_HPP
2#define KAORI_BARCODE_POOL_HPP
36 BarcodePool(std::vector<const char*> barcode_pool, std::size_t barcode_length) : my_pool(std::move(barcode_pool)), my_length(barcode_length) {}
43 if (barcode_pool.size()) {
44 my_length = barcode_pool.front().size();
45 my_pool.reserve(barcode_pool.size());
46 for (
const auto& x : barcode_pool) {
47 if (x.size() != my_length) {
48 throw std::runtime_error(
"sequences for a given variable region should be of a constant length");
50 my_pool.push_back(x.c_str());
56 std::vector<const char*> my_pool;
57 std::size_t my_length = 0;
63 const std::vector<const char*>&
pool()
const {
78 return my_pool.size();
Pool of barcode sequences.
Definition BarcodePool.hpp:24
const char * operator[](BarcodeIndex i) const
Definition BarcodePool.hpp:85
const std::vector< const char * > & pool() const
Definition BarcodePool.hpp:63
SeqLength length() const
Definition BarcodePool.hpp:70
BarcodePool(std::vector< const char * > barcode_pool, std::size_t barcode_length)
Definition BarcodePool.hpp:36
BarcodeIndex size() const
Definition BarcodePool.hpp:77
BarcodePool(const std::vector< std::string > &barcode_pool)
Definition BarcodePool.hpp:42
Namespace for the kaori barcode-matching library.
Definition BarcodePool.hpp:16
std::size_t SeqLength
Definition utils.hpp:37
std::vector< constchar * >::size_type BarcodeIndex
Definition utils.hpp:43
Utilites for sequence matching.