Skip to main content

detect_features

Function detect_features 

Source
pub fn detect_features(
    hills: &[Hill],
    config: &FeaturesConfig,
    file: &FileConfig,
) -> Vec<Feature>
Expand description

Detect isotope features from a list of chromatographic hills.

  1. Build an m/z-sorted index of the hills.
  2. Every (seed hill, charge) pair builds an isotope chain by extending upward only (M+1, M+2, …) with chromatographic-cosine filtering (gated by FeaturesConfig.min_chain_cosine); the seed is the monoisotope hypothesis — see build_charge_candidate.
  3. The over-complete candidate pool is resolved non-destructively by resolve_exhaustive: contested hills are claimed by descending isotope log evidence using each candidate’s best-scoring valid prefix. After a conflict, the best remaining free prefix is requeued at equal or lower priority.
  4. Feature structs are built from the accepted candidates.