OpenMS
DIAScoring.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- 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 
21 namespace OpenMS
22 {
23  class TheoreticalSpectrumGenerator;
24 
61  class OPENMS_DLLAPI DIAScoring :
62  public DefaultParamHandler
63  {
65 
71 
72 public:
73 
75 
76  DIAScoring();
78 
80  ~DIAScoring() override;
82 
84  // DIA / SWATH scoring
85 
87 
88  void dia_isotope_scores(const std::vector<TransitionType>& transitions,
90  SpectrumSequence& spectrum,
91  OpenSwath::IMRMFeature* mrmfeature,
92  const RangeMobility& im_range,
93  double& isotope_corr,
94  double& isotope_overlap) const;
95 
97  void dia_massdiff_score(const std::vector<TransitionType>& transitions,
98  const SpectrumSequence& spectrum,
99  const std::vector<double>& normalized_library_intensity,
100  const RangeMobility& im_range,
101  double& ppm_score,
102  double& ppm_score_weighted,
103  std::vector<double>& diff_ppm) const;
104 
114  bool dia_ms1_massdiff_score(double precursor_mz, const SpectrumSequence& spectrum, const RangeMobility& im_range,
115  double& ppm_score) const;
116 
118  void dia_ms1_isotope_scores_averagine(double precursor_mz, const SpectrumSequence& spectrum, int charge_state, RangeMobility& im_range,
119  double& isotope_corr, double& isotope_overlap) const;
120  void dia_ms1_isotope_scores(double precursor_mz, const std::vector<SpectrumPtrType>& spectrum, RangeMobility& im_range,
121  double& isotope_corr, double& isotope_overlap, const EmpiricalFormula& sum_formula) const;
122 
124  void dia_by_ion_score(const SpectrumSequence& spectrum, AASequence& sequence,
125  int charge, const RangeMobility& im_range, double& bseries_score, double& yseries_score) const;
126 
129  const std::vector<TransitionType>& transitions,
130  const RangeMobility& im_range,
131  double& dotprod,
132  double& manhattan) const;
134 
135 private:
136 
138  DIAScoring(const DIAScoring& rhs);
139 
142 
144  void updateMembers_() override;
145 
147  void diaIsotopeScoresSub_(const std::vector<TransitionType>& transitions,
148  const SpectrumSequence& spectrum,
149  std::map<std::string, double>& intensities,
150  const RangeMobility& im_range,
151  double& isotope_corr,
152  double& isotope_overlap) const;
153 
156  void getFirstIsotopeRelativeIntensities_(const std::vector<TransitionType>& transitions,
157  OpenSwath::IMRMFeature* mrmfeature,
158  std::map<std::string, double>& intensities //experimental intensities of transitions
159  ) const;
160 
161 private:
162 
178  void largePeaksBeforeFirstIsotope_(const SpectrumSequence& spectrum, double mono_mz, double mono_int, int& nr_occurrences, double& max_ratio, const RangeMobility& im_range) const;
179 
188  double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
189  double product_mz,
190  int putative_fragment_charge) const;
191 
199  double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
200  const EmpiricalFormula& sum_formula) const;
201 
209  double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
210  const IsotopeDistribution& isotope_dist) const;
211 
214  void getIsotopeIntysFromExpSpec_(double precursor_mz, const SpectrumSequence& spectrum, int charge_state, const RangeMobility& im_range,
215  std::vector<double>& isotopes_int) const;
216 
217  // Parameters
226 
228  };
229 }
Representation of a peptide/protein sequence.
Definition: AASequence.h:86
Scoring of an spectrum at the peak apex of an chromatographic elution peak.
Definition: DIAScoring.h:63
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
TheoreticalSpectrumGenerator * generator
Definition: DIAScoring.h:227
bool dia_ms1_massdiff_score(double precursor_mz, const SpectrumSequence &spectrum, const RangeMobility &im_range, double &ppm_score) const
double scoreIsotopePattern_(const std::vector< double > &isotopes_int, const IsotopeDistribution &isotope_dist) const
Compare an experimental isotope pattern to a theoretical one.
void getFirstIsotopeRelativeIntensities_(const std::vector< TransitionType > &transitions, OpenSwath::IMRMFeature *mrmfeature, std::map< std::string, double > &intensities) const
double dia_byseries_intensity_min_
Definition: DIAScoring.h:219
void diaIsotopeScoresSub_(const std::vector< TransitionType > &transitions, const SpectrumSequence &spectrum, std::map< std::string, double > &intensities, const RangeMobility &im_range, double &isotope_corr, double &isotope_overlap) const
Subfunction of dia_isotope_scores.
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:224
void dia_by_ion_score(const SpectrumSequence &spectrum, AASequence &sequence, int charge, const RangeMobility &im_range, double &bseries_score, double &yseries_score) const
b/y ion scores
DIAScoring(const DIAScoring &rhs)
Copy constructor (algorithm class)
OpenSwath::LightTransition TransitionType
Transition interface (Transition, Peptide, Protein)
Definition: DIAScoring.h:69
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
Massdiff scores, see class description.
OpenSwath::SpectrumPtr SpectrumPtrType
Type definitions.
Definition: DIAScoring.h:67
double dia_extract_window_
Definition: DIAScoring.h:218
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:223
void updateMembers_() override
Synchronize members with param class.
double dia_nr_charges_
Definition: DIAScoring.h:222
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 scores for precursors (peptides and metabolites)
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:220
~DIAScoring() override
Destructor.
double dia_nr_isotopes_
Definition: DIAScoring.h:221
void score_with_isotopes(SpectrumSequence &spectrum, const std::vector< TransitionType > &transitions, const RangeMobility &im_range, double &dotprod, double &manhattan) const
Dotproduct / Manhattan score with theoretical spectrum.
DIAScoring & operator=(const DIAScoring &rhs)
Assignment operator (algorithm class)
bool dia_centroided_
Definition: DIAScoring.h:225
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
Representation of an empirical formula.
Definition: EmpiricalFormula.h:59
Definition: IsotopeDistribution.h:39
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
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:276
Definition: RangeManager.h:463
Definition: TransitionExperiment.h:20