Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

TOFCalibration Class Reference

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

Inheritance diagram for TOFCalibration:

DefaultParamHandler ProgressLogger

List of all members.


Detailed Description

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 dependance of tof and m/z values.

Note:
The input spectra need to contain flight times.

Public Types

typedef RawDataPoint1D RawDataPointType
 Raw data point type.
typedef PickedPeak1D PickedPeakType
 Picked Peak type.

Public Member Functions

 TOFCalibration ()
 Default constructor.
 ~TOFCalibration ()
 Destructor.
template<typename PeakType>
void calibrate (MSExperiment< RawDataPointType > &calib_spectra, MSExperiment< PeakType > &exp, std::vector< double > &exp_masses)
 Apply the external calibration using raw calibrant spectra.
template<typename PeakType>
void calibrate (MSExperiment< PickedPeakType > &calib_spectra, MSExperiment< PeakType > &exp, std::vector< double > &exp_masses)
 Apply the external calibration using picked calibrant spectra.
const std::vector< double > & getML1s () const
 Non-mutable access to the first calibration constant.
void setML1s (const std::vector< double > &ml1s)
 mutable access to the first calibration constant
const std::vector< double > & getML2s () const
 Non-mutable access to the second calibration constant.
void setML2s (const std::vector< double > &ml2s)
 mutable access to the second calibration constant
const std::vector< double > & getML3s () const
 Non-mutable access to the third calibration constant.
void setML3s (const std::vector< double > &ml3s)
 mutable access to the third calibration constant

Private Member Functions

void calculateCalibCoeffs_ (MSExperiment< PickedPeakType > &calib_peaks_ft) throw (UnableToCalibrate)
 Calculates the coefficients of the quadratic fit used for external calibration.
void getMonoisotopicPeaks_ (MSExperiment< PickedPeakType > &calib_peaks, std::vector< std::vector< unsigned int > > &monoiso_peaks)
 determines the monoisotopic peaks
void applyTOFConversion_ (MSExperiment< PickedPeakType > &calib_spectra)
 Applies the conversion from TOF to m/z-values to all peaks.
void matchMasses_ (MSExperiment< PickedPeakType > &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
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.
double mQAv_ (double ft)
 Calculate the mass value for a given flight time using the averaged coefficients of the quadratic fit.
void averageErrors_ ()
 Calculate the average errors of the reference masses over all scans.
void averageCoefficients_ ()
 Average the coefficients of the quadratic fit.

Private Attributes

MSExperiment< PickedPeakTypecalib_peaks_ft_
 the calibrant spectra still using flight times instead of m/z-values
std::vector< double > exp_masses_
 the expected calibrant masses
std::map< double, std::vector
< double > > 
errors_
 error in ppm after quadratic fit
std::vector< double > error_medians_
 median errors
std::vector< double > calib_masses_
std::vector< double > ml1s_
 calibration constants from the instrument needed for the conversion of the calibrant spectra
std::vector< double > ml2s_
std::vector< double > ml3s_
std::vector< double > coeff_quad_fit_
 all coefficients of the quadratic fit
double a_
 mean coefficients
double b_
double c_
gsl_interp_accel * acc_
gsl_spline * spline_

Classes

class  UnableToCalibrate
 Inner Classes for Exception handling. More...

Member Typedef Documentation

typedef RawDataPoint1D RawDataPointType

Raw data point type.

typedef PickedPeak1D PickedPeakType

Picked Peak type.


Constructor & Destructor Documentation

TOFCalibration (  ) 

Default constructor.

~TOFCalibration (  ) 

Destructor.


Member Function Documentation

void calibrate ( MSExperiment< RawDataPointType > &  calib_spectra,
MSExperiment< PeakType > &  exp,
std::vector< double > &  exp_masses 
) [inline]

Apply the external calibration using raw calibrant spectra.

void calibrate ( MSExperiment< PickedPeakType > &  calib_spectra,
MSExperiment< PeakType > &  exp,
std::vector< double > &  exp_masses 
) [inline]

Apply the external calibration using picked calibrant spectra.

const std::vector<double>& getML1s (  )  const [inline]

Non-mutable access to the first calibration constant.

void setML1s ( const std::vector< double > &  ml1s  )  [inline]

mutable access to the first calibration constant

const std::vector<double>& getML2s (  )  const [inline]

Non-mutable access to the second calibration constant.

void setML2s ( const std::vector< double > &  ml2s  )  [inline]

mutable access to the second calibration constant

const std::vector<double>& getML3s (  )  const [inline]

Non-mutable access to the third calibration constant.

void setML3s ( const std::vector< double > &  ml3s  )  [inline]

mutable access to the third calibration constant

void calculateCalibCoeffs_ ( MSExperiment< PickedPeakType > &  calib_peaks_ft  )  throw (UnableToCalibrate) [private]

Calculates the coefficients of the quadratic fit used for external calibration.

void getMonoisotopicPeaks_ ( MSExperiment< PickedPeakType > &  calib_peaks,
std::vector< std::vector< unsigned int > > &  monoiso_peaks 
) [private]

determines the monoisotopic peaks

void applyTOFConversion_ ( MSExperiment< PickedPeakType > &  calib_spectra  )  [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.

void matchMasses_ ( MSExperiment< PickedPeakType > &  calib_peaks,
std::vector< std::vector< unsigned int > > &  monoiso_peaks,
std::vector< unsigned int > &  obs_masses,
std::vector< double > &  exp_masses,
unsigned int  idx 
) [private]

determine the monoisotopic masses that have matching expected masses

double mQ_ ( double  ft,
unsigned int  spec 
) [inline, private]

Calculate the mass value for a given flight time using the coefficients of the quadratic fit in a specific spectrum.

double mQAv_ ( double  ft  )  [inline, private]

Calculate the mass value for a given flight time using the averaged coefficients of the quadratic fit.

void averageErrors_ (  )  [private]

Calculate the average errors of the reference masses over all scans.

void averageCoefficients_ (  )  [private]

Average the coefficients of the quadratic fit.


Member Data Documentation

MSExperiment<PickedPeakType> calib_peaks_ft_ [private]

the calibrant spectra still using flight times instead of m/z-values

std::vector<double> exp_masses_ [private]

the expected calibrant masses

std::map<double,std::vector<double> > errors_ [private]

error in ppm after quadratic fit

std::vector<double> error_medians_ [private]

median errors

std::vector<double> calib_masses_ [private]

std::vector<double> ml1s_ [private]

calibration constants from the instrument needed for the conversion of the calibrant spectra

std::vector<double> ml2s_ [private]

std::vector<double> ml3s_ [private]

std::vector<double> coeff_quad_fit_ [private]

all coefficients of the quadratic fit

double a_ [private]

mean coefficients

double b_ [private]

double c_ [private]

gsl_interp_accel* acc_ [private]

gsl_spline* spline_ [private]


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:44 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1