pub enum Strategy {
Identity,
Edit,
Adjacency,
Paired,
}Expand description
The UMI assignment strategy
Determines how reads are grouped based on their UMI sequences. Each strategy makes different tradeoffs between speed, error tolerance, and grouping behavior.
Variants§
Identity
Only reads with identical UMI sequences are grouped together
The fastest strategy but provides no error correction. Two UMIs that differ by even a single base will be assigned to different molecules. Best used when UMI quality is very high or when maximum specificity is required.
Edit
Cluster reads based on mismatches between UMIs
Groups UMIs that are within a specified edit distance. Uses a simple clustering algorithm that can merge groups transitively. For example, if A matches B and B matches C, all three will be grouped together even if A and C differ by more than the threshold. More permissive than adjacency method.
Adjacency
Directed adjacency method from umi_tools that allows errors with count gradient
Implements the directed adjacency graph method where high-abundance UMIs can “capture” lower-abundance UMIs that are within edit distance. A UMI can only be assigned to another UMI if its count is less than half of the parent’s count. This prevents over-correction and is more conservative than the simple edit distance method.
Paired
Similar to adjacency but for paired UMIs (A-B related to B-A)
Extends the adjacency method for paired UMIs (e.g., “ACGT-TGCA”). Treats A-B and B-A as related molecules from opposite strands of duplex sequencing. Assigns strand-specific molecule IDs with /A and /B suffixes to enable duplex consensus calling.
Implementations§
Source§impl Strategy
impl Strategy
Sourcepub fn new_assigner(&self, edits: u32) -> Box<dyn UmiAssigner>
pub fn new_assigner(&self, edits: u32) -> Box<dyn UmiAssigner>
Sourcepub fn new_assigner_with_threads(
&self,
edits: u32,
threads: usize,
) -> Box<dyn UmiAssigner>
pub fn new_assigner_with_threads( &self, edits: u32, threads: usize, ) -> Box<dyn UmiAssigner>
Sourcepub fn new_assigner_full(
&self,
edits: u32,
threads: usize,
index_threshold: usize,
) -> Box<dyn UmiAssigner>
pub fn new_assigner_full( &self, edits: u32, threads: usize, index_threshold: usize, ) -> Box<dyn UmiAssigner>
Create a new UMI assigner with all parameters specified
§Arguments
edits- Maximum number of mismatches allowed between UMIsthreads- Number of threads to use (only applies to Adjacency and Paired strategies)index_threshold- Minimum UMIs per position to use N-gram/BK-tree index
§Returns
A boxed trait object implementing the UmiAssigner trait
§Panics
Panics if edits is non-zero with the Identity strategy.
Trait Implementations§
impl Copy for Strategy
Auto Trait Implementations§
impl Freeze for Strategy
impl RefUnwindSafe for Strategy
impl Send for Strategy
impl Sync for Strategy
impl Unpin for Strategy
impl UnsafeUnpin for Strategy
impl UnwindSafe for Strategy
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
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>
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>
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