OpenMS
DIAScoring.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, 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 
19 namespace OpenMS
20 {
21  class TheoreticalSpectrumGenerator;
22 
56  class OPENMS_DLLAPI DIAScoring :
57  public DefaultParamHandler
58  {
60 
66 
67 public:
68 
70 
71  DIAScoring();
73 
75  ~DIAScoring() override;
77 
79  // DIA / SWATH scoring
80 
82 
83  void dia_isotope_scores(const std::vector<TransitionType>& transitions,
85  SpectrumPtrType spectrum,
86  OpenSwath::IMRMFeature* mrmfeature,
87  double& isotope_corr,
88  double& isotope_overlap) const;
89 
91  void dia_massdiff_score(const std::vector<TransitionType>& transitions,
92  const SpectrumPtrType& spectrum,
93  const std::vector<double>& normalized_library_intensity,
94  double& ppm_score,
95  double& ppm_score_weighted,
96  std::vector<double>& diff_ppm) const;
97 
106  bool dia_ms1_massdiff_score(double precursor_mz, SpectrumPtrType spectrum,
107  double& ppm_score) const;
108 
110  void dia_ms1_isotope_scores_averagine(double precursor_mz, const SpectrumPtrType& spectrum,
111  double& isotope_corr, double& isotope_overlap, int charge_state) const;
112  void dia_ms1_isotope_scores(double precursor_mz, const SpectrumPtrType& spectrum,
113  double& isotope_corr, double& isotope_overlap, const EmpiricalFormula& sum_formula) const;
114 
115 
117  void dia_by_ion_score(const SpectrumPtrType& spectrum, AASequence& sequence,
118  int charge, double& bseries_score, double& yseries_score) const;
119 
122  const std::vector<TransitionType>& transitions,
123  double& dotprod,
124  double& manhattan) const;
126 
127 private:
128 
130  DIAScoring(const DIAScoring& rhs);
131 
134 
136  void updateMembers_() override;
137 
139  void diaIsotopeScoresSub_(const std::vector<TransitionType>& transitions,
140  const SpectrumPtrType& spectrum,
141  std::map<std::string, double>& intensities,
142  double& isotope_corr,
143  double& isotope_overlap) const;
144 
147  void getFirstIsotopeRelativeIntensities_(const std::vector<TransitionType>& transitions,
148  OpenSwath::IMRMFeature* mrmfeature,
149  std::map<std::string, double>& intensities //experimental intensities of transitions
150  ) const;
151 
152 private:
153 
169  void largePeaksBeforeFirstIsotope_(const SpectrumPtrType& spectrum, double mono_mz, double mono_int, int& nr_occurrences, double& max_ratio) const;
170 
179  double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
180  double product_mz,
181  int putative_fragment_charge) const;
182 
190  double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
191  const EmpiricalFormula& sum_formula) const;
192 
200  double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
201  const IsotopeDistribution& isotope_dist) const;
202 
205  void getIsotopeIntysFromExpSpec_(double precursor_mz, const SpectrumPtrType& spectrum,
206  std::vector<double>& isotopes_int,
207  int charge_state) const;
208 
209  // Parameters
218 
220  };
221 }
222 
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:58
TheoreticalSpectrumGenerator * generator
Definition: DIAScoring.h:219
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
void dia_ms1_isotope_scores_averagine(double precursor_mz, const SpectrumPtrType &spectrum, double &isotope_corr, double &isotope_overlap, int charge_state) const
Precursor isotope scores for precursors (peptides and metabolites)
double dia_byseries_intensity_min_
Definition: DIAScoring.h:211
void score_with_isotopes(SpectrumPtrType spectrum, const std::vector< TransitionType > &transitions, double &dotprod, double &manhattan) const
Dotproduct / Manhattan score with theoretical spectrum.
bool dia_ms1_massdiff_score(double precursor_mz, SpectrumPtrType spectrum, double &ppm_score) const
void dia_ms1_isotope_scores(double precursor_mz, const SpectrumPtrType &spectrum, double &isotope_corr, double &isotope_overlap, const EmpiricalFormula &sum_formula) const
void getIsotopeIntysFromExpSpec_(double precursor_mz, const SpectrumPtrType &spectrum, std::vector< double > &isotopes_int, int charge_state) const
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.
bool dia_extraction_ppm_
Definition: DIAScoring.h:216
DIAScoring(const DIAScoring &rhs)
Copy constructor (algorithm class)
OpenSwath::LightTransition TransitionType
Transition interface (Transition, Peptide, Protein)
Definition: DIAScoring.h:64
void dia_massdiff_score(const std::vector< TransitionType > &transitions, const SpectrumPtrType &spectrum, const std::vector< double > &normalized_library_intensity, 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:62
void dia_by_ion_score(const SpectrumPtrType &spectrum, AASequence &sequence, int charge, double &bseries_score, double &yseries_score) const
b/y ion scores
void diaIsotopeScoresSub_(const std::vector< TransitionType > &transitions, const SpectrumPtrType &spectrum, std::map< std::string, double > &intensities, double &isotope_corr, double &isotope_overlap) const
Subfunction of dia_isotope_scores.
void largePeaksBeforeFirstIsotope_(const SpectrumPtrType &spectrum, double mono_mz, double mono_int, int &nr_occurrences, double &max_ratio) const
Determine whether the current m/z value is a monoisotopic peak.
double dia_extract_window_
Definition: DIAScoring.h:210
double peak_before_mono_max_ppm_diff_
Definition: DIAScoring.h:215
void updateMembers_() override
Synchronize members with param class.
double dia_nr_charges_
Definition: DIAScoring.h:214
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:212
~DIAScoring() override
Destructor.
double dia_nr_isotopes_
Definition: DIAScoring.h:213
DIAScoring & operator=(const DIAScoring &rhs)
Assignment operator (algorithm class)
bool dia_centroided_
Definition: DIAScoring.h:217
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:44
Definition: ITransition.h:31
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:270
Definition: TransitionExperiment.h:20