![]() |
OpenMS
|
Scoring of an spectrum at the peak apex of an chromatographic elution peak. More...
#include <OpenMS/ANALYSIS/OPENSWATH/DIAScoring.h>
Public Member Functions | |
Constructors and Destructor | |
| DIAScoring () | |
| Default constructor. | |
| ~DIAScoring () override | |
| Destructor. | |
Public Member Functions inherited from DefaultParamHandler | |
| DefaultParamHandler (const std::string &name) | |
| Constructor with name that is displayed in error messages. | |
| DefaultParamHandler (const DefaultParamHandler &rhs) | |
| Copy constructor. | |
| virtual | ~DefaultParamHandler () |
| Destructor. | |
| DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
| Assignment operator. | |
| virtual bool | operator== (const DefaultParamHandler &rhs) const |
| Equality operator. | |
| void | setParameters (const Param ¶m) |
| Sets the parameters. | |
| const Param & | getParameters () const |
| Non-mutable access to the parameters. | |
| const Param & | getDefaults () const |
| Non-mutable access to the default parameters. | |
| const std::string & | getName () const |
| Non-mutable access to the name. | |
| void | setName (const std::string &name) |
| Mutable access to the name. | |
| const std::vector< std::string > & | getSubsections () const |
| Non-mutable access to the registered subsections. | |
Private Types | |
| typedef OpenSwath::SpectrumPtr | SpectrumPtrType |
| Type definitions. | |
| typedef OpenSwath::LightTransition | TransitionType |
| Transition interface (Transition, Peptide, Protein) | |
DIA Scores | |
| double | dia_extract_window_ |
| double | dia_byseries_intensity_min_ |
| double | dia_byseries_ppm_diff_ |
| double | dia_nr_isotopes_ |
| double | dia_nr_charges_ |
| double | peak_before_mono_max_ppm_diff_ |
| bool | dia_extraction_ppm_ |
| bool | dia_centroided_ |
| TheoreticalSpectrumGenerator * | generator |
| void | dia_isotope_scores (const std::vector< TransitionType > &transitions, SpectrumSequence &spectrum, OpenSwath::IMRMFeature *mrmfeature, const RangeMobility &im_range, double &isotope_corr, double &isotope_overlap) const |
| Compute the isotope-pattern correlation and isotope-overlap scores for a transition group (see class description). | |
| void | dia_massdiff_score (const std::vector< TransitionType > &transitions, const SpectrumSequence &spectrum, const std::vector< double > &normalized_library_intensity, const RangeMobility &im_range, double &ppm_score, double &ppm_score_weighted, std::vector< double > &diff_ppm) const |
| Compute fragment-ion mass-error scores in ppm against the theoretical product m/z of each transition. | |
| bool | dia_ms1_massdiff_score (double precursor_mz, const SpectrumSequence &spectrum, const RangeMobility &im_range, double &ppm_score) const |
| Compute the precursor-mass-error score on an MS1 spectrum. | |
| void | dia_ms1_isotope_scores_averagine (double precursor_mz, const SpectrumSequence &spectrum, int charge_state, RangeMobility &im_range, double &isotope_corr, double &isotope_overlap) const |
| Precursor isotope-pattern scores using an averagine model. | |
| void | dia_ms1_isotope_scores (double precursor_mz, const std::vector< SpectrumPtrType > &spectrum, RangeMobility &im_range, double &isotope_corr, double &isotope_overlap, const EmpiricalFormula &sum_formula) const |
| Precursor isotope-pattern scores using an explicit sum formula. | |
| void | dia_by_ion_score (const SpectrumSequence &spectrum, AASequence &sequence, int charge, const RangeMobility &im_range, double &bseries_score, double &yseries_score) const |
| Count the b- and y-fragment ions of a peptide that have evidence in a DIA spectrum. | |
| void | score_with_isotopes (SpectrumSequence &spectrum, const std::vector< TransitionType > &transitions, const RangeMobility &im_range, double &dotprod, double &manhattan) const |
| Dot-product and Manhattan-distance scores between the spectrum and the transition group's theoretical isotope pattern. | |
| double | getDIAExtractionWindow () const |
| Return the DIA extraction window. | |
| bool | isDIAExtractionPPM () const |
| Return whether the DIA extraction window is interpreted in ppm. | |
| DIAScoring (const DIAScoring &rhs) | |
| Copy constructor (algorithm class) | |
| DIAScoring & | operator= (const DIAScoring &rhs) |
| Assignment operator (algorithm class) | |
| void | updateMembers_ () override |
| Synchronize members with param class. | |
| void | diaIsotopeScoresSub_ (const std::vector< TransitionType > &transitions, const SpectrumSequence &spectrum, OpenSwath::IMRMFeature *mrmfeature, const RangeMobility &im_range, double &isotope_corr, double &isotope_overlap) const |
| Subfunction of dia_isotope_scores. | |
| void | largePeaksBeforeFirstIsotope_ (const SpectrumSequence &spectrum, double mono_mz, double mono_int, int &nr_occurrences, double &max_ratio, const RangeMobility &im_range) const |
| Determine whether the current m/z value is a monoisotopic peak. | |
| double | scoreIsotopePattern_ (const std::vector< double > &isotopes_int, double product_mz, int putative_fragment_charge) const |
| Compare an experimental isotope pattern to a theoretical one. | |
| double | scoreIsotopePattern_ (const std::vector< double > &isotopes_int, const EmpiricalFormula &sum_formula) const |
| Compare an experimental isotope pattern to a theoretical one. | |
| double | scoreIsotopePattern_ (const std::vector< double > &isotopes_int, const IsotopeDistribution &isotope_dist) const |
| Compare an experimental isotope pattern to a theoretical one. | |
| void | getIsotopeIntysFromExpSpec_ (double precursor_mz, const SpectrumSequence &spectrum, int charge_state, const RangeMobility &im_range, std::vector< double > &isotopes_int) const |
Additional Inherited Members | |
Static Public Member Functions inherited from DefaultParamHandler | |
| static void | writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const std::string &key_prefix="") |
| Writes all parameters to meta values. | |
Protected Member Functions inherited from DefaultParamHandler | |
| void | defaultsToParam_ () |
| Updates the parameters after the defaults have been set in the constructor. | |
Protected Attributes inherited from DefaultParamHandler | |
| Param | param_ |
| Container for current parameters. | |
| Param | defaults_ |
| Container for default parameters. This member should be filled in the constructor of derived classes! | |
| std::vector< std::string > | subsections_ |
| Container for registered subsections. This member should be filled in the constructor of derived classes! | |
| std::string | error_name_ |
| Name that is displayed in error messages during the parameter checking. | |
| bool | check_defaults_ |
| If this member is set to false no checking if parameters in done;. | |
| bool | warn_empty_defaults_ |
| If this member is set to false no warning is emitted when defaults are empty;. | |
Scoring of an spectrum at the peak apex of an chromatographic elution peak.
In DIA (data independent acquisition) / SWATH analysis, at each chromatographic point a full MS2 spectrum is recorded. This class allows to compute a number of scores based on the full MS2 spectrum available. The scores are the following:
This class expects spectra objects that implement the OpenSWATH Spectrum interface. Transitions are expected to be in the light transition format (defined in OPENSWATHALGO/DATAACCESS/TransitionExperiment.h).
Parameters of this class are:| Name | Type | Default | Restrictions | Description |
|---|---|---|---|---|
| dia_extraction_window | float | 0.05 | min: 0.0 | DIA extraction window in Th or ppm. |
| dia_extraction_unit | string | Th | Th, ppm | DIA extraction window unit |
| dia_centroided | string | false | true, false | Use centroided DIA data. |
| dia_byseries_intensity_min | float | 300.0 | min: 0.0 | DIA b/y series minimum intensity to consider. |
| dia_byseries_ppm_diff | float | 10.0 | min: 0.0 | DIA b/y series minimal difference in ppm to consider. |
| dia_nr_isotopes | int | 4 | min: 0 | DIA number of isotopes to consider. |
| dia_nr_charges | int | 4 | min: 0 | DIA number of charges to consider. |
| peak_before_mono_max_ppm_diff | float | 20.0 | min: 0.0 | DIA maximal difference in ppm to count a peak at lower m/z when searching for evidence that a peak might not be monoisotopic. |
|
private |
Type definitions.
Spectrum type, see Spectrum interface
|
private |
Transition interface (Transition, Peptide, Protein)
| DIAScoring | ( | ) |
Default constructor.
|
override |
Destructor.
|
private |
Copy constructor (algorithm class)
| void dia_by_ion_score | ( | const SpectrumSequence & | spectrum, |
| AASequence & | sequence, | ||
| int | charge, | ||
| const RangeMobility & | im_range, | ||
| double & | bseries_score, | ||
| double & | yseries_score | ||
| ) | const |
Count the b- and y-fragment ions of a peptide that have evidence in a DIA spectrum.
For every b/y ion of sequence at the given charge, a peak is considered a match if its ppm error is below "dia_byseries_ppm_diff" and its intensity is above "dia_byseries_intensity_min". The returned scores are the number of matching b- and y-ions.
| [in] | spectrum | DIA MS2 spectrum sequence. |
| [in] | sequence | Peptide sequence. |
| [in] | charge | Fragment-ion charge state. Must be > 0; passing a non-positive value is a programming error (checked in debug builds). |
| [in] | im_range | Ion-mobility range filter; pass an empty range to disable IM filtering. |
| [out] | bseries_score | Number of matching b-ions. |
| [out] | yseries_score | Number of matching y-ions. |
| void dia_isotope_scores | ( | const std::vector< TransitionType > & | transitions, |
| SpectrumSequence & | spectrum, | ||
| OpenSwath::IMRMFeature * | mrmfeature, | ||
| const RangeMobility & | im_range, | ||
| double & | isotope_corr, | ||
| double & | isotope_overlap | ||
| ) | const |
Compute the isotope-pattern correlation and isotope-overlap scores for a transition group (see class description).
Delegates to the internal diaIsotopeScoresSub_ after zero-initialising the two output arguments. mrmfeature is consulted for per-transition apex intensities used to weight the correlation.
| [in] | transitions | Transitions whose fragment-ion isotope patterns are scored. |
| [in] | spectrum | DIA MS2 spectrum sequence (one or more spectra around the apex) the patterns are read from. |
| [in] | mrmfeature | MRM feature providing per-transition apex intensities used to weight the correlation. |
| [in] | im_range | Ion-mobility range filter; pass an empty range to disable IM filtering. |
| [out] | isotope_corr | Intensity-weighted Pearson correlation against the averagine isotope distribution (higher = better). |
| [out] | isotope_overlap | Intensity-weighted count of peaks at lower m/z than each transition's monoisotope (lower = better). |
| void dia_massdiff_score | ( | const std::vector< TransitionType > & | transitions, |
| const SpectrumSequence & | spectrum, | ||
| const std::vector< double > & | normalized_library_intensity, | ||
| const RangeMobility & | im_range, | ||
| double & | ppm_score, | ||
| double & | ppm_score_weighted, | ||
| std::vector< double > & | diff_ppm | ||
| ) | const |
Compute fragment-ion mass-error scores in ppm against the theoretical product m/z of each transition.
For every transition, integrates the spectrum in a window around the theoretical product m/z (window width and ppm-vs-Th controlled by parameter "dia_extraction_window" and "dia_extraction_unit") and records the signed ppm error between the measured and theoretical m/z. Transitions where no signal was found contribute -1.0 to diff_ppm and are excluded from the averages.
| [in] | transitions | Transitions whose theoretical product m/z values are the targets. |
| [in] | spectrum | DIA MS2 spectrum sequence. |
| [in] | normalized_library_intensity | Per-transition library intensities (parallel to transitions) used to weight ppm_score_weighted. |
| [in] | im_range | Ion-mobility range filter; pass an empty range to disable IM filtering. |
| [out] | ppm_score | Mean of the absolute ppm errors over observed transitions (0 if none observed). |
| [out] | ppm_score_weighted | Sum of |ppm| * normalized_library_intensity over observed transitions. |
| [out] | diff_ppm | Per-transition signed ppm error; -1.0 entries mark transitions with no signal in the extraction window. |
| void dia_ms1_isotope_scores | ( | double | precursor_mz, |
| const std::vector< SpectrumPtrType > & | spectrum, | ||
| RangeMobility & | im_range, | ||
| double & | isotope_corr, | ||
| double & | isotope_overlap, | ||
| const EmpiricalFormula & | sum_formula | ||
| ) | const |
Precursor isotope-pattern scores using an explicit sum formula.
Builds the theoretical pattern from sum_formula (and uses its charge), then places it at precursor_mz (the actual precursor m/z, which may differ slightly from what sum_formula would predict — e.g. when adducts are present).
| [in] | precursor_mz | Exact m/z of the precursor to be evaluated. |
| [in] | spectrum | MS1 spectrum sequence. |
| [in,out] | im_range | Ion-mobility range filter; may be narrowed during the call. |
| [out] | isotope_corr | Pearson correlation against the formula-derived isotope distribution. |
| [out] | isotope_overlap | Count of peaks at lower m/z that could explain precursor_mz as part of a larger isotope envelope. |
| [in] | sum_formula | Neutral sum formula of the precursor compound; its getCharge() is used for the isotope spacing. |
| void dia_ms1_isotope_scores_averagine | ( | double | precursor_mz, |
| const SpectrumSequence & | spectrum, | ||
| int | charge_state, | ||
| RangeMobility & | im_range, | ||
| double & | isotope_corr, | ||
| double & | isotope_overlap | ||
| ) | const |
Precursor isotope-pattern scores using an averagine model.
Drives the same scoring as dia_ms1_isotope_scores but builds the theoretical isotope pattern via an averagine model parameterised by precursor_mz and charge_state (suitable for peptides where no exact sum formula is available).
| [in] | precursor_mz | Exact m/z of the precursor to be evaluated. |
| [in] | spectrum | MS1 spectrum sequence. |
| [in] | charge_state | Precursor charge state used to space the averagine isotope envelope. |
| [in,out] | im_range | Ion-mobility range filter; may be narrowed during the call. |
| [out] | isotope_corr | Pearson correlation against the averagine isotope distribution. |
| [out] | isotope_overlap | Count of peaks at lower m/z that could explain precursor_mz as part of a larger isotope envelope. |
| bool dia_ms1_massdiff_score | ( | double | precursor_mz, |
| const SpectrumSequence & | spectrum, | ||
| const RangeMobility & | im_range, | ||
| double & | ppm_score | ||
| ) | const |
Compute the precursor-mass-error score on an MS1 spectrum.
Integrates the spectrum in a window around precursor_mz and reports the absolute ppm difference between the measured and theoretical m/z.
| [in] | precursor_mz | Exact m/z of the precursor to be evaluated. |
| [in] | spectrum | MS1 spectrum sequence. |
| [in] | im_range | Ion-mobility range filter; pass an empty range to disable IM filtering. |
| [out] | ppm_score | On success, the absolute ppm error of the measured peak. On failure (no signal found), set to the absolute ppm width of the extraction window as a worst-case bound — not -1. |
true if a signal was integrated successfully, false if no peak was found inside the extraction window (in which case ppm_score still carries the worst-case bound described above).
|
private |
Subfunction of dia_isotope_scores.
|
inline |
Return the DIA extraction window.
The value is expressed in Thomson or ppm, depending on isDIAExtractionPPM().
|
private |
Get the intensities of isotopes around precursor_mz in experimental spectrum and fill isotopes_int.
|
inline |
Return whether the DIA extraction window is interpreted in ppm.
Returns false when the extraction window is interpreted in Thomson.
|
private |
Determine whether the current m/z value is a monoisotopic peak.
This function will try to determine whether the current peak is a monoisotopic peak or not. It will do so by searching for an intense peak at a lower m/z that could explain the current peak as part of a isotope pattern.
| [in] | spectrum | The spectrum (MS1 or MS2) |
| [in] | mono_mz | The m/z value where a monoisotopic is expected |
| [in] | mono_int | The intensity of the monoisotopic peak (peak at mono_mz) |
| [out] | nr_occurrences | Will contain the count of how often a peak is found at lower m/z than mono_mz with an intensity higher than mono_int. Multiple charge states are tested, see class parameter dia_nr_charges_ |
| [out] | max_ratio | Will contain the maximum ratio of a peaks intensity compared to the monoisotopic peak intensity how often a peak is found at lower m/z than mono_mz with an intensity higher than mono_int. Multiple charge states are tested, see class parameter dia_nr_charges_ |
| [in] | im_range | Ion mobility subrange to consider (used as filter); can be empty (i.e. no IM filtering) |
|
private |
Assignment operator (algorithm class)
| void score_with_isotopes | ( | SpectrumSequence & | spectrum, |
| const std::vector< TransitionType > & | transitions, | ||
| const RangeMobility & | im_range, | ||
| double & | dotprod, | ||
| double & | manhattan | ||
| ) | const |
Dot-product and Manhattan-distance scores between the spectrum and the transition group's theoretical isotope pattern.
| [in] | spectrum | DIA MS2 spectrum sequence. |
| [in] | transitions | Transition group whose theoretical pattern is scored against spectrum. |
| [in] | im_range | Ion-mobility range filter; pass an empty range to disable IM filtering. |
| [out] | dotprod | Dot product of the two intensity vectors (higher = better). |
| [out] | manhattan | Manhattan distance of the two intensity vectors (lower = better). |
|
private |
Compare an experimental isotope pattern to a theoretical one.
This function will take an array of isotope intensities and compare them (by order only; no m/z matching) to the theoretically expected ones for the given sum_formula. The returned value is a Pearson correlation between the experimental and theoretical pattern.
|
private |
Compare an experimental isotope pattern to a theoretical one.
This function will take an array of isotope intensities and compare them (by order only; no m/z matching) to the theoretically expected ones given by isotope_dist. The returned value is a Pearson correlation between the experimental and theoretical pattern.
|
private |
Compare an experimental isotope pattern to a theoretical one.
This function will take an array of isotope intensities isotopes_int and compare them (by order only; no m/z matching) to the theoretically expected ones for the given product_mz using an averagine model. The returned value is a Pearson correlation between the experimental and theoretical pattern.
|
overrideprivatevirtual |
Synchronize members with param class.
Reimplemented from DefaultParamHandler.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |