logo
pub struct Scoring<F: MatchFunc> {
    pub gap_open: i32,
    pub gap_extend: i32,
    pub match_fn: F,
    pub match_scores: Option<(i32, i32)>,
    pub xclip_prefix: i32,
    pub xclip_suffix: i32,
    pub yclip_prefix: i32,
    pub yclip_suffix: i32,
}
Expand description

Details of scoring are encapsulated in this structure.

An affine gap score model is used so that the gap score for a length k is: GapScore(k) = gap_open + gap_extend * k

Fields

gap_open: i32gap_extend: i32match_fn: Fmatch_scores: Option<(i32, i32)>xclip_prefix: i32xclip_suffix: i32yclip_prefix: i32yclip_suffix: i32

Implementations

Create new Scoring instance with given gap open, gap extend penalties match and mismatch scores. The clip penalties are set to MIN_SCORE by default

Arguments
  • gap_open - the score for opening a gap (should not be positive)
  • gap_extend - the score for extending a gap (should not be positive)
  • match_score - the score for a match
  • mismatch_score - the score for a mismatch

Create new Scoring instance with given gap open, gap extend penalties and the score function. The clip penalties are set to MIN_SCORE by default

Arguments
  • gap_open - the score for opening a gap (should not be positive)
  • gap_extend - the score for extending a gap (should not be positive)
  • match_fn - function that returns the score for substitutions (see also bio::alignment::pairwise::Scoring)

Sets the prefix and suffix clipping penalties for x to the input value

Arguments
  • penalty - Clipping penalty for x (both prefix and suffix, should not be positive)
use bio::alignment::pairwise::{Scoring, MIN_SCORE};
let scoring = Scoring::from_scores(0, -2, 1, -2).xclip(-5);
assert!(scoring.xclip_prefix == -5);
assert!(scoring.yclip_prefix == MIN_SCORE);
assert!(scoring.xclip_suffix == -5);
assert!(scoring.yclip_suffix == MIN_SCORE);

Sets the prefix clipping penalty for x to the input value

Arguments
  • penalty - Prefix clipping penalty for x (should not be positive)
Example
use bio::alignment::pairwise::{Scoring, MIN_SCORE};
let scoring = Scoring::from_scores(0, -2, 1, -2).xclip_prefix(-5);
assert!(scoring.xclip_prefix == -5);
assert!(scoring.yclip_prefix == MIN_SCORE);
assert!(scoring.xclip_suffix == MIN_SCORE);
assert!(scoring.yclip_suffix == MIN_SCORE);

Sets the suffix clipping penalty for x to the input value

Arguments
  • penalty - Suffix clipping penalty for x (should not be positive)
use bio::alignment::pairwise::{Scoring, MIN_SCORE};
let scoring = Scoring::from_scores(0, -2, 1, -2).xclip_suffix(-5);
assert!(scoring.xclip_prefix == MIN_SCORE);
assert!(scoring.yclip_prefix == MIN_SCORE);
assert!(scoring.xclip_suffix == -5);
assert!(scoring.yclip_suffix == MIN_SCORE);

Sets the prefix and suffix clipping penalties for y to the input value

Arguments
  • penalty - Clipping penalty for y (both prefix and suffix, should not be positive)
use bio::alignment::pairwise::{Scoring, MIN_SCORE};
let scoring = Scoring::from_scores(0, -2, 1, -2).yclip(-5);
assert!(scoring.xclip_prefix == MIN_SCORE);
assert!(scoring.yclip_prefix == -5);
assert!(scoring.xclip_suffix == MIN_SCORE);
assert!(scoring.yclip_suffix == -5);

Sets the prefix clipping penalty for y to the input value

Arguments
  • penalty - Prefix clipping penalty for y (should not be positive)
use bio::alignment::pairwise::{Scoring, MIN_SCORE};
let scoring = Scoring::from_scores(0, -2, 1, -2).yclip_prefix(-5);
assert!(scoring.xclip_prefix == MIN_SCORE);
assert!(scoring.yclip_prefix == -5);
assert!(scoring.xclip_suffix == MIN_SCORE);
assert!(scoring.yclip_suffix == MIN_SCORE);

Sets the suffix clipping penalty for y to the input value

Arguments
  • penalty - Suffix clipping penalty for y (should not be positive)
use bio::alignment::pairwise::{Scoring, MIN_SCORE};
let scoring = Scoring::from_scores(0, -2, 1, -2).yclip_suffix(-5);
assert!(scoring.xclip_prefix == MIN_SCORE);
assert!(scoring.yclip_prefix == MIN_SCORE);
assert!(scoring.xclip_suffix == MIN_SCORE);
assert!(scoring.yclip_suffix == -5);

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.