OpenMS
OpenSwathScoring.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 $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // data access
17 
18 // Kernel classes
21 
22 // scoring
25 
26 #include <vector>
27 #include <boost/shared_ptr.hpp>
28 #include <boost/make_shared.hpp>
29 
30 //logging
32 
33 struct RangeMZ;
34 struct RangeMobility;
35 
36 namespace OpenMS
37 {
43  class OPENMS_DLLAPI OpenSwathScoring
44  {
48 
50  {
51  ADDITION,
52  RESAMPLE
53  };
54 
56  {
57  FIXED,
58  DYNAMIC
59  };
60 
71  const std::string ION_MOBILITY_DESCRIPTION = "Ion Mobility";
72 
73  public:
74 
77 
80 
97  void initialize(double rt_normalization_factor,
98  int add_up_spectra,
99  double spacing_for_spectra_resampling,
100  double merge_spectra_by_peak_width_fraction,
101  const double drift_extra,
102  const OpenSwath_Scores_Usage & su,
103  const std::string& spectrum_addition_method,
104  const std::string& spectrum_merge_method_type,
105  bool use_ms1_ion_mobility,
106  bool apply_im_peak_picking);
107 
127  const std::vector<std::string>& native_ids,
128  const std::vector<std::string>& precursor_ids,
129  const std::vector<double>& normalized_library_intensity,
130  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
131  OpenSwath_Scores & scores) const;
132 
152  const std::vector<std::string>& native_ids_identification,
153  const std::vector<std::string>& native_ids_detection,
154  std::vector<OpenSwath::ISignalToNoisePtr>& signal_noise_estimators,
155  OpenSwath_Ind_Scores & scores) const;
156 
173  const std::vector<TransitionType> & transitions,
174  const CompoundType& compound,
175  const double normalized_feature_rt,
176  OpenSwath_Scores & scores);
177 
195  const std::vector<TransitionType>& transitions,
196  const std::vector<OpenSwath::SwathMap>& swath_maps,
197  const OpenSwath::SpectrumAccessPtr& ms1_map,
198  const OpenMS::DIAScoring& diascoring,
199  const CompoundType& compound,
200  OpenSwath_Scores& scores,
201  std::vector<double>& mzerror_ppm,
202  const double drift_target,
203  const RangeMobility& range_im);
204 
219  const OpenMS::DIAScoring& diascoring,
220  double precursor_mz,
221  double rt,
222  const CompoundType& compound,
223  RangeMobility im_range,
224  OpenSwath_Scores& scores);
225 
241  const TransitionType & transition,
242  MRMTransitionGroupType& transition_group_detection,
243  const std::vector<OpenSwath::SwathMap>& swath_maps,
244  RangeMobility& range_im,
245  const OpenMS::DIAScoring & diascoring,
246  OpenSwath_Scores & scores,
247  const double drift_target);
248 
257  void getNormalized_library_intensities_(const std::vector<TransitionType> & transitions,
258  std::vector<double>& normalized_library_intensity);
259 
282  SpectrumSequence fetchSpectrumSwath(std::vector<OpenSwath::SwathMap> swath_maps, double RT, int nr_spectra_to_add, const RangeMobility& im_range);
283 
284 
309  SpectrumSequence fetchSpectrumSwath(OpenSwath::SpectrumAccessPtr swath_map, double RT, int nr_spectra_to_add, const RangeMobility& im_range);
310  };
311 }
Scoring of an spectrum at the peak apex of an chromatographic elution peak.
Definition: DIAScoring.h:63
The representation of a group of transitions in a targeted proteomics experiment.
Definition: MRMTransitionGroup.h:42
A class that calls the scoring routines.
Definition: OpenSwathScoring.h:44
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.
MRMTransitionGroup< MSChromatogram, TransitionType > MRMTransitionGroupType
Definition: OpenSwathScoring.h:47
SpectrumAdditionMethod
Definition: OpenSwathScoring.h:50
double merge_spectra_by_peak_width_fraction_
Definition: OpenSwathScoring.h:63
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.
bool apply_im_peak_picking_
whether to apply peak picking on ion mobilograms
Definition: OpenSwathScoring.h:70
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:64
double spacing_for_spectra_resampling_
Definition: OpenSwathScoring.h:62
SpectrumAdditionMethod spectra_addition_method_
Definition: OpenSwathScoring.h:65
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:67
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:46
void calculateDIAIdScores(OpenSwath::IMRMFeature *imrmfeature, const TransitionType &transition, MRMTransitionGroupType &transition_group_detection, const std::vector< OpenSwath::SwathMap > &swath_maps, RangeMobility &range_im, const OpenMS::DIAScoring &diascoring, OpenSwath_Scores &scores, const double drift_target)
Score a single chromatographic feature using DIA / SWATH scores.
double rt_normalization_factor_
Definition: OpenSwathScoring.h:61
OpenSwath_Scores_Usage su_
Definition: OpenSwathScoring.h:68
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:45
void initialize(double rt_normalization_factor, int add_up_spectra, double spacing_for_spectra_resampling, double merge_spectra_by_peak_width_fraction, const double drift_extra, const OpenSwath_Scores_Usage &su, const std::string &spectrum_addition_method, const std::string &spectrum_merge_method_type, bool use_ms1_ion_mobility, bool apply_im_peak_picking)
Initialize the scoring object.
bool use_ms1_ion_mobility_
whether to use MS1 ion mobility extraction in DIA scores
Definition: OpenSwathScoring.h:69
SpectrumMergeMethodType
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.
SpectrumMergeMethodType spectra_merge_method_type_
Definition: OpenSwathScoring.h:66
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
A structure to hold the individual scores computed for unique ion signatures (UIS) scores for the Inf...
Definition: OpenSwathScores.h:181
A structure to hold the different scores computed by OpenSWATH.
Definition: OpenSwathScores.h:57
Definition: RangeManager.h:466
Definition: TransitionExperiment.h:127
Definition: TransitionExperiment.h:20