OpenMS
|
This class implements an external calibration for TOF data using external calibrant spectra. More...
#include <OpenMS/FILTERING/CALIBRATION/TOFCalibration.h>
Public Member Functions | |
TOFCalibration () | |
Default constructor. More... | |
~TOFCalibration () override | |
Destructor. More... | |
void | pickAndCalibrate (PeakMap &calib_spectra, PeakMap &exp, std::vector< double > &exp_masses) |
void | calibrate (PeakMap &calib_spectra, PeakMap &exp, std::vector< double > &exp_masses) |
const std::vector< double > & | getML1s () const |
Non-mutable access to the first calibration constant. More... | |
void | setML1s (const std::vector< double > &ml1s) |
mutable access to the first calibration constant More... | |
const std::vector< double > & | getML2s () const |
Non-mutable access to the second calibration constant. More... | |
void | setML2s (const std::vector< double > &ml2s) |
mutable access to the second calibration constant More... | |
const std::vector< double > & | getML3s () const |
Non-mutable access to the third calibration constant. More... | |
void | setML3s (const std::vector< double > &ml3s) |
mutable access to the third calibration constant 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... | |
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... | |
virtual | ~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... | |
void | nextProgress () const |
increment progress by 1 (according to range begin-end) More... | |
Private Member Functions | |
void | calculateCalibCoeffs_ (PeakMap &calib_peaks_ft) |
Calculates the coefficients of the quadratic fit used for external calibration. More... | |
void | getMonoisotopicPeaks_ (PeakMap &calib_peaks, std::vector< std::vector< unsigned int > > &monoiso_peaks) |
determines the monoisotopic peaks More... | |
void | applyTOFConversion_ (PeakMap &calib_spectra) |
Applies the conversion from TOF to m/z-values to all peaks. More... | |
void | matchMasses_ (PeakMap &calib_peaks, std::vector< std::vector< unsigned int > > &monoiso_peaks, std::vector< unsigned int > &obs_masses, std::vector< double > &exp_masses, unsigned int idx) |
determine the monoisotopic masses that have matching expected masses More... | |
double | mQ_ (double ft, unsigned int spec) |
Calculate the mass value for a given flight time using the coefficients of the quadratic fit in a specific spectrum. More... | |
double | mQAv_ (double ft) const |
Calculate the mass value for a given flight time using the averaged coefficients of the quadratic fit. More... | |
void | averageErrors_ () |
Calculate the average errors of the reference masses over all scans. More... | |
void | averageCoefficients_ () |
Average the coefficients of the quadratic fit. More... | |
Private Attributes | |
PeakMap | calib_peaks_ft_ |
the calibrant spectra still using flight times instead of m/z-values More... | |
std::vector< double > | exp_masses_ |
the expected calibrant masses More... | |
std::map< double, std::vector< double > > | errors_ |
error in ppm after quadratic fit More... | |
std::vector< double > | error_medians_ |
median errors More... | |
std::vector< double > | calib_masses_ |
std::vector< double > | ml1s_ |
calibration constants from the instrument needed for the conversion of the calibrant spectra More... | |
std::vector< double > | ml2s_ |
std::vector< double > | ml3s_ |
std::vector< double > | coeff_quad_fit_ |
all coefficients of the quadratic fit More... | |
double | a_ |
mean coefficients More... | |
double | b_ |
double | c_ |
Additional Inherited Members | |
Public Types inherited from ProgressLogger | |
enum | LogType { CMD , GUI , NONE } |
Possible log types. More... | |
Static Public Member Functions inherited from DefaultParamHandler | |
static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="") |
Writes all parameters to meta values. More... | |
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... | |
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... | |
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_ |
Static Protected Attributes inherited from ProgressLogger | |
static int | recursion_depth_ |
This class implements an external calibration for TOF data using external calibrant spectra.
The procedure is very similar to the one described in Gobom et al. (Anal Chem. 2002, 74 (15) pp 3915-23). The input experiment data need to be flight times. They are converted into m/z-values using the calibrant spectra. The calibrant spectra and their expected masses are used to determine the quadratic dependence of TOF and m/z values.
TOFCalibration | ( | ) |
Default constructor.
|
override |
Destructor.
|
private |
Applies the conversion from TOF to m/z-values to all peaks.
Either a 2-point or a 3-point time of flight conversion can be used, as well as different constants for each calibrant spectra or one set for all of them.
The 2-point equation is mass = ml1/10^12 * (TOF * 1000 - ml2). The 3-point equation is time = ml2 + sqrt(10^12/ml1 * mass) + ml3*mass.
|
private |
Average the coefficients of the quadratic fit.
|
private |
Calculate the average errors of the reference masses over all scans.
|
private |
Calculates the coefficients of the quadratic fit used for external calibration.
|
inline |
Non-mutable access to the first calibration constant.
|
inline |
Non-mutable access to the second calibration constant.
|
inline |
Non-mutable access to the third calibration constant.
|
private |
determines the monoisotopic peaks
|
private |
determine the monoisotopic masses that have matching expected masses
|
inlineprivate |
Calculate the mass value for a given flight time using the coefficients of the quadratic fit in a specific spectrum.
|
inlineprivate |
Calculate the mass value for a given flight time using the averaged coefficients of the quadratic fit.
void pickAndCalibrate | ( | PeakMap & | calib_spectra, |
PeakMap & | exp, | ||
std::vector< double > & | exp_masses | ||
) |
|
inline |
mutable access to the first calibration constant
|
inline |
mutable access to the second calibration constant
|
inline |
mutable access to the third calibration constant
|
private |
mean coefficients
|
private |
|
private |
|
private |
|
private |
the calibrant spectra still using flight times instead of m/z-values
|
private |
all coefficients of the quadratic fit
|
private |
median errors
|
private |
error in ppm after quadratic fit
|
private |
the expected calibrant masses
|
private |
calibration constants from the instrument needed for the conversion of the calibrant spectra
|
private |
|
private |