pub struct BarcodePattern { /* private fields */ }Implementations§
Source§impl BarcodePattern
impl BarcodePattern
pub fn new(pattern: &str, max_error: &usize) -> Result<Self, Error>
Sourcepub fn get_sequence_with_errors(
&self,
sequence: &str,
) -> Result<Vec<String>, Error>
pub fn get_sequence_with_errors( &self, sequence: &str, ) -> Result<Vec<String>, Error>
Generates sequences with errors that may occur during amplification.
§Example
use barkit_extract::pattern::BarcodePattern;
let barcode_pattern = BarcodePattern::new("^atgc(?<UMI>[ATGCN]{12})", &1).unwrap();
let sequences_with_errors = barcode_pattern.get_sequence_with_errors("ATGC").unwrap();
assert_eq!(vec!["ATG.", "AT.C", "A.GC", ".TGC"], sequences_with_errors);Sourcepub fn get_pattern_with_errors(&self) -> Result<String, Error>
pub fn get_pattern_with_errors(&self) -> Result<String, Error>
Returns regex pattern with PCR errors.
§Example
use barkit_extract::pattern::BarcodePattern;
let barcode_pattern = BarcodePattern::new("^atgc(?<UMI>[ATGCN]{12})", &1).unwrap();
let pattern_with_pcr_errors = barcode_pattern.get_pattern_with_errors().unwrap();
assert_eq!("^(ATG.|AT.C|A.GC|.TGC)(?<UMI>[ATGCN]{12})", pattern_with_pcr_errors);Auto Trait Implementations§
impl Freeze for BarcodePattern
impl RefUnwindSafe for BarcodePattern
impl Send for BarcodePattern
impl Sync for BarcodePattern
impl Unpin for BarcodePattern
impl UnsafeUnpin for BarcodePattern
impl UnwindSafe for BarcodePattern
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> 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