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: f64Weighted composite score (the primary ranking metric)
confidence: ConfidenceConfidence level derived from score
exact_matches: usizeNumber of contigs with exact match (name+length+MD5 all match)
name_length_matches: usizeNumber of contigs with name+length match but no MD5 available (neutral)
md5_conflicts: usizeNumber of contigs with name+length match but MD5 conflicts (different sequence!)
unmatched: usizeNumber of contigs with no match found
match_quality: f64Per-contig match score: (exact + neutral + 0.1*conflicts) / total
coverage_score: f64Coverage score: good_matches / reference_contigs
order_score: f64Fraction of contigs in correct relative order
order_preserved: boolAre matched contigs in the same order?
md5_jaccard: f64Jaccard similarity of MD5 sets: |intersection| / |union|
name_length_jaccard: f64Jaccard similarity of (normalized_name, length) pairs
md5_query_coverage: f64Fraction of query contigs matched by MD5
name_length_query_coverage: f64Fraction of query contigs matched by name+length
Implementations§
Source§impl MatchScore
impl MatchScore
Sourcepub fn calculate(query: &QueryHeader, reference: &KnownReference) -> Self
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
NameLengthNoMd5get full credit (1.0) Md5Conflictgets 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
Sourcepub fn calculate_with_weights(
query: &QueryHeader,
reference: &KnownReference,
weights: &ScoringWeights,
) -> Self
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
impl Clone for MatchScore
Source§fn clone(&self) -> MatchScore
fn clone(&self) -> MatchScore
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more