Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Private Member Functions | Private Attributes

TOFCalibration Class Reference
[SignalProcessing]

This class implements an external calibration for TOF data using external calibrant spectra. More...

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

Inheritance diagram for TOFCalibration:
DefaultParamHandler ProgressLogger

List of all members.

Public Member Functions

 TOFCalibration ()
 Default constructor.
 ~TOFCalibration ()
 Destructor.
template<typename PeakType >
void pickAndCalibrate (MSExperiment< Peak1D > &calib_spectra, MSExperiment< PeakType > &exp, std::vector< double > &exp_masses)
template<typename PeakType >
void calibrate (MSExperiment< Peak1D > &calib_spectra, MSExperiment< PeakType > &exp, std::vector< double > &exp_masses)
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<> &calib_peaks_ft)
 Calculates the coefficients of the quadratic fit used for external calibration.
void getMonoisotopicPeaks_ (MSExperiment<> &calib_peaks, std::vector< std::vector< unsigned int > > &monoiso_peaks)
 determines the monoisotopic peaks
void applyTOFConversion_ (MSExperiment<> &calib_spectra)
 Applies the conversion from TOF to m/z-values to all peaks.
void matchMasses_ (MSExperiment<> &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 calib_peaks_ft_
 the calibrant spectra still using flight times instead of m/z-values
std::vector< doubleexp_masses_
 the expected calibrant masses
std::map< double, std::vector
< double > > 
errors_
 error in ppm after quadratic fit
std::vector< doubleerror_medians_
 median errors
std::vector< doublecalib_masses_
std::vector< doubleml1s_
 calibration constants from the instrument needed for the conversion of the calibrant spectra
std::vector< doubleml2s_
std::vector< doubleml3s_
std::vector< doublecoeff_quad_fit_
 all coefficients of the quadratic fit
double a_
 mean coefficients
double b_
double c_
gsl_interp_accel * acc_
gsl_spline * spline_

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.
The peaks must be sorted according to ascending m/z!

Constructor & Destructor Documentation

TOFCalibration (  ) 

Default constructor.

~TOFCalibration (  ) 

Destructor.


Member Function Documentation

void applyTOFConversion_ ( MSExperiment<> &  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 averageCoefficients_ (  )  [private]

Average the coefficients of the quadratic fit.

void averageErrors_ (  )  [private]

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

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

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

Referenced by TOFCalibration::calibrate().

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

Non-mutable access to the first calibration constant.

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

Non-mutable access to the second calibration constant.

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

Non-mutable access to the third calibration constant.

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

determines the monoisotopic peaks

void matchMasses_ ( MSExperiment<> &  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.

Referenced by TOFCalibration::calibrate().

void pickAndCalibrate ( MSExperiment< Peak1D > &  calib_spectra,
MSExperiment< PeakType > &  exp,
std::vector< double > &  exp_masses 
)
void setML1s ( const std::vector< double > &  ml1s  )  [inline]

mutable access to the first calibration constant

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

mutable access to the second calibration constant

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

mutable access to the third calibration constant


Member Data Documentation

double a_ [private]

mean coefficients

gsl_interp_accel* acc_ [private]
double b_ [private]
double c_ [private]
std::vector<double> calib_masses_ [private]

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

std::vector<double> coeff_quad_fit_ [private]

all coefficients of the quadratic fit

std::vector<double> error_medians_ [private]

median errors

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

error in ppm after quadratic fit

std::vector<double> exp_masses_ [private]

the expected calibrant masses

Referenced by TOFCalibration::calibrate().

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]
gsl_spline* spline_ [private]

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:53 using doxygen 1.7.1