![]() |
OpenMS
|
Identification-free precursor and fragment mass-precision estimator. More...
#include <OpenMS/QC/IDFreeMassErrorEstimator.h>
Classes | |
| struct | Diagnostics |
| Estimator support/accounting counters. More... | |
| struct | FragmentFingerprint |
| struct | GaussianUniformFit |
| struct | Parameters |
| Tunable estimator thresholds. Defaults match the validated prideQC implementation. More... | |
| struct | PrecursorCluster |
| struct | Result |
| Current precision estimates, optional tolerance suggestions and diagnostics. More... | |
| struct | RobustError |
| Robust summary of pairwise repeated-measurement differences. More... | |
| struct | ToleranceSuggestion |
| Precision-derived search-tolerance suggestion for one unit system. More... | |
Public Types | |
| enum class | FragmentResolutionRegime { UNAVAILABLE , HIGH_RESOLUTION , LOW_RESOLUTION } |
Public Member Functions | |
| IDFreeMassErrorEstimator () | |
| IDFreeMassErrorEstimator (const Parameters ¶meters) | |
| void | setParameters (const Parameters ¶meters) |
| Replace estimator parameters and clear all accumulated evidence. | |
| const Parameters & | getParameters () const |
| void | reset () |
| Clear all accumulated evidence while retaining the current parameters. | |
| void | consumeSpectrum (const MSSpectrum &spectrum) |
| Result | compute (const MSExperiment &experiment) |
Reset, consume all spectra in experiment, and return the resulting estimate. | |
| Result | getResult () const |
| Return the current complete estimate without mutating accumulated state. | |
| std::optional< RobustError > | getPrecursorPrecisionPPM () const |
| Return only the current precursor-ppm precision summary. | |
Private Types | |
| using | BinKey = std::pair< Int, Int > |
Private Member Functions | |
| void | commitPrecursorCluster_ (PrecursorCluster &cluster) |
| void | consumePrecursor_ (const MSSpectrum &spectrum, double precursor_mz, Int charge) |
| std::pair< std::vector< double >, std::vector< double > > | fragmentPeaks_ (const MSSpectrum &spectrum) |
| void | consumeFragments_ (const MSSpectrum &spectrum, double precursor_mz, Int charge) |
Static Private Member Functions | |
| static void | validateParameters_ (const Parameters ¶meters) |
| static std::optional< RobustError > | robustError_ (const std::vector< double > &values) |
| static std::optional< GaussianUniformFit > | gaussianUniformFit_ (const std::vector< double > &values) |
| static RobustError | errorFromGaussianUniformFit_ (const std::vector< double > &values, const GaussianUniformFit &fit) |
| static std::pair< std::vector< double >, std::vector< double > > | centroidTopPeaks_ (const MSSpectrum &spectrum, Size limit) |
| static std::pair< std::vector< double >, std::vector< double > > | profilePeakCenters_ (const MSSpectrum &spectrum, Size limit) |
| static std::pair< std::vector< double >, std::vector< double > > | matchedDeltas_ (const std::vector< double > &left_mz, const std::vector< double > &right_mz, double tolerance_da) |
| static std::pair< std::vector< double >, std::vector< double > > | coarseBinnedDeltas_ (const std::vector< double > &left_mz, const std::vector< double > &left_relative_intensity, const std::vector< double > &right_mz, const std::vector< double > &right_relative_intensity, double bin_width_da, std::vector< double > &shared_relative_intensity) |
Private Attributes | |
| Parameters | parameters_ |
| std::map< BinKey, std::vector< PrecursorCluster > > | precursor_bins_ |
| std::map< BinKey, std::deque< FragmentFingerprint > > | fragment_bins_ |
| std::vector< double > | precursor_errors_ppm_ |
| std::vector< double > | precursor_errors_da_ |
| std::vector< double > | fragment_errors_da_ |
| std::vector< double > | fragment_errors_ppm_ |
| std::vector< double > | fragment_mixture_errors_ppm_ |
| std::vector< double > | fragment_mixture_mean_mz_ |
| std::vector< double > | fragment_mixture_shared_relative_intensity_ |
| std::vector< double > | fragment_low_res_errors_da_ |
| std::vector< double > | fragment_low_res_errors_ppm_ |
| std::vector< double > | fragment_very_low_res_errors_da_ |
| std::vector< double > | fragment_very_low_res_errors_ppm_ |
| Diagnostics | diagnostics_ |
Identification-free precursor and fragment mass-precision estimator.
The estimator derives measurement precision from repeated precursor observations and likely repeated MS2 spectra without requiring peptide identifications. Precursor evidence uses repeated observations with the same positive charge in a bounded RT/m/z neighbourhood. Fragment evidence compares strong peak centres from likely repeated spectra. High-resolution fragment precision is estimated from unambiguous coarse-bin peak pairs with a Gaussian plus uniform-background mixture in ppm, avoiding dependence on a narrow fragment-match window. Centroided spectra use their native peaks; profile spectra use an ephemeral three-point quadratic fit in log-intensity space around local maxima. Input spectra are never modified.
The returned precision describes random measurement variation. It does not recover a historical database-search tolerance, fixed calibration bias, or isotope-error policy.
The class is stateful so callers can stream spectra through consumeSpectrum. The convenience compute overload resets the estimator and processes a complete experiment.
| struct OpenMS::IDFreeMassErrorEstimator::Diagnostics |
Estimator support/accounting counters.
| Class Members | ||
|---|---|---|
| Size | excluded_fragment_profile_or_unknown {0} | |
| Size | excluded_fragment_unknown {0} | |
| Size | excluded_low_fragment_peaks {0} | |
| Size | excluded_missing_precursor {0} | |
| Size | excluded_profile_peak_pick_failure {0} | |
| Size | fragment_centroid_spectra {0} | |
| Size | fragment_eligible_ms2 {0} | |
| bool | fragment_high_intensity_fallback_used {false} | |
| bool | fragment_high_intensity_mixture_converged {false} | |
| Size | fragment_high_intensity_pairs {0} | |
| double | fragment_high_intensity_signal_fraction {0.0} | |
| Size | fragment_high_intensity_signal_pairs {0} | |
| double | fragment_high_intensity_threshold {0.0} | |
| Size | fragment_low_res_pairs {0} | |
| bool | fragment_mixture_converged {false} | |
| Size | fragment_mixture_iterations {0} | |
| double | fragment_mixture_mean_ppm {0.0} | |
| Size | fragment_mixture_pairs {0} | |
| double | fragment_mixture_reference_mz {0.0} | |
| bool | fragment_mixture_rejected_zero_quantization {false} | |
| double | fragment_mixture_signal_fraction {0.0} | |
| Size | fragment_mixture_signal_pairs {0} | |
| Size | fragment_paired_spectra {0} | |
| Size | fragment_pairs {0} | |
| Size | fragment_profile_centroids {0} | |
| Size | fragment_profile_spectra {0} | |
| Size | fragment_very_low_res_pairs {0} | |
| double | fragment_zero_delta_fraction {0.0} | |
| Size | fragment_zero_delta_pairs {0} | |
| Size | precursor_clusters_used {0} | |
| Size | precursor_eligible_ms2 {0} | |
| Size | precursor_paired_spectra {0} | |
| struct OpenMS::IDFreeMassErrorEstimator::FragmentFingerprint |
| struct OpenMS::IDFreeMassErrorEstimator::GaussianUniformFit |
| Class Members | ||
|---|---|---|
| bool | converged {false} | |
| Size | iterations {0} | |
| double | log_likelihood {-std::numeric_limits<double>::infinity()} | |
| double | mean {0.0} | |
| double | pairwise_sigma {0.0} | |
| double | signal_fraction {0.0} | |
| struct OpenMS::IDFreeMassErrorEstimator::Parameters |
Tunable estimator thresholds. Defaults match the validated prideQC implementation.
| Class Members | ||
|---|---|---|
| double | fragment_high_intensity_quantile {0.75} | |
| double | fragment_high_res_max_sigma_da {0.01} | |
| double | fragment_high_res_max_sigma_ppm {10.0} | |
| double | fragment_low_res_match_da {0.5} | |
| double | fragment_low_res_min_sigma_da {0.01} | |
| double | fragment_low_res_min_sigma_ppm {20.0} | |
| double | fragment_match_da {0.2} | |
| double | fragment_tolerance_sigma_multiplier {6.0} | |
| double | fragment_very_low_res_match_da {1.0} | |
| Size | max_candidates_per_bin {32} | |
| Size | min_fragment_pairs {200} | |
| Size | min_fragment_tolerance_pairs {1000} | |
| Size | min_fragment_tolerance_spectra {50} | |
| Size | min_matched_peaks {8} | |
| double | min_overlap_fraction {0.25} | |
| Size | min_precursor_cluster_size {3} | |
| Size | min_precursor_clusters {10} | |
| Size | min_spectrum_pairs {25} | |
| Size | min_tolerance_clusters {100} | |
| Size | min_tolerance_pairs {200} | |
| double | precursor_candidate_ppm {20.0} | |
| double | rt_window_seconds {120.0} | |
| double | tolerance_sigma_multiplier {6.0} | |
| Size | top_peaks {50} | |
| struct OpenMS::IDFreeMassErrorEstimator::PrecursorCluster |
| Class Members | ||
|---|---|---|
| bool | committed {false} | |
| Size | count {1} | |
| double | last_mz {0.0} | |
| double | last_rt {0.0} | |
| double | mean_mz {0.0} | |
| vector< double > | pending_da | |
| vector< double > | pending_ppm | |
| struct OpenMS::IDFreeMassErrorEstimator::Result |
Current precision estimates, optional tolerance suggestions and diagnostics.
| Class Members | ||
|---|---|---|
| Diagnostics | diagnostics | |
| optional< RobustError > | fragment_da | |
| double | fragment_match_window_da {0.2} | |
| optional< RobustError > | fragment_ppm | |
| FragmentResolutionRegime | fragment_resolution_regime {FragmentResolutionRegime::UNAVAILABLE} | |
| optional< ToleranceSuggestion > | fragment_tolerance_da | |
| optional< ToleranceSuggestion > | fragment_tolerance_ppm | |
| bool | fragment_window_censored {false} | |
| optional< RobustError > | precursor_da | |
| optional< RobustError > | precursor_ppm | |
| optional< ToleranceSuggestion > | precursor_tolerance_ppm | |
| struct OpenMS::IDFreeMassErrorEstimator::RobustError |
Robust summary of pairwise repeated-measurement differences.
| Class Members | ||
|---|---|---|
| double | pairwise_median {0.0} | |
| double | pairwise_p95_abs {0.0} | |
| double | pairwise_sigma {0.0} | |
| Size | robust_inlier_count {0} | |
| double | robust_inlier_fraction {0.0} | |
| double | robust_inlier_p95_abs_centered {0.0} | |
| double | robust_inlier_threshold_3sigma {0.0} | |
| Size | robust_outlier_count {0} | |
| double | single_measurement_sigma {0.0} | |
| struct OpenMS::IDFreeMassErrorEstimator::ToleranceSuggestion |
Precision-derived search-tolerance suggestion for one unit system.
| Class Members | ||
|---|---|---|
| string | confidence | |
| double | sigma_multiplier {0.0} | |
| double | single_measurement_sigma {0.0} | |
| Size | support {0} | |
| double | tolerance {0.0} | |
| string | unit | |
|
strong |
|
explicit |
|
staticprivate |
|
staticprivate |
|
private |
| Result compute | ( | const MSExperiment & | experiment | ) |
Reset, consume all spectra in experiment, and return the resulting estimate.
|
private |
|
private |
| void consumeSpectrum | ( | const MSSpectrum & | spectrum | ) |
Consume one spectrum. Non-MS2 spectra are ignored. Spectrum RT order does not matter. Charge-less MS2 spectra with a valid precursor/isolation m/z contribute fragment evidence, but not charge-specific precursor evidence. A streamed estimator instance represents one run; call reset before consuming spectra from another run.
|
staticprivate |
|
private |
|
staticprivate |
| const Parameters & getParameters | ( | ) | const |
| std::optional< RobustError > getPrecursorPrecisionPPM | ( | ) | const |
Return only the current precursor-ppm precision summary.
| Result getResult | ( | ) | const |
Return the current complete estimate without mutating accumulated state.
|
staticprivate |
|
staticprivate |
| void reset | ( | ) |
Clear all accumulated evidence while retaining the current parameters.
|
staticprivate |
| void setParameters | ( | const Parameters & | parameters | ) |
Replace estimator parameters and clear all accumulated evidence.
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |