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 (const MSExperiment< InputPeakType > &exp, MSExperiment< InputPeakType > &calibrated_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 (const MSExperiment< InputPeakType > &exp, MSExperiment< InputPeakType > &calibrated_exp, std::vector< double > &ref_masses, 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 (const MSExperiment< InputPeakType > &exp, MSExperiment< InputPeakType > &calibrated_exp, std::vector< PeptideIdentification > &ref_ids, String trafo_file_name="") |
Calibrate a peak map using given reference ids with one calibration function for the whole map. More... | |
void | calibrateMapGlobally (const FeatureMap &feature_map, FeatureMap &calibrated_feature_map, String trafo_file_name="") |
Calibrate an annotated feature map with one calibration function for the whole map. More... | |
void | calibrateMapGlobally (const FeatureMap &feature_map, FeatureMap &calibrated_feature_map, std::vector< PeptideIdentification > &ref_ids, String trafo_file_name="") |
Calibrate a feature map using given reference ids with one calibration function for the whole map. More... | |
template<typename InputPeakType > | |
void | calibrateMapList (std::vector< MSExperiment< InputPeakType > > &exp_list, std::vector< MSExperiment< InputPeakType > > &calibrated_exp_list, std::vector< double > &ref_masses, std::vector< double > &detected_background_masses) |
![]() | |
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... | |
![]() | |
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_ (std::vector< double > &observed_masses, std::vector< double > &theoretical_masses) |
the actual calibration function More... | |
void | checkReferenceIds_ (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_ (const FeatureMap &feature_map, FeatureMap &calibrated_feature_map) |
apply transformation to all features (including subordinates and convex hulls) More... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
LogType | type_ |
time_t | last_invoke_ |
ProgressLoggerImpl * | current_logger_ |
Additional Inherited Members | |
![]() | |
enum | LogType { CMD, GUI, NONE } |
Possible log types. More... | |
![]() | |
static String | logTypeToFactoryName_ (LogType type) |
Return the name of the factory product used for this log type. More... | |
![]() | |
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.
Default constructor.
|
inline |
Destructor.
|
protected |
apply transformation to all features (including subordinates and convex hulls)
void calibrateMapGlobally | ( | const MSExperiment< InputPeakType > & | exp, |
MSExperiment< InputPeakType > & | calibrated_exp, | ||
std::vector< double > & | ref_masses, | ||
String | trafo_file_name = "" |
||
) |
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 uncalibrated peak map |
calibrated_exp | the calibrated peak map |
ref_masses | the reference m/z values |
trafo_file_name | file where the transformation function of the calibration is stored |
References MSExperiment< PeakT, ChromatogramPeakT >::empty(), SpectrumSettings::PEAKS, MSExperiment< PeakT, ChromatogramPeakT >::resize(), MSExperiment< PeakT, ChromatogramPeakT >::size(), and TransformationXMLFile::store().
void calibrateMapGlobally | ( | const MSExperiment< InputPeakType > & | exp, |
MSExperiment< InputPeakType > & | calibrated_exp, | ||
std::vector< PeptideIdentification > & | ref_ids, | ||
String | trafo_file_name = "" |
||
) |
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 uncalibrated peak map |
calibrated_exp | the calibrated peak map |
ref_ids | the reference peptide identifications |
trafo_file_name | file where the transformation function of the calibration is stored |
References MSExperiment< PeakT, ChromatogramPeakT >::begin(), MSExperiment< PeakT, ChromatogramPeakT >::empty(), MSExperiment< PeakT, ChromatogramPeakT >::end(), Residue::Full, SpectrumSettings::PEAKS, MSExperiment< PeakT, ChromatogramPeakT >::resize(), MSExperiment< PeakT, ChromatogramPeakT >::RTBegin(), MSExperiment< PeakT, ChromatogramPeakT >::size(), and TransformationXMLFile::store().
void calibrateMapGlobally | ( | const FeatureMap & | feature_map, |
FeatureMap & | calibrated_feature_map, | ||
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 uncalibrated feature map (annotated with peptide ids) |
calibrated_feature_map | the calibrated feature map |
trafo_file_name | file where the transformation function of the calibration is stored |
void calibrateMapGlobally | ( | const FeatureMap & | feature_map, |
FeatureMap & | calibrated_feature_map, | ||
std::vector< PeptideIdentification > & | ref_ids, | ||
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 uncalibrated feature map |
calibrated_feature_map | the calibrated feature map |
ref_ids | the reference peptide identifications |
trafo_file_name | file where the transformation function of the calibration is stored |
void calibrateMapList | ( | std::vector< MSExperiment< InputPeakType > > & | exp_list, |
std::vector< MSExperiment< InputPeakType > > & | calibrated_exp_list, | ||
std::vector< double > & | ref_masses, | ||
std::vector< double > & | detected_background_masses | ||
) |
void calibrateMapSpectrumwise | ( | const MSExperiment< InputPeakType > & | exp, |
MSExperiment< InputPeakType > & | calibrated_exp, | ||
std::vector< double > & | ref_masses | ||
) |
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 uncalibrated peak map |
calibrated_exp | the calibrated peak map |
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 Wed Mar 30 2016 12:49:28 using doxygen 1.8.11 |