OpenMS  3.0.0
OpenSwathScoring.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 $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 // data access
43 
44 // scoring
47 
48 #include <vector>
49 #include <boost/shared_ptr.hpp>
50 #include <boost/make_shared.hpp>
51 
52 namespace OpenMS
53 {
59  class OPENMS_DLLAPI OpenSwathScoring
60  {
63 
70 
71  public:
72 
75 
78 
90  void initialize(double rt_normalization_factor,
91  int add_up_spectra,
92  double spacing_for_spectra_resampling,
93  const double drift_extra,
94  const OpenSwath_Scores_Usage & su,
95  const std::string& spectrum_addition_method);
96 
115  void calculateChromatographicScores(OpenSwath::IMRMFeature* imrmfeature,
116  const std::vector<std::string>& native_ids,
117  const std::vector<std::string>& precursor_ids,
118  const std::vector<double>& normalized_library_intensity,
119  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
120  OpenSwath_Scores & scores) const;
121 
140  void calculateChromatographicIdScores(OpenSwath::IMRMFeature* imrmfeature,
141  const std::vector<std::string>& native_ids_identification,
142  const std::vector<std::string>& native_ids_detection,
143  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
144  OpenSwath_Ind_Scores & scores) const;
145 
161  void calculateLibraryScores(OpenSwath::IMRMFeature* imrmfeature,
162  const std::vector<TransitionType> & transitions,
163  const CompoundType& compound,
164  const double normalized_feature_rt,
165  OpenSwath_Scores & scores);
166 
183  void calculateDIAScores(OpenSwath::IMRMFeature* imrmfeature,
184  const std::vector<TransitionType>& transitions,
185  const std::vector<OpenSwath::SwathMap>& swath_maps,
187  const OpenMS::DIAScoring& diascoring,
188  const CompoundType& compound,
189  OpenSwath_Scores& scores,
190  std::vector<double>& mzerror_ppm,
191  const double drift_lower,
192  const double drift_upper,
193  const double drift_target);
194 
208  void calculatePrecursorDIAScores(OpenSwath::SpectrumAccessPtr ms1_map,
209  const OpenMS::DIAScoring& diascoring,
210  double precursor_mz,
211  double rt,
212  const CompoundType& compound,
213  OpenSwath_Scores& scores,
214  double drift_lower,
215  double drift_upper);
216 
230  void calculateDIAIdScores(OpenSwath::IMRMFeature* imrmfeature,
231  const TransitionType & transition,
232  const std::vector<OpenSwath::SwathMap> swath_maps,
233  const OpenMS::DIAScoring & diascoring,
234  OpenSwath_Scores & scores,
235  double drift_lower,
236  double drift_upper);
237 
246  void getNormalized_library_intensities_(const std::vector<TransitionType> & transitions,
247  std::vector<double>& normalized_library_intensity);
248 
265  OpenSwath::SpectrumPtr fetchSpectrumSwath(std::vector<OpenSwath::SwathMap> swath_maps,
266  double RT,
267  int nr_spectra_to_add,
268  const double drift_lower,
269  const double drift_upper);
270 
286  OpenSwath::SpectrumPtr fetchSpectrumSwath(OpenSwath::SpectrumAccessPtr swath_map,
287  double RT,
288  int nr_spectra_to_add,
289  const double drift_lower,
290  const double drift_upper);
291 
292  protected:
293 
308  OpenSwath::SpectrumPtr getAddedSpectra_(OpenSwath::SpectrumAccessPtr swath_map,
309  double RT,
310  int nr_spectra_to_add,
311  const double drift_lower,
312  const double drift_upper);
313 
314  };
315 }
316 
OpenMS::OpenSwathScoring::TransitionType
OpenSwath::LightTransition TransitionType
Definition: OpenSwathScoring.h:62
OpenMS::OpenSwathScoring::CompoundType
OpenSwath::LightCompound CompoundType
Definition: OpenSwathScoring.h:61
ITransition.h
DIAScoring.h
OpenMS::DIAScoring
Scoring of an spectrum at the peak apex of an chromatographic elution peak.
Definition: DIAScoring.h:82
SwathMap.h
OpenMS::OpenSwathScoring::add_up_spectra_
int add_up_spectra_
Definition: OpenSwathScoring.h:66
OpenMS::OpenSwathScoring::su_
OpenSwath_Scores_Usage su_
Definition: OpenSwathScoring.h:69
TransitionExperiment.h
ISpectrumAccess.h
OpenMS::OpenSwathScoring::spectra_addition_method_
std::string spectra_addition_method_
Definition: OpenSwathScoring.h:67
OpenMS::OpenSwathScoring::im_drift_extra_pcnt_
double im_drift_extra_pcnt_
Definition: OpenSwathScoring.h:68
DataStructures.h
OpenMS::OpenSwath_Ind_Scores
Definition: OpenSwathScores.h:194
OpenMS::OpenSwathScoring::rt_normalization_factor_
double rt_normalization_factor_
Definition: OpenSwathScoring.h:64
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenSwath::LightCompound
Definition: TransitionExperiment.h:160
OpenMS::OpenSwathScoring::spacing_for_spectra_resampling_
double spacing_for_spectra_resampling_
Definition: OpenSwathScoring.h:65
OpenMS::OpenSwathScoring
A class that calls the scoring routines.
Definition: OpenSwathScoring.h:59
OpenSwath::SpectrumAccessPtr
boost::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:87
OpenMS::OpenSwath_Scores
A structure to hold the different scores computed by OpenSWATH.
Definition: OpenSwathScores.h:82
OpenSwath::SpectrumPtr
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:296
OpenSwath::LightTransition
Definition: TransitionExperiment.h:45
OpenMS::DIM_UNIT::RT
RT in seconds.
OpenMS::OpenSwath_Scores_Usage
A structure to store which scores should be used by the OpenSWATH Algorithm.
Definition: OpenSwathScores.h:50
OpenSwath::IMRMFeature
Definition: ITransition.h:56
OpenSwathScores.h