Skip to main content

koth_core/config/
scoring.rs

1use serde::{Deserialize, Serialize};
2
3use super::OutputFormat;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6#[serde(default, deny_unknown_fields)]
7pub struct ScoringConfig {
8    /// Whether to test the ±1 neutron-offset monoisotope reassignment during
9    /// scoring. `false` (default) tests only offset 0 (no reassignment);
10    /// `true` searches offsets [-1, +1] inclusive.
11    pub isotope_offset_enabled: bool,
12    /// Bonus added to the Bhattacharyya score when offset == 0, to prefer
13    /// the no-reassignment hypothesis when scores are close. Internal only —
14    /// never stored on the feature.
15    pub offset_zero_bonus: f64,
16    /// Features whose best **isotope_score** (Bhattacharyya) is below this
17    /// keep `neutron_offset = 0` (no monoisotopic reassignment). Does not
18    /// affect retention — use `FeaturesConfig.min_isotope_score` /
19    /// `min_cosine_score` / `min_combined_score` for that.
20    pub min_isotope_score_for_offset: f64,
21}
22
23impl Default for ScoringConfig {
24    fn default() -> Self {
25        Self {
26            isotope_offset_enabled: false,
27            offset_zero_bonus: 0.15,
28            min_isotope_score_for_offset: 0.5,
29        }
30    }
31}
32
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(default, deny_unknown_fields)]
35pub struct OutputConfig {
36    /// Output format for hills and features files: "tsv" or "parquet"
37    pub format: OutputFormat,
38}
39
40impl Default for OutputConfig {
41    fn default() -> Self {
42        Self {
43            format: OutputFormat::Tsv,
44        }
45    }
46}