Base class for the mismatch search.
More...
#include <MismatchTrie.hpp>
Base class for the mismatch search.
Given a (typically read-derived) sequence, this class will perform a mismatch-aware search to a pool of known barcode sequences. It will then return the barcode with the fewest mismatches to the input sequence. Any number of mismatches are supported; subclasses will decide how the mismatches can be distributed throughout the length of the sequence.
◆ MismatchTrie() [1/2]
kaori::MismatchTrie::MismatchTrie |
( |
| ) |
|
|
inline |
Default constructor. This is only provided to enable composition, the resulting object should not be used until it is copy-assigned to a properly constructed instance.
◆ MismatchTrie() [2/2]
kaori::MismatchTrie::MismatchTrie |
( |
size_t |
barcode_length, |
|
|
DuplicateAction |
duplicates |
|
) |
| |
|
inline |
- Parameters
-
barcode_length | Length of the barcodes in the pool. |
duplicates | How duplicate sequences across add() calls should be handled. |
◆ add()
AddStatus kaori::MismatchTrie::add |
( |
const char * |
barcode_seq | ) |
|
|
inline |
- Parameters
-
[in] | barcode_seq | Pointer to a character array containing a barcode sequence. The array should have length equal to get_length() and should only contain IUPAC nucleotides or their lower-case equivalents (excepting U or gap characters). |
- Returns
- The barcode sequence is added to the trie. The index of the newly added sequence is defined as the number of sequences that were previously added. The status of the addition is returned.
◆ get_length()
size_t kaori::MismatchTrie::get_length |
( |
| ) |
const |
|
inline |
- Returns
- The length of the barcode sequences.
◆ optimize()
void kaori::MismatchTrie::optimize |
( |
| ) |
|
|
inline |
Attempt to optimize the trie for more cache-friendly look-ups. This is not necessary if sorted sequences are supplied in add()
.
◆ size()
int kaori::MismatchTrie::size |
( |
| ) |
const |
|
inline |
- Returns
- The number of barcode sequences added.
◆ STATUS_AMBIGUOUS
constexpr int kaori::MismatchTrie::STATUS_AMBIGUOUS = -2 |
|
staticconstexpr |
Ambiguous match to two or more known barcodes.
◆ STATUS_MISSING
constexpr int kaori::MismatchTrie::STATUS_MISSING = -1 |
|
staticconstexpr |
No match to a known barcode.
The documentation for this class was generated from the following file: