Skip to main content

MatchScore

Struct MatchScore 

Source
pub struct MatchScore {
Show 14 fields pub composite: f64, pub confidence: Confidence, pub exact_matches: usize, pub name_length_matches: usize, pub md5_conflicts: usize, pub unmatched: usize, pub match_quality: f64, pub coverage_score: f64, pub order_score: f64, pub order_preserved: bool, pub md5_jaccard: f64, pub name_length_jaccard: f64, pub md5_query_coverage: f64, pub name_length_query_coverage: f64,
}
Expand description

Detailed similarity scores between a query and a reference

Fields§

§composite: f64

Weighted composite score (the primary ranking metric)

§confidence: Confidence

Confidence level derived from score

§exact_matches: usize

Number of contigs with exact match (name+length+MD5 all match)

§name_length_matches: usize

Number of contigs with name+length match but no MD5 available (neutral)

§md5_conflicts: usize

Number of contigs with name+length match but MD5 conflicts (different sequence!)

§unmatched: usize

Number of contigs with no match found

§match_quality: f64

Per-contig match score: (exact + neutral + 0.1*conflicts) / total

§coverage_score: f64

Coverage score: good_matches / reference_contigs

§order_score: f64

Fraction of contigs in correct relative order

§order_preserved: bool

Are matched contigs in the same order?

§md5_jaccard: f64

Jaccard similarity of MD5 sets: |intersection| / |union|

§name_length_jaccard: f64

Jaccard similarity of (normalized_name, length) pairs

§md5_query_coverage: f64

Fraction of query contigs matched by MD5

§name_length_query_coverage: f64

Fraction of query contigs matched by name+length

Implementations§

Source§

impl MatchScore

Source

pub fn calculate(query: &QueryHeader, reference: &KnownReference) -> Self

Calculate match score between query and reference

Uses the new contig-based scoring algorithm:

  • Classifies each query contig as Exact, NameLengthNoMd5, Md5Conflict, or Unmatched
  • Exact and NameLengthNoMd5 get full credit (1.0)
  • Md5Conflict gets heavy penalty (0.1 credit - name is right but sequence is wrong)
  • Unmatched gets no credit

Composite = 70% match_quality + 20% coverage_score + 10% order_score

Source

pub fn calculate_with_weights( query: &QueryHeader, reference: &KnownReference, weights: &ScoringWeights, ) -> Self

Calculate match score with custom scoring weights

Uses the new contig-based scoring algorithm with configurable weights:

  • contig_match_weight: Weight for per-contig match score (default 70%)
  • coverage_weight: Weight for reference coverage (default 20%)
  • order_weight: Weight for contig ordering (default 10%)
  • conflict_penalty: Credit given to MD5 conflicts (default 0.1 = 10%)

Trait Implementations§

Source§

impl Clone for MatchScore

Source§

fn clone(&self) -> MatchScore

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MatchScore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,