OpenMS
OpenSwathScoring.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 $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // data access
17 
18 // scoring
21 
22 #include <vector>
23 #include <boost/shared_ptr.hpp>
24 #include <boost/make_shared.hpp>
25 
26 namespace OpenMS
27 {
33  class OPENMS_DLLAPI OpenSwathScoring
34  {
37 
44 
45  public:
46 
49 
52 
64  void initialize(double rt_normalization_factor,
65  int add_up_spectra,
66  double spacing_for_spectra_resampling,
67  const double drift_extra,
68  const OpenSwath_Scores_Usage & su,
69  const std::string& spectrum_addition_method);
70 
90  const std::vector<std::string>& native_ids,
91  const std::vector<std::string>& precursor_ids,
92  const std::vector<double>& normalized_library_intensity,
93  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
94  OpenSwath_Scores & scores) const;
95 
115  const std::vector<std::string>& native_ids_identification,
116  const std::vector<std::string>& native_ids_detection,
117  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
118  OpenSwath_Ind_Scores & scores) const;
119 
136  const std::vector<TransitionType> & transitions,
137  const CompoundType& compound,
138  const double normalized_feature_rt,
139  OpenSwath_Scores & scores);
140 
158  const std::vector<TransitionType>& transitions,
159  const std::vector<OpenSwath::SwathMap>& swath_maps,
160  const OpenSwath::SpectrumAccessPtr& ms1_map,
161  const OpenMS::DIAScoring& diascoring,
162  const CompoundType& compound,
163  OpenSwath_Scores& scores,
164  std::vector<double>& mzerror_ppm,
165  const double drift_lower,
166  const double drift_upper,
167  const double drift_target);
168 
183  const OpenMS::DIAScoring& diascoring,
184  double precursor_mz,
185  double rt,
186  const CompoundType& compound,
187  OpenSwath_Scores& scores,
188  double drift_lower,
189  double drift_upper);
190 
205  const TransitionType & transition,
206  const std::vector<OpenSwath::SwathMap>& swath_maps,
207  const OpenMS::DIAScoring & diascoring,
208  OpenSwath_Scores & scores,
209  double drift_lower,
210  double drift_upper);
211 
220  void getNormalized_library_intensities_(const std::vector<TransitionType> & transitions,
221  std::vector<double>& normalized_library_intensity);
222 
239  OpenSwath::SpectrumPtr fetchSpectrumSwath(std::vector<OpenSwath::SwathMap> swath_maps,
240  double RT,
241  int nr_spectra_to_add,
242  const double drift_lower,
243  const double drift_upper);
244 
261  double RT,
262  int nr_spectra_to_add,
263  const double drift_lower,
264  const double drift_upper);
265 
266  protected:
267 
283  double RT,
284  int nr_spectra_to_add,
285  const double drift_lower,
286  const double drift_upper);
287 
288  };
289 }
290 
Scoring of an spectrum at the peak apex of an chromatographic elution peak.
Definition: DIAScoring.h:58
A class that calls the scoring routines.
Definition: OpenSwathScoring.h:34
std::string spectra_addition_method_
Definition: OpenSwathScoring.h:41
void calculateLibraryScores(OpenSwath::IMRMFeature *imrmfeature, const std::vector< TransitionType > &transitions, const CompoundType &compound, const double normalized_feature_rt, OpenSwath_Scores &scores)
Score a single chromatographic feature against a spectral library.
OpenSwathScoring()
Constructor.
void calculateDIAIdScores(OpenSwath::IMRMFeature *imrmfeature, const TransitionType &transition, const std::vector< OpenSwath::SwathMap > &swath_maps, const OpenMS::DIAScoring &diascoring, OpenSwath_Scores &scores, double drift_lower, double drift_upper)
Score a single chromatographic feature using DIA / SWATH scores.
OpenSwath::SpectrumPtr fetchSpectrumSwath(std::vector< OpenSwath::SwathMap > swath_maps, double RT, int nr_spectra_to_add, const double drift_lower, const double drift_upper)
Prepares a spectrum for DIA analysis (multiple map)
int add_up_spectra_
Definition: OpenSwathScoring.h:40
double spacing_for_spectra_resampling_
Definition: OpenSwathScoring.h:39
OpenSwath::SpectrumPtr fetchSpectrumSwath(OpenSwath::SpectrumAccessPtr swath_map, double RT, int nr_spectra_to_add, const double drift_lower, const double drift_upper)
Prepares a spectrum for DIA analysis (single map)
OpenSwath::SpectrumPtr getAddedSpectra_(const OpenSwath::SpectrumAccessPtr &swath_map, double RT, int nr_spectra_to_add, const double drift_lower, const double drift_upper)
Returns an averaged spectrum.
void getNormalized_library_intensities_(const std::vector< TransitionType > &transitions, std::vector< double > &normalized_library_intensity)
Computing the normalized library intensities from the transition objects.
void calculateChromatographicScores(OpenSwath::IMRMFeature *imrmfeature, const std::vector< std::string > &native_ids, const std::vector< std::string > &precursor_ids, const std::vector< double > &normalized_library_intensity, std::vector< OpenSwath::ISignalToNoisePtr > &signal_noise_estimators, OpenSwath_Scores &scores) const
Score a single peakgroup in a chromatogram using only chromatographic properties.
double im_drift_extra_pcnt_
Definition: OpenSwathScoring.h:42
void calculateDIAScores(OpenSwath::IMRMFeature *imrmfeature, const std::vector< TransitionType > &transitions, const std::vector< OpenSwath::SwathMap > &swath_maps, const OpenSwath::SpectrumAccessPtr &ms1_map, const OpenMS::DIAScoring &diascoring, const CompoundType &compound, OpenSwath_Scores &scores, std::vector< double > &mzerror_ppm, const double drift_lower, const double drift_upper, const double drift_target)
Score a single chromatographic feature using DIA / SWATH scores.
void calculateChromatographicIdScores(OpenSwath::IMRMFeature *imrmfeature, const std::vector< std::string > &native_ids_identification, const std::vector< std::string > &native_ids_detection, std::vector< OpenSwath::ISignalToNoisePtr > &signal_noise_estimators, OpenSwath_Ind_Scores &scores) const
Score identification transitions against detection transitions of a single peakgroup in a chromatogra...
OpenSwath::LightTransition TransitionType
Definition: OpenSwathScoring.h:36
double rt_normalization_factor_
Definition: OpenSwathScoring.h:38
OpenSwath_Scores_Usage su_
Definition: OpenSwathScoring.h:43
OpenSwath::LightCompound CompoundType
Definition: OpenSwathScoring.h:35
void initialize(double rt_normalization_factor, int add_up_spectra, double spacing_for_spectra_resampling, const double drift_extra, const OpenSwath_Scores_Usage &su, const std::string &spectrum_addition_method)
Initialize the scoring object.
~OpenSwathScoring()
Destructor.
void calculatePrecursorDIAScores(const OpenSwath::SpectrumAccessPtr &ms1_map, const OpenMS::DIAScoring &diascoring, double precursor_mz, double rt, const CompoundType &compound, OpenSwath_Scores &scores, double drift_lower, double drift_upper)
Score a single chromatographic feature using the precursor map.
Definition: ITransition.h:31
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
A structure to store which scores should be used by the OpenSWATH Algorithm.
Definition: OpenSwathScores.h:25
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:270
boost::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:61
Definition: OpenSwathScores.h:172
A structure to hold the different scores computed by OpenSWATH.
Definition: OpenSwathScores.h:57
Definition: TransitionExperiment.h:127
Definition: TransitionExperiment.h:20