OpenMS
|
A helper class, holding all calibration points. More...
#include <OpenMS/DATASTRUCTURES/CalibrationData.h>
Public Types | |
typedef RichPeak2D | CalDataType |
typedef std::vector< CalDataType >::const_iterator | const_iterator |
typedef std::vector< CalDataType >::value_type | value_type |
Public Member Functions | |
CalibrationData () | |
Default constructor. More... | |
CalDataType::CoordinateType | getMZ (Size i) const |
Retrieve the observed m/z of the i'th calibration point. More... | |
CalDataType::CoordinateType | getRT (Size i) const |
Retrieve the observed RT of the i'th calibration point. More... | |
CalDataType::CoordinateType | getIntensity (Size i) const |
Retrieve the intensity of the i'th calibration point. More... | |
const_iterator | begin () const |
Begin iterator for calibration points. More... | |
const_iterator | end () const |
Past-the-end iterator for calibration points. More... | |
Size | size () const |
Number of calibration points. More... | |
bool | empty () const |
Do we have any calibration points. More... | |
void | clear () |
Remove all calibration points. More... | |
void | setUsePPM (bool usePPM) |
When calling getError(), should ppm error or m/z error be returned? More... | |
bool | usePPM () const |
Current error unit (ppm or Th) More... | |
void | insertCalibrationPoint (CalDataType::CoordinateType rt, CalDataType::CoordinateType mz_obs, CalDataType::IntensityType intensity, CalDataType::CoordinateType mz_ref, double weight, int group=-1) |
Add a new calibration point. More... | |
Size | getNrOfGroups () const |
Number of peak groups (can be 0). More... | |
CalDataType::CoordinateType | getError (Size i) const |
Retrieve the error for i'th calibrant in either ppm or Th (depending on usePPM()) More... | |
CalDataType::CoordinateType | getRefMZ (Size i) const |
Retrieve the theoretical m/z of the i'th calibration point. More... | |
CalDataType::CoordinateType | getWeight (Size i) const |
Retrieve the weight of the i'th calibration point. More... | |
int | getGroup (Size i) const |
Retrieve the group of the i'th calibration point. More... | |
CalibrationData | median (double rt_left, double rt_right) const |
Compute the median in the given RT range for every peak group. More... | |
void | sortByRT () |
Sort calibration points by RT, to allow for valid RT chunking. More... | |
Static Public Member Functions | |
static StringList | getMetaValues () |
List of meta-values which are used internally (for conversion to PeakMap). More... | |
Private Attributes | |
std::vector< RichPeak2D > | data_ |
calibration points More... | |
bool | use_ppm_ |
return ppm values as y-values for the model instead of absolute delta in [Th] More... | |
std::set< int > | groups_ |
peak groups present in this data More... | |
A helper class, holding all calibration points.
Calibration points can be filled from Peptide IDs (using FeatureMaps or vector<PeptideIds>) or from lock masses in Raw data (MSExperiment).
The m/z error can be queried using getError(). The unit of error is either ppm or Th, depending on usePPM().
Each calibration point can be assigned to a peak group. This should be done for calibration points derived from lock masses, to enable querying for a medianized representation of a lock mass trace in a certain RT range (see median()). For calibration points derived from peptide IDs, this does not make sense.
From this data, a calibration function can be computed (see MZTrafoModel class).
typedef RichPeak2D CalDataType |
typedef std::vector<CalDataType>::const_iterator const_iterator |
typedef std::vector<CalDataType>::value_type value_type |
CalibrationData | ( | ) |
Default constructor.
const_iterator begin | ( | ) | const |
Begin iterator for calibration points.
void clear | ( | ) |
Remove all calibration points.
bool empty | ( | ) | const |
Do we have any calibration points.
const_iterator end | ( | ) | const |
Past-the-end iterator for calibration points.
CalDataType::CoordinateType getError | ( | Size | i | ) | const |
Retrieve the error for i'th calibrant in either ppm or Th (depending on usePPM())
int getGroup | ( | Size | i | ) | const |
Retrieve the group of the i'th calibration point.
i | Index |
CalDataType::CoordinateType getIntensity | ( | Size | i | ) | const |
Retrieve the intensity of the i'th calibration point.
|
static |
List of meta-values which are used internally (for conversion to PeakMap).
CalDataType::CoordinateType getMZ | ( | Size | i | ) | const |
Retrieve the observed m/z of the i'th calibration point.
Size getNrOfGroups | ( | ) | const |
Number of peak groups (can be 0).
CalDataType::CoordinateType getRefMZ | ( | Size | i | ) | const |
Retrieve the theoretical m/z of the i'th calibration point.
CalDataType::CoordinateType getRT | ( | Size | i | ) | const |
Retrieve the observed RT of the i'th calibration point.
CalDataType::CoordinateType getWeight | ( | Size | i | ) | const |
Retrieve the weight of the i'th calibration point.
void insertCalibrationPoint | ( | CalDataType::CoordinateType | rt, |
CalDataType::CoordinateType | mz_obs, | ||
CalDataType::IntensityType | intensity, | ||
CalDataType::CoordinateType | mz_ref, | ||
double | weight, | ||
int | group = -1 |
||
) |
Add a new calibration point.
rt | Retention time |
mz_obs | Observed m/z |
intensity | Intensity (useful for weighted model fitting) |
mz_ref | Theoretical m/z |
weight | Weight of calibration point (useful for weighted model fitting) |
group | Peak group of this calibration point. Using -1 will not assign any peak group. See also: median() |
CalibrationData median | ( | double | rt_left, |
double | rt_right | ||
) | const |
Compute the median in the given RT range for every peak group.
This is usually applied on calibration data obtained from lock masses, where each lock mass has its own peak group. Median() then computes an 'medianized' observed(!) lock mass within a certain RT range and returns calibration data with one calibration point per group. Also intensity is 'medianized'. The theoretical m/z is expected to be identical for all calibration points in a peak group.
Groups must be specified during insertCalibrationPoint(). If no groups are present, the result is empty.
The container must be sorted by RT (see sortByRT())!
rt_left | Left border of RT range to medianize |
rt_right | Right border of RT range to medianize |
void setUsePPM | ( | bool | usePPM | ) |
When calling getError(), should ppm error or m/z error be returned?
Size size | ( | ) | const |
Number of calibration points.
void sortByRT | ( | ) |
Sort calibration points by RT, to allow for valid RT chunking.
bool usePPM | ( | ) | const |
Current error unit (ppm or Th)
|
private |
calibration points
|
private |
peak groups present in this data
|
private |
return ppm values as y-values for the model instead of absolute delta in [Th]