pub struct FileConfig {Show 41 fields
pub mz_tolerance: f64,
pub mz_tolerance_type: ToleranceType,
pub im_tolerance: f64,
pub im_tolerance_type: ImToleranceType,
pub global_min_mz: f64,
pub global_max_mz: f64,
pub intensity_coverage: f64,
pub n_threads: Option<usize>,
pub bruker_filter_mz_half_width: u32,
pub bruker_filter_max_internal_gap: usize,
pub polarity: Polarity,
pub bruker_filter_min_feature_length: usize,
pub bruker_filter_min_window_intensity: u64,
pub bruker_filter_min_feature_intensity: u64,
pub bruker_filter_num_iterations: usize,
pub bruker_watershed_box_scan: u32,
pub bruker_watershed_box_mz_idx: u32,
pub bruker_watershed_min_seed_intensity: u64,
pub bruker_watershed_min_centroid_total: u64,
pub bruker_watershed_max_tof_offset: u32,
pub bruker_noise_sigma: Option<f64>,
pub bruker_mobility_scale: MobilityScale,
pub bruker_streaming: bool,
pub bruker_halo: bool,
pub bruker_halo_peak_fraction: f64,
pub bruker_halo_mz_idx_half_width: u32,
pub bruker_halo_scan_half_width: usize,
pub bruker_ms1_polygon: bool,
pub bruker_ms1_polygon_mz_pad: f64,
pub bruker_ms1_polygon_im_pad: f64,
pub bruker_ms1_polygon_overlap: bool,
pub bruker_ms1_polygon_overlap_reach: f64,
pub noise_filter_sigma: Option<f64>,
pub decoy_mode: bool,
pub ms2_hills_enabled: bool,
pub mz_recalibration: bool,
pub mz_recalibration_mz_bins: usize,
pub mz_recalibration_rt_bins: usize,
pub mz_recalibration_min_samples: usize,
pub mz_recalibration_tol_sigma_mult: f64,
pub mz_recalibration_tol_floor_ppm: f64,
}Expand description
File-reading and shared tolerance settings.
Tolerances defined here are used by both hill detection and feature finding.
Fields§
§mz_tolerance: f64m/z tolerance (shared by hills and features stages)
mz_tolerance_type: ToleranceType“ppm” or “da”
im_tolerance: f64Ion mobility tolerance (shared by hills and features stages)
im_tolerance_type: ImToleranceType“relative” (fraction of IM value) or “absolute” (1/K0 units)
global_min_mz: f64Discard peaks below this m/z. Defaults to 0.0 (no lower bound).
global_max_mz: f64Discard peaks above this m/z. Defaults to +inf (no upper bound).
intensity_coverage: f64Fraction of total hill intensity to retain (0.0–1.0). 1.0 = keep all.
n_threads: Option<usize>Number of threads (None = use all available CPUs)
bruker_filter_mz_half_width: u32Bruker vertical-IM filter: column half-width in TOF-index units. The filter scans each TOF column over the IM (scan) axis looking for long vertical streaks of signal; this width sets how many TOF indices to the left/right of each column are summed into the column profile.
bruker_filter_max_internal_gap: usizeBruker vertical-IM filter: maximum consecutive empty scans tolerated inside a kept run (morphological-close radius). Default 1.
polarity: PolarityIon polarity of the acquisition, which sets how a neutral mass is
recovered from an observed m/z: "positive" (the default, M + zH) or
"negative" (M − zH).
Peptides are acquired in positive mode. Nucleic acids are acquired in
negative mode, and getting this wrong shifts every reported massCalib
by 2·z·1.00728 Da, which is 8 Da on a 4-charged oligonucleotide — large
enough to defeat any downstream identification. koth does not read the
polarity out of the file; set it alongside [features] isotope_model.
bruker_filter_min_feature_length: usizeBruker vertical-IM filter: minimum run span (gap-inclusive) in scans for a column feature to survive. Default 5.
bruker_filter_min_window_intensity: u64Bruker vertical-IM filter: per-scan summed-intensity floor for a scan to count as “occupied” in the column profile. 0 = keep every nonzero scan. Default 0.
bruker_filter_min_feature_intensity: u64Bruker vertical-IM filter: total summed intensity over the kept span (including sub-threshold cells inside gaps) required to keep a run. 0 = no floor. Default 0.
bruker_filter_num_iterations: usizeBruker vertical-IM filter: how many times to re-apply the filter to its own survivors. Each pass is strictly more aggressive. Default 1.
bruker_watershed_box_scan: u32Bruker watershed centroider: nearest-neighbour reach on the scan axis (scans). Two points farther apart than this on either axis cannot join the same group. Default 10.
bruker_watershed_box_mz_idx: u32Bruker watershed centroider: nearest-neighbour reach on the TOF axis (TOF indices). Default 3.
bruker_watershed_min_seed_intensity: u64Bruker watershed centroider: intensity floor for promoting an orphan (point with no in-box neighbour) to a new seed. Below this it is dropped without claiming territory. Default 0.
bruker_watershed_min_centroid_total: u64Bruker watershed centroider: drop final centroids whose summed group intensity is below this floor. Default 0.
bruker_watershed_max_tof_offset: u32Bruker watershed centroider: hard cap on how far (in TOF-index units) any member of a group can sit from that group’s seed. Prevents a long follower chain from creeping past the real peak edge. Default 10.
bruker_noise_sigma: Option<f64>Per-frame iterative MAD noise filter applied to the centroided peaks
before the Bruker reader emits a Spectrum. Same algorithm as
noise_filter_sigma (median + sigma * 1.4826 * MAD of the noise
floor, found by iterative sigma-clipping). None (default) disables.
Independent of noise_filter_sigma, which runs later on every spectrum
(from any input format) during hill detection. Typical value: 3.0.
bruker_mobility_scale: MobilityScale1/K0 scale for Bruker .d input. "calibrated" (default since 0.10.0)
converts each scan number with the run’s acquisition calibration
(TimsCalibration in analysis.tdf), matching Bruker’s timsdata SDK,
DataAnalysis and SDK-based tools. "linear" restores the straight line
between the acquisition-range bounds that koth used up to 0.9.0 (it can
be off by ~0.03 1/K0, about 2%). The conversion happens per centroid,
before hills are built. No effect on mzML or Thermo input. The streaming
path’s dnoise MS1 polygon gate (bruker_ms1_polygon) uses the same scale.
bruker_streaming: boolUse the in-process dnoise streaming API instead of the local two-stage
reader. When true, each raw frame is run through dnoise’s configured
stages (vertical-IM filter -> optional horizontal halo -> optional MS1
polygon -> watershed) in a single pass with no denoised .d written to
disk. When false (default), the historical local path runs (vertical
filter + watershed only, no halo/polygon) — this is the paper’s validated
pipeline. This flag selects preprocessing, not spectrum buffering:
both modes stream MS1 spectra into hill detection.
bruker_halo: boolStreaming path only: apply dnoise’s horizontal-halo filter after the
vertical filter (removes the weak m/z halo flanking bright ions). Default
true (matches the standalone dnoise MS1 pipeline). No effect unless
bruker_streaming is set.
bruker_halo_peak_fraction: f64Streaming halo: drop a peak below this fraction of the off-column box-max reference. Default 0.15.
bruker_halo_mz_idx_half_width: u32Streaming halo: reference-box half-width along the TOF index. Default 80.
bruker_halo_scan_half_width: usizeStreaming halo: reference-box half-width along the ion-mobility scan axis. Default 2.
bruker_ms1_polygon: boolStreaming path only: apply dnoise’s ddaPASEF MS1 selection-polygon gate, dropping MS1 points outside the run’s IMS PolygonFilter — the (m/z, 1/K0) region the acquisition method restricts precursor selection to. Signal outside it was never a fragmentation candidate (background, the singly-charged hump, out-of-range ions).
Auto-detected: a no-op on diaPASEF and on any run that stores no polygon,
so enabling it cannot fail on data that has none. Default false, which
matches dnoise’s own default and leaves every existing config’s output
byte-identical. No effect unless bruker_streaming is set.
bruker_ms1_polygon_mz_pad: f64Polygon gate: m/z leniency added to each side of the polygon interior, in Th (m/z units). Isotopes run to higher m/z, so a pad keeps an edge precursor’s envelope intact. Default 0.0 (the literal polygon). koth always passes this value to dnoise, so dnoise 0.5’s own default pad (3.0 Th) does not apply.
bruker_ms1_polygon_im_pad: f64Polygon gate: ion-mobility leniency added to each side, in 1/K0. Default 0.0 (the literal polygon); dnoise 0.5’s own default (0.015) does not apply.
bruker_ms1_polygon_overlap: boolPolygon gate: keep a whole MS1 feature when any of its points lies
inside the (padded) polygon, instead of gating point by point. Maps onto
dnoise’s Ms1PolygonParams::overlap. Default false: koth gates point
by point, because it builds features from these points itself, and
keeping whole overlapping features can pull in clouds the polygon was
meant to exclude (such as the singly-charged hump) when the polygon’s
shape is not known. Opt in only after checking the run’s polygon.
bruker_ms1_polygon_overlap_reach: f64Deprecated, ignored. dnoise 0.4 cut a feature kept in overlap mode at
this distance (1/K0) beyond the mobility range of its inside points;
dnoise 0.5 removed the parameter and keeps the whole feature (the old
0.0, unlimited). Still parsed so existing configs load; koth-ms logs a
warning when overlap mode is on and this is not 0.0.
noise_filter_sigma: Option<f64>Per-scan iterative sigma-clipping noise filter. When set, peaks whose
intensity falls below median + sigma * (1.4826 * MAD) of the estimated
noise floor are discarded before hill detection.
None (default) disables the filter; a typical starting value is 3.0.
decoy_mode: boolDecoy mode: shuffle MS1 spectra into a random order before hill and feature finding. Destroys the chromatographic structure while preserving the per-scan peak distributions, producing a null (decoy) feature set.
ms2_hills_enabled: boolIf true, additionally detect MS2 hills (one set of hills per precursor
isolation window) from DIA mzML or diaPASEF inputs. Written to
hills_ms2.{ext}. DDA inputs produce no MS2 hills.
mz_recalibration: boolEnable ID-free isotope-consistency m/z recalibration. A pass-1 feature
detection collects the signed ppm deviation of every adjacent
isotope-hill spacing from its theoretical neutron_mass / z step and
bins those residuals over (m/z, RT). Pass 2 shifts the expected
isotope position during chain extension by the learned per-region
median offset, so isotope hills are searched for at their recalibrated
location. Skipped in decoy mode (shuffled spectra carry no real signal)
and when too few isotope-spacing samples are collected. Default off.
When enabled, the fixed isotope-match tolerance is additionally replaced
with a region-adaptive one derived from the recalibration surface’s
per-region residual spread σ:
tol_ppm = clamp(tol_sigma_mult × σ(m/z,RT), tol_floor_ppm, mz_tolerance).
Tightens the search window where the instrument is precise (rejecting
false isotope matches) and relaxes it — never beyond mz_tolerance —
where it is noisy. Only honoured for ppm tolerances. Default true.
mz_recalibration_mz_bins: usizeNumber of m/z bins in the recalibration surface. Bin extents are derived from the observed sample range. Default 20.
mz_recalibration_rt_bins: usizeNumber of RT bins in the recalibration surface. Default 8.
mz_recalibration_min_samples: usizeMinimum residual samples a surface cell must hold before its own median is trusted; below this the cell falls back to the m/z-marginal median, then the global median. Default 50.
mz_recalibration_tol_sigma_mult: f64N in the region-adaptive tolerance N × σ. Default 4.0.
mz_recalibration_tol_floor_ppm: f64Lower bound (ppm) on the region-adaptive tolerance, so a spuriously tiny σ in a sparse region can’t collapse the window. Default 1.0.
Trait Implementations§
Source§impl Clone for FileConfig
impl Clone for FileConfig
Source§fn clone(&self) -> FileConfig
fn clone(&self) -> FileConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FileConfig
impl Debug for FileConfig
Source§impl Default for FileConfig
impl Default for FileConfig
Source§fn default() -> FileConfig
fn default() -> FileConfig
Source§impl<'de> Deserialize<'de> for FileConfigwhere
FileConfig: Default,
impl<'de> Deserialize<'de> for FileConfigwhere
FileConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FileConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FileConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for FileConfig
impl Serialize for FileConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for FileConfig
impl RefUnwindSafe for FileConfig
impl Send for FileConfig
impl Sync for FileConfig
impl Unpin for FileConfig
impl UnsafeUnpin for FileConfig
impl UnwindSafe for FileConfig
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.