OpenMS
Loading...
Searching...
No Matches
DIAScoring.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Hannes Roest $
6// $Authors: Hannes Roest, Witold Wolski $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
18
20
21namespace OpenMS
22{
23 class TheoreticalSpectrumGenerator;
24
62 class OPENMS_DLLAPI DIAScoring :
64 {
66
67
72
73public:
74
76
77
79
81 ~DIAScoring() override;
83
85 // DIA / SWATH scoring
86
88
89
103 void dia_isotope_scores(const std::vector<TransitionType>& transitions,
104 SpectrumSequence& spectrum,
105 OpenSwath::IMRMFeature* mrmfeature,
106 const RangeMobility& im_range,
107 double& isotope_corr,
108 double& isotope_overlap) const;
109
127 void dia_massdiff_score(const std::vector<TransitionType>& transitions,
128 const SpectrumSequence& spectrum,
129 const std::vector<double>& normalized_library_intensity,
130 const RangeMobility& im_range,
131 double& ppm_score,
132 double& ppm_score_weighted,
133 std::vector<double>& diff_ppm) const;
134
147 bool dia_ms1_massdiff_score(double precursor_mz, const SpectrumSequence& spectrum, const RangeMobility& im_range,
148 double& ppm_score) const;
149
164 void dia_ms1_isotope_scores_averagine(double precursor_mz, const SpectrumSequence& spectrum, int charge_state, RangeMobility& im_range,
165 double& isotope_corr, double& isotope_overlap) const;
180 void dia_ms1_isotope_scores(double precursor_mz, const std::vector<SpectrumPtrType>& spectrum, RangeMobility& im_range,
181 double& isotope_corr, double& isotope_overlap, const EmpiricalFormula& sum_formula) const;
182
198 void dia_by_ion_score(const SpectrumSequence& spectrum, AASequence& sequence,
199 int charge, const RangeMobility& im_range, double& bseries_score, double& yseries_score) const;
200
212 const std::vector<TransitionType>& transitions,
213 const RangeMobility& im_range,
214 double& dotprod,
215 double& manhattan) const;
216
223 {
224 return dia_extract_window_;
225 }
226
233 {
234 return dia_extraction_ppm_;
235 }
237
238private:
239
242
245
247 void updateMembers_() override;
248
250 void diaIsotopeScoresSub_(const std::vector<TransitionType>& transitions,
251 const SpectrumSequence& spectrum,
252 OpenSwath::IMRMFeature* mrmfeature,
253 const RangeMobility& im_range,
254 double& isotope_corr,
255 double& isotope_overlap) const;
256
257private:
258
274 void largePeaksBeforeFirstIsotope_(const SpectrumSequence& spectrum, double mono_mz, double mono_int, int& nr_occurrences, double& max_ratio, const RangeMobility& im_range) const;
275
284 double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
285 double product_mz,
286 int putative_fragment_charge) const;
287
295 double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
296 const EmpiricalFormula& sum_formula) const;
297
305 double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
306 const IsotopeDistribution& isotope_dist) const;
307
310 void getIsotopeIntysFromExpSpec_(double precursor_mz, const SpectrumSequence& spectrum, int charge_state, const RangeMobility& im_range,
311 std::vector<double>& isotopes_int) const;
312
313 // Parameters
322
324 };
325}
Representation of a peptide/protein sequence.
Definition AASequence.h:88
Scoring of an spectrum at the peak apex of an chromatographic elution peak.
Definition DIAScoring.h:64
double getDIAExtractionWindow() const
Return the DIA extraction window.
Definition DIAScoring.h:222
bool isDIAExtractionPPM() const
Return whether the DIA extraction window is interpreted in ppm.
Definition DIAScoring.h:232
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.
TheoreticalSpectrumGenerator * generator
Definition DIAScoring.h:323
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.
double scoreIsotopePattern_(const std::vector< double > &isotopes_int, const IsotopeDistribution &isotope_dist) const
Compare an experimental isotope pattern to a theoretical one.
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 ...
double dia_byseries_intensity_min_
Definition DIAScoring.h:315
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.
DIAScoring & operator=(const DIAScoring &rhs)
Assignment operator (algorithm class)
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.
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.
bool dia_extraction_ppm_
Definition DIAScoring.h:320
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.
DIAScoring(const DIAScoring &rhs)
Copy constructor (algorithm class)
OpenSwath::LightTransition TransitionType
Transition interface (Transition, Peptide, Protein)
Definition DIAScoring.h:70
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.
OpenSwath::SpectrumPtr SpectrumPtrType
Type definitions.
Definition DIAScoring.h:68
double dia_extract_window_
Definition DIAScoring.h:314
void getIsotopeIntysFromExpSpec_(double precursor_mz, const SpectrumSequence &spectrum, int charge_state, const RangeMobility &im_range, std::vector< double > &isotopes_int) const
double peak_before_mono_max_ppm_diff_
Definition DIAScoring.h:319
void updateMembers_() override
Synchronize members with param class.
double dia_nr_charges_
Definition DIAScoring.h:318
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.
double scoreIsotopePattern_(const std::vector< double > &isotopes_int, const EmpiricalFormula &sum_formula) const
Compare an experimental isotope pattern to a theoretical one.
double dia_byseries_ppm_diff_
Definition DIAScoring.h:316
DIAScoring()
Default constructor.
~DIAScoring() override
Destructor.
double dia_nr_isotopes_
Definition DIAScoring.h:317
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...
bool dia_centroided_
Definition DIAScoring.h:321
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
Representation of an empirical formula.
Definition EmpiricalFormula.h:62
Definition IsotopeDistribution.h:40
Generates theoretical spectra for peptides with various options.
Definition TheoreticalSpectrumGenerator.h:45
Definition ITransition.h:31
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::vector< OpenSwath::SpectrumPtr > SpectrumSequence
a vector of spectrum pointers that DIA scores can operate on, allows for clever integration of only t...
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:20
std::shared_ptr< Spectrum > SpectrumPtr
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:291
Definition RangeManager.h:482
Definition TransitionExperiment.h:106