![]() |
OpenMS
|
A class containing correction functions for Swath MS maps. More...
#include <OpenMS/ANALYSIS/OPENSWATH/SwathMapMassCorrection.h>
Public Member Functions | |
| SwathMapMassCorrection () | |
| Constructor. | |
| ~SwathMapMassCorrection () override=default | |
| Destructor. | |
| void | updateMembers_ () override |
| Synchronize members with param class. | |
| void | correctMZ (const std::map< std::string, OpenMS::MRMFeatureFinderScoring::MRMTransitionGroupType * > &transition_group_map, const OpenSwath::LightTargetedExperiment &targeted_exp, std::vector< OpenSwath::SwathMap > &swath_maps, const bool pasef) |
| Correct the m/z values of a SWATH map based on the RT-normalization peptides. | |
| void | correctIM (const std::map< std::string, OpenMS::MRMFeatureFinderScoring::MRMTransitionGroupType * > &transition_group_map, const OpenSwath::LightTargetedExperiment &targeted_exp, const std::vector< OpenSwath::SwathMap > &swath_maps, const bool pasef, TransformationDescription &im_trafo) |
| Correct the ion mobility values of a SWATH map based on the RT-normalization peptides. | |
| std::vector< OpenSwath::SwathMap > | findSwathMapsPasef (const OpenMS::MRMFeatureFinderScoring::MRMTransitionGroupType &transition_group, const std::vector< OpenSwath::SwathMap > &swath_maps) |
| Computes the SwathMaps for PASEF data in which windows can have the same m/z but differ by ion mobility. | |
| double | getFragmentMzWindow () const |
| Retrieve the estimated fragment m/z extraction window (ppm) | |
| void | setFragmentMzWindow (double fragmentMzWindow) |
| Set the estimated fragment m/z extraction window (ppm_. | |
| double | getFragmentImWindow () const |
| Retrieve the estimated fragment ion mobility extraction window. | |
| void | setFragmentImWindow (double fragmentImWindow) |
| Set the estimated fragment ion mobility extraction window. | |
| double | getPrecursorMzWindow () const |
| Retrieve the estimated precursor m/z extraction window (ppm) | |
| void | setPrecursorMzWindow (double precursorMzWindow) |
| Set the estimated precursor m/z extraction window (ppm) | |
| double | getPrecursorImWindow () const |
| Retrieve the estimated precursor ion mobility extraction window. | |
| void | setPrecursorImWindow (double precursorImWindow) |
| Set the estimated precursor ion mobility extraction window. | |
Public Member Functions inherited from DefaultParamHandler | |
| DefaultParamHandler (const std::string &name) | |
| Constructor with name that is displayed in error messages. | |
| DefaultParamHandler (const DefaultParamHandler &rhs) | |
| Copy constructor. | |
| virtual | ~DefaultParamHandler () |
| Destructor. | |
| DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
| Assignment operator. | |
| virtual bool | operator== (const DefaultParamHandler &rhs) const |
| Equality operator. | |
| void | setParameters (const Param ¶m) |
| Sets the parameters. | |
| const Param & | getParameters () const |
| Non-mutable access to the parameters. | |
| const Param & | getDefaults () const |
| Non-mutable access to the default parameters. | |
| const std::string & | getName () const |
| Non-mutable access to the name. | |
| void | setName (const std::string &name) |
| Mutable access to the name. | |
| const std::vector< std::string > & | getSubsections () const |
| Non-mutable access to the registered subsections. | |
Static Public Member Functions | |
| static double | estimateWindow (std::vector< double > residuals, double quantile=0.99, bool full_width=true, double padding_factor=1.0) |
| Estimate an extraction window from absolute residuals. | |
Static Public Member Functions inherited from DefaultParamHandler | |
| static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const std::string &key_prefix="") |
| Writes all parameters to meta values. | |
Private Attributes | |
| double | mz_extraction_window_ |
| bool | mz_extraction_window_ppm_ |
| bool | ms1_im_ |
| double | im_extraction_window_ |
| std::string | mz_correction_function_ |
| std::string | im_correction_function_ |
| std::string | debug_im_file_ |
| std::string | debug_mz_file_ |
| double | mz_estimation_padding_factor_ = 1.0 |
| fields for estimated mz and ion mobility windows | |
| double | im_estimation_padding_factor_ = 1.0 |
| double | mz_estimation_percentile_ = 99.0 |
| double | im_estimation_percentile_ = 99.0 |
| double | fragment_mz_window_ = -1 |
| double | fragment_im_window_ = -1 |
| double | precursor_mz_window_ = -1 |
| double | precursor_im_window_ = -1 |
Additional Inherited Members | |
Protected Member Functions inherited from DefaultParamHandler | |
| void | defaultsToParam_ () |
| Updates the parameters after the defaults have been set in the constructor. | |
Protected Attributes inherited from DefaultParamHandler | |
| Param | param_ |
| Container for current parameters. | |
| Param | defaults_ |
| Container for default parameters. This member should be filled in the constructor of derived classes! | |
| std::vector< std::string > | subsections_ |
| Container for registered subsections. This member should be filled in the constructor of derived classes! | |
| std::string | error_name_ |
| Name that is displayed in error messages during the parameter checking. | |
| bool | check_defaults_ |
| If this member is set to false no checking if parameters in done;. | |
| bool | warn_empty_defaults_ |
| If this member is set to false no warning is emitted when defaults are empty;. | |
A class containing correction functions for Swath MS maps.
This class can use a set of pre-determined points in a Swath-MS map to correct all maps according to the m/z shift found in those fixed points.
Constructor.
|
overridedefault |
Destructor.
| void correctIM | ( | const std::map< std::string, OpenMS::MRMFeatureFinderScoring::MRMTransitionGroupType * > & | transition_group_map, |
| const OpenSwath::LightTargetedExperiment & | targeted_exp, | ||
| const std::vector< OpenSwath::SwathMap > & | swath_maps, | ||
| const bool | pasef, | ||
| TransformationDescription & | im_trafo | ||
| ) |
Correct the ion mobility values of a SWATH map based on the RT-normalization peptides.
This extracts the full spectra at the most likely elution time of the calibrant peptides and fits a linear regression curve to correct for a possible ion mobility (drift time) shift of the empirical drift time vs the theoretically expected drift time. The resulting linear transformation is stored using a TransformationDescription object. Transitions with peptide references absent from targeted_exp are skipped for both calibration and auxiliary MS1 window estimation. Non-finite experimental/theoretical pairs are discarded before fitting and window estimation. Remaining pairs are ordered together deterministically. If correction is disabled or the extraction window is negative, the transformation and estimated windows are left unchanged.
| Exception::UnableToFit | if correction is enabled but no finite calibration pairs remain. The transformation and estimated windows are left unchanged. |
| [out] | transition_group_map | A MRMFeatureFinderScoring result map |
| [in,out] | swath_maps | The raw swath maps from the current run |
| [in] | targeted_exp | The corresponding spectral library (required for extraction coordinates) |
| [in] | pasef | whether the data is PASEF data with possible overlapping m/z windows (with different ion mobility). In this case, the "best" SWATH window (with precursor cetntered around IM) is chosen. |
| [out] | im_trafo | The resulting map containing the transformation |
| void correctMZ | ( | const std::map< std::string, OpenMS::MRMFeatureFinderScoring::MRMTransitionGroupType * > & | transition_group_map, |
| const OpenSwath::LightTargetedExperiment & | targeted_exp, | ||
| std::vector< OpenSwath::SwathMap > & | swath_maps, | ||
| const bool | pasef | ||
| ) |
Correct the m/z values of a SWATH map based on the RT-normalization peptides.
This extracts the full spectra at the most likely elution time of the calibrant peptides and fits a regression curve to correct for a possible mass shift of the empirical masses vs the theoretically expected masses. Several types of regressions are available (see below corr_type parameter).
The function will replace the pointers stored in swath_maps with a transforming map that will contain corrected m/z values.
| [out] | transition_group_map | A MRMFeatureFinderScoring result map |
| [in] | targeted_exp | The corresponding spectral library (required for extraction coordinates) |
| [in] | swath_maps | The raw swath maps from the current run, will be modified (replaced with a corrected version) |
| [in] | pasef | Whether the data is PASEF data with possible overlapping m/z windows (with different ion mobility). In this case, the "best" SWATH window (with precursor cetntered around IM) is chosen. |
|
static |
Estimate an extraction window from absolute residuals.
Treats the input residuals as absolute errors (e.g., |delta ppm| for m/z). We compute an adaptive half-width using OpenMS::Math::adaptiveQuantile (Tukey k=1.5; blend raw vs winsorized by tail density), and return either the half-width or the full width (2×half).
Notes:
residuals contain absolute values; non-absolute inputs will be converted via std::abs internally.| [in] | residuals | Absolute residuals (e.g., |delta ppm|). |
| [in] | quantile | Quantile of the half-width distribution to use (default 0.99). |
| [in] | full_width | If true, return 2×half-width; if false, return half-width. |
| [in] | padding_factor | A padding factor to add to the estimated window. |
residuals; 0.0 if empty). | std::vector< OpenSwath::SwathMap > findSwathMapsPasef | ( | const OpenMS::MRMFeatureFinderScoring::MRMTransitionGroupType & | transition_group, |
| const std::vector< OpenSwath::SwathMap > & | swath_maps | ||
| ) |
Computes the SwathMaps for PASEF data in which windows can have the same m/z but differ by ion mobility.
For each precursor, the SwathMap is chosen based on library m/z and ion mobility. If two or more SwathMaps isolate the same precursor the SwathMap in which the precursor is more centered across ion mobility is chosen.
| [in] | transition_group | A MRMTransitionGroup for which the SwathMap is assigned to |
| [out] | swath_maps | A vector containing the a single entry, the swath map which the MRMFeature is assigned to |
| double getFragmentImWindow | ( | ) | const |
Retrieve the estimated fragment ion mobility extraction window.
| double getFragmentMzWindow | ( | ) | const |
Retrieve the estimated fragment m/z extraction window (ppm)
| double getPrecursorImWindow | ( | ) | const |
Retrieve the estimated precursor ion mobility extraction window.
| double getPrecursorMzWindow | ( | ) | const |
Retrieve the estimated precursor m/z extraction window (ppm)
| void setFragmentImWindow | ( | double | fragmentImWindow | ) |
Set the estimated fragment ion mobility extraction window.
| void setFragmentMzWindow | ( | double | fragmentMzWindow | ) |
Set the estimated fragment m/z extraction window (ppm_.
| void setPrecursorImWindow | ( | double | precursorImWindow | ) |
Set the estimated precursor ion mobility extraction window.
| void setPrecursorMzWindow | ( | double | precursorMzWindow | ) |
Set the estimated precursor m/z extraction window (ppm)
|
overridevirtual |
Synchronize members with param class.
Reimplemented from DefaultParamHandler.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
fields for estimated mz and ion mobility windows
|
private |
|
private |
|
private |
|
private |
|
private |