pub struct GenusClassifier { /* private fields */ }Expand description
Minimap2-based genus classifier using flanking sequence alignment.
Classifies source genus by aligning extracted flanking sequences against reference flanking sequences in the database.
Implementations§
Source§impl GenusClassifier
impl GenusClassifier
Sourcepub fn new<P: AsRef<Path>>(
db_path: P,
minimap2_path: &str,
min_identity: f64,
min_align_len: usize,
max_flanking: usize,
plasmid_contigs_path: Option<&Path>,
species_identity: f64,
species_map_path: Option<&Path>,
plasmid_hi: f64,
plasmid_lo: f64,
) -> Result<Self>
pub fn new<P: AsRef<Path>>( db_path: P, minimap2_path: &str, min_identity: f64, min_align_len: usize, max_flanking: usize, plasmid_contigs_path: Option<&Path>, species_identity: f64, species_map_path: Option<&Path>, plasmid_hi: f64, plasmid_lo: f64, ) -> Result<Self>
Creates a new genus classifier.
§Arguments
db_path- Path to flanking database (.fdb)minimap2_path- Path to minimap2 executablemin_identity- Minimum alignment identity (0-1)min_align_len- Minimum alignment length in bpmax_flanking- Maximum flanking length to extract
Sourcepub fn classify_batch(
&mut self,
positions: &[ArgPosition],
threads: usize,
) -> Result<Vec<GenusResult>>
pub fn classify_batch( &mut self, positions: &[ArgPosition], threads: usize, ) -> Result<Vec<GenusResult>>
Classifies genus for multiple ARG positions.
Processes each position sequentially to avoid temporary file conflicts.
Sourcepub fn classify_single(
&mut self,
pos: &ArgPosition,
threads: usize,
) -> Result<GenusResult>
pub fn classify_single( &mut self, pos: &ArgPosition, threads: usize, ) -> Result<GenusResult>
Classifies genus for a single ARG position.
§Algorithm
- Extract flanking sequences from contig
- Write query and reference FASTA files
- Run minimap2 alignment
- Parse PAF and score genus candidates
- Return top genus with confidence metrics
Auto Trait Implementations§
impl Freeze for GenusClassifier
impl RefUnwindSafe for GenusClassifier
impl Send for GenusClassifier
impl Sync for GenusClassifier
impl Unpin for GenusClassifier
impl UnsafeUnpin for GenusClassifier
impl UnwindSafe for GenusClassifier
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