Skip to main content

score_features

Function score_features 

Source
pub fn score_features(
    features: &[Feature],
    config: &ScoringConfig,
    sulfur_offsets: &[i8],
    model: &IsotopeModel,
    polarity: Polarity,
) -> Vec<ScoredFeature>
Expand description

Score features using averagine theoretical isotope patterns.

For each feature:

  1. Look up theoretical isotope pattern by neutral mass
  2. Try neutron offsets in [offset_min, offset_max]
  3. Score each offset with Bhattacharyya coefficient + zero-offset bonus
  4. Keep best offset; if below min_isotope_score_for_offset, fall back to offset=0