A simple calibration method using linear interpolation of given reference masses. More...
#include <OpenMS/FILTERING/CALIBRATION/InternalCalibration.h>
Public Member Functions | |
| InternalCalibration () | |
| Default constructor. More... | |
| ~InternalCalibration () | |
| Destructor. More... | |
| template<typename InputPeakType > | |
| void | calibrateMapSpectrumwise (MSExperiment< InputPeakType > &exp, std::vector< double > &ref_masses) |
| Calibrate a peak map using given reference masses with a separate calibration function for each spectrum. More... | |
| template<typename InputPeakType > | |
| void | calibrateMapGlobally (MSExperiment< InputPeakType > &exp, const std::vector< double > &ref_masses, const String &trafo_file_name="") |
| Calibrate a peak map using given reference masses with one calibration function for the whole map. More... | |
| template<typename InputPeakType > | |
| void | calibrateMapGlobally (MSExperiment< InputPeakType > &exp, const std::vector< PeptideIdentification > &ref_ids, const String &trafo_file_name="") |
| Calibrate a peak map using given reference ids with one calibration function for the whole map. More... | |
| void | calibrateMapGlobally (FeatureMap &feature_map, const String &trafo_file_name="") |
| Calibrate an annotated feature map with one calibration function for the whole map. More... | |
| void | calibrateMapGlobally (FeatureMap &feature_map, std::vector< PeptideIdentification > &ref_ids, const String &trafo_file_name="") |
| Calibrate a feature map using given reference ids with one calibration function for the whole map. More... | |
Public Member Functions inherited from DefaultParamHandler | |
| DefaultParamHandler (const String &name) | |
| Constructor with name that is displayed in error messages. More... | |
| DefaultParamHandler (const DefaultParamHandler &rhs) | |
| Copy constructor. More... | |
| virtual | ~DefaultParamHandler () |
| Destructor. More... | |
| virtual DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
| Assignment operator. More... | |
| virtual bool | operator== (const DefaultParamHandler &rhs) const |
| Equality operator. More... | |
| void | setParameters (const Param ¶m) |
| Sets the parameters. More... | |
| const Param & | getParameters () const |
| Non-mutable access to the parameters. More... | |
| const Param & | getDefaults () const |
| Non-mutable access to the default parameters. More... | |
| const String & | getName () const |
| Non-mutable access to the name. More... | |
| void | setName (const String &name) |
| Mutable access to the name. More... | |
| const std::vector< String > & | getSubsections () const |
| Non-mutable access to the registered subsections. More... | |
Public Member Functions inherited from ProgressLogger | |
| ProgressLogger () | |
| Constructor. More... | |
| ~ProgressLogger () | |
| Destructor. More... | |
| ProgressLogger (const ProgressLogger &other) | |
| Copy constructor. More... | |
| ProgressLogger & | operator= (const ProgressLogger &other) |
| Assignment Operator. More... | |
| void | setLogType (LogType type) const |
| Sets the progress log that should be used. The default type is NONE! More... | |
| LogType | getLogType () const |
| Returns the type of progress log being used. More... | |
| void | startProgress (SignedSize begin, SignedSize end, const String &label) const |
| Initializes the progress display. More... | |
| void | setProgress (SignedSize value) const |
| Sets the current progress. More... | |
| void | endProgress () const |
| Ends the progress display. More... | |
Protected Member Functions | |
| void | makeLinearRegression_ (const std::vector< double > &observed_masses, const std::vector< double > &theoretical_masses) |
| the actual calibration function More... | |
| void | checkReferenceIds_ (const std::vector< PeptideIdentification > &pep_ids) |
| check if reference ids contain RT and MZ information as meta values More... | |
| void | checkReferenceIds_ (const FeatureMap &feature_map) |
| check if reference ids contain RT and MZ information as meta values More... | |
| void | applyTransformation_ (FeatureMap &feature_map) |
| apply transformation to all features (including subordinates and convex hulls) More... | |
| template<typename InputPeakType > | |
| void | applyTransformation_ (typename MSExperiment< InputPeakType >::SpectrumType &spec) |
| template<typename InputPeakType > | |
| void | applyTransformation_ (MSExperiment< InputPeakType > &exp) |
Protected Member Functions inherited from DefaultParamHandler | |
| virtual void | updateMembers_ () |
| This method is used to update extra member variables at the end of the setParameters() method. More... | |
| void | defaultsToParam_ () |
| Updates the parameters after the defaults have been set in the constructor. More... | |
Protected Attributes | |
| TransformationDescription | trafo_ |
| here the transformation is stored More... | |
Protected Attributes inherited from DefaultParamHandler | |
| Param | param_ |
| Container for current parameters. More... | |
| Param | defaults_ |
| Container for default parameters. This member should be filled in the constructor of derived classes! More... | |
| std::vector< String > | subsections_ |
| Container for registered subsections. This member should be filled in the constructor of derived classes! More... | |
| String | error_name_ |
| Name that is displayed in error messages during the parameter checking. More... | |
| bool | check_defaults_ |
| If this member is set to false no checking if parameters in done;. More... | |
| bool | warn_empty_defaults_ |
| If this member is set to false no warning is emitted when defaults are empty;. More... | |
Protected Attributes inherited from ProgressLogger | |
| LogType | type_ |
| time_t | last_invoke_ |
| ProgressLoggerImpl * | current_logger_ |
Additional Inherited Members | |
Public Types inherited from ProgressLogger | |
| enum | LogType { CMD, GUI, NONE } |
| Possible log types. More... | |
Static Protected Member Functions inherited from ProgressLogger | |
| static String | logTypeToFactoryName_ (LogType type) |
| Return the name of the factory product used for this log type. More... | |
Static Protected Attributes inherited from ProgressLogger | |
| static int | recursion_depth_ |
A simple calibration method using linear interpolation of given reference masses.
This class implements a simple calibration method: given a list of reference masses, the relative errors of the peaks in the data are approximated by linear interpolation and subtracted from the data.
Parameters of this class are:| Name | Type | Default | Restrictions | Description |
|---|---|---|---|---|
| mz_tolerance | float | 1 | min: 0 | Allowed tolerance between peak and reference m/z. |
| mz_tolerance_unit | string | Da | Da, ppm | Unit for mz_tolerance. |
| rt_tolerance | int | 10 | Allowed tolerance between peak and reference rt. | |
| ms_levels | int list | [1, 2, 3] | MS level for which to apply the calibration. Make sure to get this correct since it depends on your instrument and the number of mass analyzers it has! |
Default constructor.
|
inline |
Destructor.
|
protected |
apply transformation to all features (including subordinates and convex hulls)
|
inlineprotected |
References MSSpectrum< PeakT >::getMSLevel().
|
inlineprotected |
References MSExperiment< PeakT, ChromatogramPeakT >::size().
|
inline |
Calibrate a peak map using given reference masses with one calibration function for the whole map.
The calibration function is calculated for the whole map. For the matching of the reference masses and the peaks the parameter mz_tolerance is used to calculate a window around the reference masses. If more than one peak is found within this window the closest peak is taken.
| exp | The peak map to calibrate |
| ref_masses | The reference m/z values |
| trafo_file_name | Output file to store the transformation function |
References MSExperiment< PeakT, ChromatogramPeakT >::empty(), SpectrumSettings::PEAKS, MSExperiment< PeakT, ChromatogramPeakT >::size(), and TransformationXMLFile::store().
|
inline |
Calibrate a peak map using given reference ids with one calibration function for the whole map.
Calibrate a map using given peptide identifications. The calibration function is calculated for the whole map. The m/z-values of the reference identifications are calculated through the given sequence and charge of the peptide. For the matching of the reference masses and the peaks the parameter mz_tolerance is used to calculate a window around the reference masses. If more than one peak is found within this window the closest peak is taken.
| exp | The peak map to calibrate |
| ref_ids | The reference peptide identifications |
| trafo_file_name | Output file to store the transformation function |
References MSExperiment< PeakT, ChromatogramPeakT >::begin(), MSExperiment< PeakT, ChromatogramPeakT >::empty(), MSExperiment< PeakT, ChromatogramPeakT >::end(), Residue::Full, SpectrumSettings::PEAKS, MSExperiment< PeakT, ChromatogramPeakT >::RTBegin(), and TransformationXMLFile::store().
| void calibrateMapGlobally | ( | FeatureMap & | feature_map, |
| const String & | trafo_file_name = "" |
||
| ) |
Calibrate an annotated feature map with one calibration function for the whole map.
Calibrate an annotated (!) feature map using the features' identifications. The calibration function is calculated for the whole map. The m/z-values of the reference identifications are calculated through the given sequence and charge of the peptide.
| feature_map | The feature map to calibrate (annotated with peptide ids) |
| trafo_file_name | Output file to store the transformation function |
| void calibrateMapGlobally | ( | FeatureMap & | feature_map, |
| std::vector< PeptideIdentification > & | ref_ids, | ||
| const String & | trafo_file_name = "" |
||
| ) |
Calibrate a feature map using given reference ids with one calibration function for the whole map.
Calibrate a feature map using given peptide identifications. The calibration function is calculated for the whole map. Even if the features are already annotated with peptide ids these annotations are ignored for the calibration, only the reference ids are used. The m/z-values of the reference identifications are calculated through the given sequence and charge of the peptide. The reference ids are mapped onto the FeatureMap using IDMapper with the mz_tolerance and rt_tolerance parameters.
| feature_map | The feature map to calibrate |
| ref_ids | the reference peptide identifications |
| trafo_file_name | file where the transformation function of the calibration is stored |
|
inline |
Calibrate a peak map using given reference masses with a separate calibration function for each spectrum.
The calibration function is calculated for each spectrum separately. If not enough reference masses are found for a spectrum it is left uncalibrated. For the matching of the reference masses and the peaks, the parameter mz_tolerance is used to calculate a window around the reference masses. If more than one peak is found within this window the closest peak is taken.
| exp | The peak map to calibrate |
| ref_masses | The reference m/z values |
References MSExperiment< PeakT, ChromatogramPeakT >::empty(), SpectrumSettings::PEAKS, MSExperiment< PeakT, ChromatogramPeakT >::size(), and OpenMS::writtenDigits< double >().
|
protected |
check if reference ids contain RT and MZ information as meta values
|
protected |
check if reference ids contain RT and MZ information as meta values
|
protected |
the actual calibration function
|
protected |
here the transformation is stored
| OpenMS / TOPP release 2.0.0 | Documentation generated on Tue Jan 31 2017 06:40:24 using doxygen 1.8.8 |