A mass recalibration method using linear/quadratic interpolation (robust/weighted) of given reference masses.
More...
|
| InternalCalibration () |
| Default constructor. More...
|
|
| ~InternalCalibration () override |
| Destructor. More...
|
|
Size | fillCalibrants (const PeakMap &exp, const std::vector< InternalCalibration::LockMass > &ref_masses, double tol_ppm, bool lock_require_mono, bool lock_require_iso, CalibrationData &failed_lock_masses, bool verbose=true) |
| Extract calibrants from Raw data (mzML) More...
|
|
Size | fillCalibrants (const FeatureMap &fm, double tol_ppm) |
| Extract calibrants from identifications. More...
|
|
Size | fillCalibrants (const std::vector< PeptideIdentification > &pep_ids, double tol_ppm) |
| Extract calibrants from identifications. More...
|
|
const CalibrationData & | getCalibrationPoints () const |
| Get container of calibration points. More...
|
|
bool | calibrate (PeakMap &exp, const IntList &target_mslvl, MZTrafoModel::MODELTYPE model_type, double rt_chunk, bool use_RANSAC, double post_ppm_median, double post_ppm_MAD, const String &file_models="", const String &file_models_plot="", const String &file_residuals="", const String &file_residuals_plot="", const String &rscript_executable="Rscript") |
| Apply calibration to data. More...
|
|
| 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 (UInt64 bytes_processed=0) const |
|
void | nextProgress () const |
| increment progress by 1 (according to range begin-end) More...
|
|
A mass recalibration method using linear/quadratic interpolation (robust/weighted) of given reference masses.
...
Transform spectra from a whole map (data+precursor)
All data peaks and precursor information (if present) are calibrated in m/z.
Only spectra whose MS-level is contained in 'target_mslvl' are calibrated. In addition, if a fragmentation spectrum's precursor information originates from an MS level in 'target_mslvl', the precursor (not the spectrum itself) is also subjected to calibration. E.g., If we only have MS and MS/MS spectra: for 'target_mslvl' = {1} then all MS1 spectra and MS2 precursors are calibrated. If 'target_mslvl' = {2}, only MS2 spectra (not their precursors) are calibrated. If 'target_mslvl' = {1,2} all spectra and precursors are calibrated.
- Parameters
-
exp | Uncalibrated peak map |
target_mslvl | List (can be unsorted) of MS levels to calibrate |
trafo | The calibration function to apply |
Extract calibrants from identifications.
Extracts only the first hit from the first peptide identification of each feature. Hits are sorted beforehand. Ambiguities should be resolved before, e.g. using IDFilter. RT and m/z are taken from the features, not from the identifications (for an exception see below)!
Unassigned peptide identifications are also taken into account! RT and m/z are naturally taken from the IDs, since to feature is assigned. If you do not want these IDs, remove them from the feature map before calling this function.
A filtering step is done in the m/z dimension using tol_ppm
. Since precursor masses could be annotated wrongly (e.g. isotope peak instead of mono), larger outliers are removed before accepting an ID as calibrant.
- Parameters
-
fm | FeatureMap with peptide identifications |
tol_ppm | Only accept ID's whose theoretical mass deviates at most this much from annotated |
- Returns
- Number of calibration masses found
Extract calibrants from Raw data (mzML)
Lock masses are searched in each spectrum and added to the internal calibrant database.
Filters can be used to exclude spurious peaks, i.e. require the calibrant peak to be monoisotopic or to have a +1 isotope (should not be used for very low abundant calibrants). If a calibrant is not found, it is added to a 'failed_lock_masses' database which is returned and not stored internally. The intensity of the peaks describe the reason for failed detection: 0.0 - peak not found with the given ppm tolerance; 1.0 - peak is not monoisotopic (can only occur if 'lock_require_mono' is true) 2.0 - peak has no +1 isotope (can only occur if 'lock_require_iso' is true)
- Parameters
-
exp | Peak map containing the lock masses |
ref_masses | List of lock masses |
tol_ppm | Search window for lock masses in 'exp' |
lock_require_mono | Require that a lock mass is the monoisotopic peak (i.e. not an isotope peak) – lock mass is rejected otherwise |
lock_require_iso | Require that a lock mass has isotope peaks to its right – lock mass is rejected otherwise |
failed_lock_masses | Set of calibration masses which were not found, i.e. their expected m/z and RT positions; |
verbose | Print information on 'lock_require_XXX' matches during search |
- Returns
- Number of calibration masses found
Extract calibrants from identifications.
Extracts only the first hit from each peptide identification. Hits are sorted beforehand. Ambiguities should be resolved before, e.g. using IDFilter.
A filtering step is done in the m/z dimension using tol_ppm
. Since precursor masses could be annotated wrongly (e.g. isotope peak instead of mono), larger outliers are removed before accepting an ID as calibrant.
- Parameters
-
pep_ids | Peptide ids (e.g. from an idXML file) |
tol_ppm | Only accept ID's whose theoretical mass deviates at most this much from annotated |
- Returns
- Number of calibration masses found
Add(no prior clear) calibrants to internal list.
Extracts only the first hit from each peptide identification. Hits are sorted beforehand. Ambiguities should be resolved before, e.g. using IDFilter.
A filtering step is done in the m/z dimension using tol_ppm
. Since precursor masses could be annotated wrongly (e.g. isotope peak instead of mono), larger outliers are removed before accepting an ID as calibrant.
- Parameters
-
pep_id | A single PeptideID (e.g. from an idXML file); only the top peptide hit is used |
tol_ppm | Only accept ID's whose theoretical mass deviates at most this much from annotated |
stats | Update stats, if calibrant cannot be used (no RT, no MZ, no sequence, out-of tolerance) |