Search for known barcode sequences.
More...
#include <BarcodeSearch.hpp>
Search for known barcode sequences.
This supports exact and mismatch-aware searches for known sequences. Mismatches may be distributed anywhere along the length of the sequence, see AnyMismatches
for details. Instances of this class use caching to avoid redundant work when a mismatching sequence has been previously encountered.
◆ SimpleBarcodeSearch() [1/2]
kaori::SimpleBarcodeSearch::SimpleBarcodeSearch |
( |
| ) |
|
|
inline |
Default constructor. This is only provided for composition purposes; methods of this class should only be called on properly constructed instance.
◆ SimpleBarcodeSearch() [2/2]
kaori::SimpleBarcodeSearch::SimpleBarcodeSearch |
( |
const BarcodePool & |
barcode_pool, |
|
|
const Options & |
options |
|
) |
| |
|
inline |
- Parameters
-
barcode_pool | Pool of barcode sequences. |
options | Optional parameters for the search. |
◆ initialize()
State kaori::SimpleBarcodeSearch::initialize |
( |
| ) |
const |
|
inline |
Initialize the search state for thread-safe execution.
- Returns
- A new
SeachState()
.
◆ reduce()
void kaori::SimpleBarcodeSearch::reduce |
( |
State & |
state | ) |
|
|
inline |
Incorporate the mismatch cache from state
into the cache for this SimpleBarcodeSearch
instance. This allows regular consolidation of optimizations across threads. On return, the mismatch cache of state
is combined with that of this instance.
- Parameters
-
state | A state object generated by initialize() . Typically this has already been used in search() at least once. |
◆ search() [1/2]
void kaori::SimpleBarcodeSearch::search |
( |
const std::string & |
search_seq, |
|
|
State & |
state |
|
) |
| const |
|
inline |
Search the known sequences in the barcode pool for an input sequence. The number of allowed mismatches is equal to the maximum specified in the constructor.
- Parameters
-
search_seq | The input sequence to use for searching. This is expected to have the same length as the known sequences. |
state | A state object generated by initialize() . On return, state is filled with the details of the best-matching barcode sequence, if any exists. |
◆ search() [2/2]
void kaori::SimpleBarcodeSearch::search |
( |
const std::string & |
search_seq, |
|
|
State & |
state, |
|
|
int |
allowed_mismatches |
|
) |
| const |
|
inline |
Search the known sequences in the barcode pool for an input sequence, with potentially more stringent mismatch requirements. This can improve efficiency in situations where some mismatches have already been consumed by matching the template sequence.
- Parameters
-
search_seq | The input sequence to use for searching. This is expected to have the same length as the known sequences. |
state | A state object generated by initialize() . On return, state is filled with the details of the best-matching barcode sequence, if any exists. |
allowed_mismatches | Allowed number of mismatches. This should not be greater than the maximum specified in the constructor. |
The documentation for this class was generated from the following file: