OpenMS
Loading...
Searching...
No Matches
ProSEAlgorithm::MzRecalibration_ Struct Reference

An m/z error model of a run (calibration:recalibrate), fitted to the calibration PSMs and subtracted from the spectra before the main search. More...

#include <OpenMS/ANALYSIS/ID/PROSE/ProSEAlgorithm.h>

Classes

struct  AtRT
 
struct  Chunk
 

Public Member Functions

bool active () const
 
double error (double mz, double rt) const
 the modelled error at (mz, rt)
 
double correct (double mz, double rt) const
 mz without the modelled error
 
double uncorrect (double corrected, double rt) const
 the inverse of correct(): the m/z it maps to corrected
 
AtRT at (double rt) const
 the model at rt (the chunks must not change while the result is used)
 
std::string toString () const
 "ppm; rt <s>: <intercept> + <slope> mz (<points>) | ..." (empty: inactive)
 

Static Public Member Functions

static MzRecalibration_ fit (const std::vector< double > &errors, const std::vector< double > &mzs, const std::vector< double > &rts, Size n_chunks, Size min_points, bool linear, bool ppm)
 

Public Attributes

std::vector< Chunk > chunks
 in RT order; empty: no correction
 
bool ppm {true}
 the error unit: ppm (correction mz - e * mz * 1e-6) or Da (mz - e)
 

Detailed Description

An m/z error model of a run (calibration:recalibrate), fitted to the calibration PSMs and subtracted from the spectra before the main search.

Per retention-time chunk a linear function of m/z of the signed error (observed minus theoretical; the median alone, slope 0, with mode 'offset'), linearly interpolated between the chunks' centres and constant beyond them. The errors are in ppm or in the unit of the tolerance (Da); correct() removes the modelled error from an m/z.


Class Documentation

◆ OpenMS::ProSEAlgorithm::MzRecalibration_::Chunk

struct OpenMS::ProSEAlgorithm::MzRecalibration_::Chunk
Class Members
double intercept
Size points
double rt
double slope

Member Function Documentation

◆ active()

◆ at()

AtRT at ( double  rt) const

the model at rt (the chunks must not change while the result is used)

◆ correct()

double correct ( double  mz,
double  rt 
) const

mz without the modelled error

◆ error()

double error ( double  mz,
double  rt 
) const

the modelled error at (mz, rt)

◆ fit()

static MzRecalibration_ fit ( const std::vector< double > &  errors,
const std::vector< double > &  mzs,
const std::vector< double > &  rts,
Size  n_chunks,
Size  min_points,
bool  linear,
bool  ppm 
)
static

Fit the model: the points (error, m/z, RT) are split in RT order into n_chunks groups of equal size (fewer when a group would hold less than min_points points), each fitted to its points within three robust standard deviations of its median: the median (linear false) or the least-squares line in m/z (linear; the median when the line cannot be fitted). Deterministic (no RANSAC).

◆ toString()

std::string toString ( ) const

"ppm; rt <s>: <intercept> + <slope> mz (<points>) | ..." (empty: inactive)

◆ uncorrect()

double uncorrect ( double  corrected,
double  rt 
) const

the inverse of correct(): the m/z it maps to corrected

Member Data Documentation

◆ chunks

std::vector<Chunk> chunks

in RT order; empty: no correction

◆ ppm

bool ppm {true}

the error unit: ppm (correction mz - e * mz * 1e-6) or Da (mz - e)