OpenMS
OpenSwathScoring.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 $
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 //logging
28 
29 struct RangeMZ;
30 struct RangeMobility;
31 
32 namespace OpenMS
33 {
39  class OPENMS_DLLAPI OpenSwathScoring
40  {
43 
45  {
46  ADDITION,
47  RESAMPLE
48  };
49 
57  const std::string ION_MOBILITY_DESCRIPTION = "Ion Mobility";
58 
59  public:
60 
63 
66 
80  void initialize(double rt_normalization_factor,
81  int add_up_spectra,
82  double spacing_for_spectra_resampling,
83  const double drift_extra,
84  const OpenSwath_Scores_Usage & su,
85  const std::string& spectrum_addition_method,
86  bool use_ms1_ion_mobility);
87 
107  const std::vector<std::string>& native_ids,
108  const std::vector<std::string>& precursor_ids,
109  const std::vector<double>& normalized_library_intensity,
110  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
111  OpenSwath_Scores & scores) const;
112 
132  const std::vector<std::string>& native_ids_identification,
133  const std::vector<std::string>& native_ids_detection,
134  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
135  OpenSwath_Ind_Scores & scores) const;
136 
153  const std::vector<TransitionType> & transitions,
154  const CompoundType& compound,
155  const double normalized_feature_rt,
156  OpenSwath_Scores & scores);
157 
175  const std::vector<TransitionType>& transitions,
176  const std::vector<OpenSwath::SwathMap>& swath_maps,
177  const OpenSwath::SpectrumAccessPtr& ms1_map,
178  const OpenMS::DIAScoring& diascoring,
179  const CompoundType& compound,
180  OpenSwath_Scores& scores,
181  std::vector<double>& mzerror_ppm,
182  const double drift_target,
183  const RangeMobility& range_im);
184 
199  const OpenMS::DIAScoring& diascoring,
200  double precursor_mz,
201  double rt,
202  const CompoundType& compound,
203  RangeMobility im_range,
204  OpenSwath_Scores& scores);
205 
219  const TransitionType & transition,
220  const std::vector<OpenSwath::SwathMap>& swath_maps,
221  RangeMobility& range_im,
222  const OpenMS::DIAScoring & diascoring,
223  OpenSwath_Scores & scores);
224 
233  void getNormalized_library_intensities_(const std::vector<TransitionType> & transitions,
234  std::vector<double>& normalized_library_intensity);
235 
259  SpectrumSequence fetchSpectrumSwath(std::vector<OpenSwath::SwathMap> swath_maps, double RT, int nr_spectra_to_add, const RangeMobility& im_range);
260 
261 
287  SpectrumSequence fetchSpectrumSwath(OpenSwath::SpectrumAccessPtr swath_map, double RT, int nr_spectra_to_add, const RangeMobility& im_range);
288  };
289 }
Scoring of an spectrum at the peak apex of an chromatographic elution peak.
Definition: DIAScoring.h:63
A class that calls the scoring routines.
Definition: OpenSwathScoring.h:40
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.
SpectrumAdditionMethod
Definition: OpenSwathScoring.h:45
void calculatePrecursorDIAScores(const OpenSwath::SpectrumAccessPtr &ms1_map, const OpenMS::DIAScoring &diascoring, double precursor_mz, double rt, const CompoundType &compound, RangeMobility im_range, OpenSwath_Scores &scores)
Score a single chromatographic feature using the precursor map.
SpectrumSequence fetchSpectrumSwath(OpenSwath::SpectrumAccessPtr swath_map, double RT, int nr_spectra_to_add, const RangeMobility &im_range)
Prepares a spectrum for DIA analysis (multiple map)
int add_up_spectra_
Definition: OpenSwathScoring.h:52
double spacing_for_spectra_resampling_
Definition: OpenSwathScoring.h:51
SpectrumAdditionMethod spectra_addition_method_
Definition: OpenSwathScoring.h:53
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 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, bool use_ms1_ion_mobility)
Initialize the scoring object.
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:54
void calculateDIAIdScores(OpenSwath::IMRMFeature *imrmfeature, const TransitionType &transition, const std::vector< OpenSwath::SwathMap > &swath_maps, RangeMobility &range_im, const OpenMS::DIAScoring &diascoring, OpenSwath_Scores &scores)
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:42
double rt_normalization_factor_
Definition: OpenSwathScoring.h:50
OpenSwath_Scores_Usage su_
Definition: OpenSwathScoring.h:55
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_target, const RangeMobility &range_im)
Score a single chromatographic feature using DIA / SWATH scores.
OpenSwath::LightCompound CompoundType
Definition: OpenSwathScoring.h:41
bool use_ms1_ion_mobility_
whether to use MS1 ion mobility extraction in DIA scores
Definition: OpenSwathScoring.h:56
SpectrumSequence fetchSpectrumSwath(std::vector< OpenSwath::SwathMap > swath_maps, double RT, int nr_spectra_to_add, const RangeMobility &im_range)
Prepares a spectrum for DIA analysis (single map)
~OpenSwathScoring()
Destructor.
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
A structure to store which scores should be used by the OpenSWATH Algorithm.
Definition: OpenSwathScores.h:25
boost::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:131
Definition: OpenSwathScores.h:173
A structure to hold the different scores computed by OpenSWATH.
Definition: OpenSwathScores.h:58
Definition: RangeManager.h:463
Definition: TransitionExperiment.h:127
Definition: TransitionExperiment.h:20