Skip to main content

koth_ms/config/
align.rs

1use serde::{Deserialize, Serialize};
2
3use super::OutputFormat;
4
5/// Output settings for the alignment + LFQ stage.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(default, deny_unknown_fields)]
8pub struct AlignOutputConfig {
9    /// Export the versioned long-format observation and extraction bundle.
10    pub export_long: bool,
11    /// "tsv" or "parquet"
12    pub format: OutputFormat,
13    /// Only write matrix entries with q-value ≤ this threshold (1.0 = keep all)
14    pub max_qvalue: f64,
15    /// Write `decoy_intensity_matrix.tsv` (target-decoy decoy LFQ values).
16    /// Has no effect when `lfq.run_tdc = false`.
17    #[serde(default = "default_export_decoys")]
18    pub export_decoys: bool,
19    /// Write `lfq_details.tsv` — long-format file with one row per
20    /// (feature, run, is_decoy) including scores, RT diff, observed mz/IM.
21    #[serde(default = "default_export_details")]
22    pub export_details: bool,
23}
24
25fn default_export_decoys() -> bool {
26    true
27}
28
29fn default_export_details() -> bool {
30    true
31}
32
33impl Default for AlignOutputConfig {
34    fn default() -> Self {
35        Self {
36            export_long: false,
37            format: OutputFormat::Tsv,
38            max_qvalue: 1.0,
39            export_decoys: default_export_decoys(),
40            export_details: default_export_details(),
41        }
42    }
43}