mioXpektron.recalibrate.flexible_calibrator
FlexibleCalibrator — single-model calibration with user-selected method.
Unlike AutoCalibrator which fits all models and picks the best,
FlexibleCalibrator fits exactly one user-chosen model with optional
iterative outlier rejection and quality-control thresholds.
All model fitting, inversion, and peak-detection functions live in the
shared _models backend.
Author: Data Analysis Team @KaziLab.se Version: 0.0.1
Functions
|
Select a stable reference-mass subset based on cross-spectrum residuals. |
|
Summarize per-mass residual stability across the current calibration summary. |
Classes
|
Configuration for flexible calibration with a single user-selected method. |
|
Single-model calibrator with user-selected method. |
- class mioXpektron.recalibrate.flexible_calibrator.FlexibleCalibConfig(reference_masses, calibration_method='quad_sqrt', output_folder='calibrated_spectra', output_mz_range=None, max_workers=None, autodetect_tol_da=None, autodetect_tol_ppm=None, autodetect_method='gaussian', autodetect_fallback_policy='max', autodetect_strategy='mz', prefer_recompute_from_channel=False, outlier_threshold=3.0, use_outlier_rejection=True, max_iterations=3, min_calibrants=3, max_ppm_threshold=100.0, fail_on_high_error=False, retry_high_error_with_pruning=False, retry_high_error_with_mz_fallback=False, retry_high_error_max_removals=5, exclude_reference_masses=<factory>, auto_screen_reference_masses=False, screen_max_mean_abs_ppm=50.0, screen_max_median_abs_ppm=None, screen_min_valid_fraction=0.8, screen_min_count=3, screen_exclude_below_mz=1.5, spline_smoothing=None, multisegment_breakpoints=<factory>, instrument_params=<factory>, save_diagnostic_plots=False, verbose=True, auto_tune=False)[source]
Bases:
objectConfiguration for flexible calibration with a single user-selected method.
- Parameters:
calibration_method (Literal['quad_sqrt', 'linear_sqrt', 'poly2', 'reflectron', 'multisegment', 'spline', 'physical'])
output_folder (str)
max_workers (int | None)
autodetect_tol_ppm (float | None)
autodetect_method (str)
autodetect_fallback_policy (str)
autodetect_strategy (str)
prefer_recompute_from_channel (bool)
outlier_threshold (float)
use_outlier_rejection (bool)
max_iterations (int)
min_calibrants (int)
max_ppm_threshold (float | None)
fail_on_high_error (bool)
retry_high_error_with_pruning (bool)
retry_high_error_with_mz_fallback (bool)
retry_high_error_max_removals (int)
auto_screen_reference_masses (bool)
screen_max_mean_abs_ppm (float)
screen_max_median_abs_ppm (float | None)
screen_min_valid_fraction (float)
screen_min_count (int)
screen_exclude_below_mz (float)
spline_smoothing (float | None)
save_diagnostic_plots (bool)
verbose (bool)
auto_tune (bool)
- mioXpektron.recalibrate.flexible_calibrator.summarize_reference_mass_stability(summary_df, *, exclude_below_mz=1.5)[source]
Summarize per-mass residual stability across the current calibration summary.
- mioXpektron.recalibrate.flexible_calibrator.select_stable_reference_masses(reference_masses, stability_df, *, exclude_below_mz=1.5, max_mean_abs_ppm=50.0, max_median_abs_ppm=None, min_valid_fraction=0.8, min_count=3)[source]
Select a stable reference-mass subset based on cross-spectrum residuals.
- class mioXpektron.recalibrate.flexible_calibrator.FlexibleCalibrator(config=None)[source]
Bases:
objectSingle-model calibrator with user-selected method.
Unlike
AutoCalibrator, this calibrator fits exactly one model and provides more control over outlier rejection, quality thresholds, and per-model parameters.- Parameters:
config (FlexibleCalibConfig | None)