OpenMS  3.0.0
DIAScoring.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2022.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Hannes Roest $
32 // $Authors: Hannes Roest, Witold Wolski $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
39 
44 
45 namespace OpenMS
46 {
47  class TheoreticalSpectrumGenerator;
48 
82  class OPENMS_DLLAPI DIAScoring :
83  public DefaultParamHandler
84  {
86 
92 
93 public:
94 
96 
97  DIAScoring();
99 
101  ~DIAScoring() override;
103 
105  // DIA / SWATH scoring
106 
108 
109  void dia_isotope_scores(const std::vector<TransitionType>& transitions,
111  SpectrumPtrType spectrum,
112  OpenSwath::IMRMFeature* mrmfeature,
113  double& isotope_corr,
114  double& isotope_overlap) const;
115 
117  void dia_massdiff_score(const std::vector<TransitionType>& transitions,
118  SpectrumPtrType spectrum,
119  const std::vector<double>& normalized_library_intensity,
120  double& ppm_score,
121  double& ppm_score_weighted,
122  std::vector<double>& diff_ppm) const;
123 
132  bool dia_ms1_massdiff_score(double precursor_mz, SpectrumPtrType spectrum,
133  double& ppm_score) const;
134 
136  void dia_ms1_isotope_scores_averagine(double precursor_mz, SpectrumPtrType spectrum,
137  double& isotope_corr, double& isotope_overlap, int charge_state) const;
138  void dia_ms1_isotope_scores(double precursor_mz, SpectrumPtrType spectrum,
139  double& isotope_corr, double& isotope_overlap, const EmpiricalFormula& sum_formula) const;
140 
141 
143  void dia_by_ion_score(SpectrumPtrType spectrum, AASequence& sequence,
144  int charge, double& bseries_score, double& yseries_score) const;
145 
147  void score_with_isotopes(SpectrumPtrType spectrum,
148  const std::vector<TransitionType>& transitions,
149  double& dotprod,
150  double& manhattan) const;
152 
153 private:
154 
156  DIAScoring(const DIAScoring& rhs);
157 
159  DIAScoring& operator=(const DIAScoring& rhs);
160 
162  void updateMembers_() override;
163 
165  void diaIsotopeScoresSub_(const std::vector<TransitionType>& transitions,
166  SpectrumPtrType spectrum,
167  std::map<std::string, double>& intensities,
168  double& isotope_corr,
169  double& isotope_overlap) const;
170 
173  void getFirstIsotopeRelativeIntensities_(const std::vector<TransitionType>& transitions,
174  OpenSwath::IMRMFeature* mrmfeature,
175  std::map<std::string, double>& intensities //experimental intensities of transitions
176  ) const;
177 
178 private:
179 
195  void largePeaksBeforeFirstIsotope_(SpectrumPtrType spectrum, double mono_mz, double mono_int, int& nr_occurrences, double& max_ratio) const;
196 
205  double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
206  double product_mz,
207  int putative_fragment_charge) const;
208 
216  double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
217  const EmpiricalFormula& sum_formula) const;
218 
226  double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
227  const IsotopeDistribution& isotope_dist) const;
228 
231  void getIsotopeIntysFromExpSpec_(double precursor_mz, SpectrumPtrType spectrum,
232  std::vector<double>& isotopes_int,
233  int charge_state) const;
234 
235  // Parameters
244 
246  };
247 }
248 
DefaultParamHandler.h
ITransition.h
OpenMS::DIAScoring
Scoring of an spectrum at the peak apex of an chromatographic elution peak.
Definition: DIAScoring.h:82
OpenMS::DIAScoring::SpectrumPtrType
OpenSwath::SpectrumPtr SpectrumPtrType
Type definitions.
Definition: DIAScoring.h:88
TransitionExperiment.h
ISpectrumAccess.h
DataStructures.h
OpenMS::DIAScoring::dia_nr_isotopes_
double dia_nr_isotopes_
Definition: DIAScoring.h:239
OpenMS::DIAScoring::dia_extract_window_
double dia_extract_window_
Definition: DIAScoring.h:236
OpenMS::DefaultParamHandler
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::DIAScoring::dia_byseries_intensity_min_
double dia_byseries_intensity_min_
Definition: DIAScoring.h:237
OpenMS::DIAScoring::dia_extraction_ppm_
bool dia_extraction_ppm_
Definition: DIAScoring.h:242
OpenMS::DIAScoring::dia_byseries_ppm_diff_
double dia_byseries_ppm_diff_
Definition: DIAScoring.h:238
OpenMS::TheoreticalSpectrumGenerator
Generates theoretical spectra for peptides with various options.
Definition: TheoreticalSpectrumGenerator.h:68
OpenMS::IsotopeDistribution
Definition: IsotopeDistribution.h:64
AASequence.h
OpenMS::EmpiricalFormula
Representation of an empirical formula.
Definition: EmpiricalFormula.h:84
OpenSwath::SpectrumPtr
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:296
OpenMS::AASequence
Representation of a peptide/protein sequence.
Definition: AASequence.h:111
OpenMS::DIAScoring::dia_nr_charges_
double dia_nr_charges_
Definition: DIAScoring.h:240
OpenMS::DIAScoring::TransitionType
OpenSwath::LightTransition TransitionType
Transition interface (Transition, Peptide, Protein)
Definition: DIAScoring.h:90
OpenMS::DIAScoring::peak_before_mono_max_ppm_diff_
double peak_before_mono_max_ppm_diff_
Definition: DIAScoring.h:241
OpenMS::DIAScoring::dia_centroided_
bool dia_centroided_
Definition: DIAScoring.h:243
OpenSwath::LightTransition
Definition: TransitionExperiment.h:45
OpenMS::DIAScoring::generator
TheoreticalSpectrumGenerator * generator
Definition: DIAScoring.h:245
OpenSwath::IMRMFeature
Definition: ITransition.h:56