Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
InternalCalibration Class Reference

A simple calibration method using linear interpolation of given reference masses. More...

#include <OpenMS/FILTERING/CALIBRATION/InternalCalibration.h>

Inheritance diagram for InternalCalibration:
DefaultParamHandler ProgressLogger

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 &param)
 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_
 

Detailed Description

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:

NameTypeDefaultRestrictionsDescription
mz_tolerance float1 min: 0Allowed tolerance between peak and reference m/z.
mz_tolerance_unit stringDa Da, ppmUnit for mz_tolerance.
rt_tolerance int10  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!

Note:

Constructor & Destructor Documentation

Default constructor.

~InternalCalibration ( )
inline

Destructor.

Member Function Documentation

void applyTransformation_ ( FeatureMap &  feature_map)
protected

apply transformation to all features (including subordinates and convex hulls)

void applyTransformation_ ( typename MSExperiment< InputPeakType >::SpectrumType &  spec)
inlineprotected
void applyTransformation_ ( MSExperiment< InputPeakType > &  exp)
inlineprotected
void calibrateMapGlobally ( MSExperiment< InputPeakType > &  exp,
const std::vector< double > &  ref_masses,
const String &  trafo_file_name = "" 
)
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.

Parameters
expThe peak map to calibrate
ref_massesThe reference m/z values
trafo_file_nameOutput file to store the transformation function

References MSExperiment< PeakT, ChromatogramPeakT >::empty(), SpectrumSettings::PEAKS, MSExperiment< PeakT, ChromatogramPeakT >::size(), and TransformationXMLFile::store().

void calibrateMapGlobally ( MSExperiment< InputPeakType > &  exp,
const std::vector< PeptideIdentification > &  ref_ids,
const String &  trafo_file_name = "" 
)
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.

Parameters
expThe peak map to calibrate
ref_idsThe reference peptide identifications
trafo_file_nameOutput 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.

Parameters
feature_mapThe feature map to calibrate (annotated with peptide ids)
trafo_file_nameOutput 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.

Parameters
feature_mapThe feature map to calibrate
ref_idsthe reference peptide identifications
trafo_file_namefile where the transformation function of the calibration is stored
void calibrateMapSpectrumwise ( MSExperiment< InputPeakType > &  exp,
std::vector< double > &  ref_masses 
)
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.

Parameters
expThe peak map to calibrate
ref_massesThe reference m/z values

References MSExperiment< PeakT, ChromatogramPeakT >::empty(), SpectrumSettings::PEAKS, MSExperiment< PeakT, ChromatogramPeakT >::size(), and OpenMS::writtenDigits< double >().

void checkReferenceIds_ ( const std::vector< PeptideIdentification > &  pep_ids)
protected

check if reference ids contain RT and MZ information as meta values

void checkReferenceIds_ ( const FeatureMap &  feature_map)
protected

check if reference ids contain RT and MZ information as meta values

void makeLinearRegression_ ( const std::vector< double > &  observed_masses,
const std::vector< double > &  theoretical_masses 
)
protected

the actual calibration function

Member Data Documentation

TransformationDescription trafo_
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