pub struct ScoringMatrix {
pub match_score: i32,
pub mismatch_score: i32,
pub gap_open: i32,
pub gap_extend: i32,
}Expand description
A simple match/mismatch scoring matrix with affine gap penalties.
Suitable for nucleotide alignments where all matches score the same and all mismatches score the same.
Fields§
§match_score: i32§mismatch_score: i32§gap_open: i32§gap_extend: i32Implementations§
Source§impl ScoringMatrix
impl ScoringMatrix
Sourcepub fn new(
match_score: i32,
mismatch_score: i32,
gap_open: i32,
gap_extend: i32,
) -> Result<Self>
pub fn new( match_score: i32, mismatch_score: i32, gap_open: i32, gap_extend: i32, ) -> Result<Self>
Create a new scoring matrix.
§Errors
Returns an error if match_score is not positive, mismatch_score is not
negative, or gap_open/gap_extend are not negative.
Sourcepub fn dna_default() -> Self
pub fn dna_default() -> Self
Default scoring for DNA alignment: +2 match, -1 mismatch, -5 gap open, -2 gap extend.
Sourcepub fn score_pair(&self, a: u8, b: u8) -> i32
pub fn score_pair(&self, a: u8, b: u8) -> i32
Score a pair of bases. Case-insensitive.
Trait Implementations§
Source§impl Clone for ScoringMatrix
impl Clone for ScoringMatrix
Source§fn clone(&self) -> ScoringMatrix
fn clone(&self) -> ScoringMatrix
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 moreSource§impl Debug for ScoringMatrix
impl Debug for ScoringMatrix
Source§impl From<ScoringMatrix> for ScoringScheme
impl From<ScoringMatrix> for ScoringScheme
Source§fn from(m: ScoringMatrix) -> Self
fn from(m: ScoringMatrix) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ScoringMatrix
impl RefUnwindSafe for ScoringMatrix
impl Send for ScoringMatrix
impl Sync for ScoringMatrix
impl Unpin for ScoringMatrix
impl UnsafeUnpin for ScoringMatrix
impl UnwindSafe for ScoringMatrix
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