pub struct BarcodeMatcher { /* private fields */ }Expand description
The struct responsible for matching barcodes to a Vec of sample barcodes.
Implementations§
Source§impl BarcodeMatcher
impl BarcodeMatcher
Sourcepub fn new(
sample_barcodes: &[&str],
max_mismatches: u8,
min_mismatch_delta: u8,
use_cache: bool,
) -> Self
pub fn new( sample_barcodes: &[&str], max_mismatches: u8, min_mismatch_delta: u8, use_cache: bool, ) -> Self
Instantiates a new BarcodeMatcher struct. Checks that the sample barcodes vector is not
empty and that none of the barcodes provided are the empty string.
§Panics
- Will panic if provided an empty vec of sample barcodes.
- Will panic if any provided barcode is length zero.
Sourcepub fn assign(&mut self, read_bases: &[u8]) -> Option<BarcodeMatch>
pub fn assign(&mut self, read_bases: &[u8]) -> Option<BarcodeMatch>
Assigns the barcode that best matches the provided read_bases, using internal caching
if configured to do so and skipping calculation for reads that cannot match any barcode (
due to having too many no-called bases).
Trait Implementations§
Source§impl Clone for BarcodeMatcher
impl Clone for BarcodeMatcher
Source§fn clone(&self) -> BarcodeMatcher
fn clone(&self) -> BarcodeMatcher
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BarcodeMatcher
impl RefUnwindSafe for BarcodeMatcher
impl Send for BarcodeMatcher
impl Sync for BarcodeMatcher
impl Unpin for BarcodeMatcher
impl UnwindSafe for BarcodeMatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more