pub struct BarcodeRegex { /* private fields */ }Implementations§
Source§impl BarcodeRegex
impl BarcodeRegex
Sourcepub fn new(pattern: &str, max_error: usize) -> Result<Self, Error>
pub fn new(pattern: &str, max_error: usize) -> Result<Self, Error>
Creates BarcodeRegex instance
Example
use barkit_extract::pattern::BarcodeRegex;
let barcode_regex = BarcodeRegex::new("^atgc(?<UMI>[ATGCN]{6})", 1);Sourcepub fn get_captures<'a>(
&self,
read_seq: &'a [u8],
) -> Result<Captures<'a>, Error>
pub fn get_captures<'a>( &self, read_seq: &'a [u8], ) -> Result<Captures<'a>, Error>
Captures barcodes in read sequence
Example
use barkit_extract::pattern::BarcodeRegex;
let barcode_regex = BarcodeRegex::new("^atgc(?<UMI>[ATGCN]{6})", 1).unwrap();
assert_eq!(
b"NNNNNN",
barcode_regex
.get_captures(b"ATGCNNNNNNCCC")
.unwrap()
.name("UMI")
.unwrap()
.as_bytes()
);pub fn get_barcode_types(&self) -> Vec<BarcodeType>
Trait Implementations§
Source§impl Clone for BarcodeRegex
impl Clone for BarcodeRegex
Source§fn clone(&self) -> BarcodeRegex
fn clone(&self) -> BarcodeRegex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BarcodeRegex
impl RefUnwindSafe for BarcodeRegex
impl Send for BarcodeRegex
impl Sync for BarcodeRegex
impl Unpin for BarcodeRegex
impl UnsafeUnpin for BarcodeRegex
impl UnwindSafe for BarcodeRegex
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