OpenMS  2.4.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-2018.
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 
68 
69  public:
70 
73 
76 
87  void initialize(double rt_normalization_factor,
88  int add_up_spectra,
89  double spacing_for_spectra_resampling,
90  const OpenSwath_Scores_Usage & su);
91 
110  void calculateChromatographicScores(OpenSwath::IMRMFeature* imrmfeature,
111  const std::vector<std::string>& native_ids,
112  const std::vector<std::string>& precursor_ids,
113  const std::vector<double>& normalized_library_intensity,
114  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
115  OpenSwath_Scores & scores);
116 
135  void calculateChromatographicIdScores(OpenSwath::IMRMFeature* imrmfeature,
136  const std::vector<std::string>& native_ids_identification,
137  const std::vector<std::string>& native_ids_detection,
138  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
139  OpenSwath_Ind_Scores & scores);
140 
156  void calculateLibraryScores(OpenSwath::IMRMFeature* imrmfeature,
157  const std::vector<TransitionType> & transitions,
158  const CompoundType& compound,
159  const double normalized_feature_rt,
160  OpenSwath_Scores & scores);
161 
178  void calculateDIAScores(OpenSwath::IMRMFeature* imrmfeature,
179  const std::vector<TransitionType>& transitions,
180  const std::vector<OpenSwath::SwathMap>& swath_maps,
182  OpenMS::DIAScoring& diascoring,
183  const CompoundType& compound,
184  OpenSwath_Scores& scores,
185  std::vector<double>& mzerror_ppm,
186  double drift_lower,
187  double drift_upper);
188 
202  void calculatePrecursorDIAScores(OpenSwath::SpectrumAccessPtr ms1_map,
203  OpenMS::DIAScoring& diascoring,
204  double precursor_mz,
205  double rt,
206  const CompoundType& compound,
207  OpenSwath_Scores& scores,
208  double drift_lower,
209  double drift_upper);
210 
224  void calculateDIAIdScores(OpenSwath::IMRMFeature* imrmfeature,
225  const TransitionType & transition,
226  const std::vector<OpenSwath::SwathMap> swath_maps,
227  OpenMS::DIAScoring & diascoring,
228  OpenSwath_Scores & scores,
229  double drift_lower,
230  double drift_upper);
231 
240  void getNormalized_library_intensities_(const std::vector<TransitionType> & transitions,
241  std::vector<double>& normalized_library_intensity);
242 
259  OpenSwath::SpectrumPtr fetchSpectrumSwath(std::vector<OpenSwath::SwathMap> swath_maps,
260  double RT,
261  int nr_spectra_to_add,
262  const double drift_lower,
263  const double drift_upper);
264 
280  OpenSwath::SpectrumPtr fetchSpectrumSwath(OpenSwath::SpectrumAccessPtr swath_map,
281  double RT,
282  int nr_spectra_to_add,
283  const double drift_lower,
284  const double drift_upper);
285 
286  protected:
287 
302  OpenSwath::SpectrumPtr getAddedSpectra_(OpenSwath::SpectrumAccessPtr swath_map,
303  double RT,
304  int nr_spectra_to_add,
305  const double drift_lower,
306  const double drift_upper);
307 
308  };
309 }
310 
boost::shared_ptr< ISpectrumAccess > SpectrumAccessPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:89
double rt_normalization_factor_
Definition: OpenSwathScoring.h:64
double spacing_for_spectra_resampling_
Definition: OpenSwathScoring.h:66
A class that calls the scoring routines.
Definition: OpenSwathScoring.h:59
boost::shared_ptr< Spectrum > SpectrumPtr
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/DataStructures.h:295
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
int add_up_spectra_
Definition: OpenSwathScoring.h:65
Definition: OpenSwathScores.h:179
Scoring of an spectrum at the peak apex of an chromatographic elution peak.
Definition: DIAScoring.h:83
Definition: TransitionExperiment.h:149
Definition: TransitionExperiment.h:46
A structure to store which scores should be used by the OpenSWATH Algorithm.
Definition: OpenSwathScores.h:49
Definition: ITransition.h:55
OpenSwath::LightTransition TransitionType
Definition: OpenSwathScoring.h:62
A structure to hold the different scores computed by OpenSWATH.
Definition: OpenSwathScores.h:78
OpenSwath_Scores_Usage su_
Definition: OpenSwathScoring.h:67
OpenSwath::LightCompound CompoundType
Definition: OpenSwathScoring.h:61