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
14#include <unordered_map>
15
20
22
23namespace OpenMS
24{
25 class TheoreticalSpectrumGenerator;
26
63 class OPENMS_DLLAPI DIAScoring :
65 {
67
68
73
74public:
75
77
78
80
82 ~DIAScoring() override;
84
86 // DIA / SWATH scoring
87
89
90
91 void dia_isotope_scores(const std::vector<TransitionType>& transitions,
92 SpectrumSequence& spectrum,
93 OpenSwath::IMRMFeature* mrmfeature,
94 const RangeMobility& im_range,
95 double& isotope_corr,
96 double& isotope_overlap) const;
97
99 void dia_massdiff_score(const std::vector<TransitionType>& transitions,
100 const SpectrumSequence& spectrum,
101 const std::vector<double>& normalized_library_intensity,
102 const RangeMobility& im_range,
103 double& ppm_score,
104 double& ppm_score_weighted,
105 std::vector<double>& diff_ppm) const;
106
116 bool dia_ms1_massdiff_score(double precursor_mz, const SpectrumSequence& spectrum, const RangeMobility& im_range,
117 double& ppm_score) const;
118
120 void dia_ms1_isotope_scores_averagine(double precursor_mz, const SpectrumSequence& spectrum, int charge_state, RangeMobility& im_range,
121 double& isotope_corr, double& isotope_overlap) const;
122 void dia_ms1_isotope_scores(double precursor_mz, const std::vector<SpectrumPtrType>& spectrum, RangeMobility& im_range,
123 double& isotope_corr, double& isotope_overlap, const EmpiricalFormula& sum_formula) const;
124
126 void dia_by_ion_score(const SpectrumSequence& spectrum, AASequence& sequence,
127 int charge, const RangeMobility& im_range, double& bseries_score, double& yseries_score) const;
128
131 const std::vector<TransitionType>& transitions,
132 const RangeMobility& im_range,
133 double& dotprod,
134 double& manhattan) const;
136
137private:
138
141
144
146 void updateMembers_() override;
147
149 void diaIsotopeScoresSub_(const std::vector<TransitionType>& transitions,
150 const SpectrumSequence& spectrum,
151 std::unordered_map<std::string, double>& intensities,
152 const RangeMobility& im_range,
153 double& isotope_corr,
154 double& isotope_overlap) const;
155
158 void getFirstIsotopeRelativeIntensities_(const std::vector<TransitionType>& transitions,
159 OpenSwath::IMRMFeature* mrmfeature,
160 std::unordered_map<std::string, double>& intensities //experimental intensities of transitions
161 ) const;
162
163private:
164
180 void largePeaksBeforeFirstIsotope_(const SpectrumSequence& spectrum, double mono_mz, double mono_int, int& nr_occurrences, double& max_ratio, const RangeMobility& im_range) const;
181
190 double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
191 double product_mz,
192 int putative_fragment_charge) const;
193
201 double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
202 const EmpiricalFormula& sum_formula) const;
203
211 double scoreIsotopePattern_(const std::vector<double>& isotopes_int,
212 const IsotopeDistribution& isotope_dist) const;
213
216 void getIsotopeIntysFromExpSpec_(double precursor_mz, const SpectrumSequence& spectrum, int charge_state, const RangeMobility& im_range,
217 std::vector<double>& isotopes_int) const;
218
219 // Parameters
228
230 };
231}
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:65
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:229
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 dia_isotope_scores(const std::vector< TransitionType > &transitions, SpectrumSequence &spectrum, OpenSwath::IMRMFeature *mrmfeature, const RangeMobility &im_range, double &isotope_corr, double &isotope_overlap) const
Isotope scores, see class description.
double dia_byseries_intensity_min_
Definition DIAScoring.h:221
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:226
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:71
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:69
double dia_extract_window_
Definition DIAScoring.h:220
void getFirstIsotopeRelativeIntensities_(const std::vector< TransitionType > &transitions, OpenSwath::IMRMFeature *mrmfeature, std::unordered_map< std::string, double > &intensities) const
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:225
void updateMembers_() override
Synchronize members with param class.
double dia_nr_charges_
Definition DIAScoring.h:224
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:222
DIAScoring()
Default constructor.
void diaIsotopeScoresSub_(const std::vector< TransitionType > &transitions, const SpectrumSequence &spectrum, std::unordered_map< std::string, double > &intensities, const RangeMobility &im_range, double &isotope_corr, double &isotope_overlap) const
Subfunction of dia_isotope_scores.
~DIAScoring() override
Destructor.
double dia_nr_isotopes_
Definition DIAScoring.h:223
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.
bool dia_centroided_
Definition DIAScoring.h:227
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
Representation of an empirical formula.
Definition EmpiricalFormula.h:63
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:290
Definition RangeManager.h:482
Definition TransitionExperiment.h:105