OpenMS
IonMobilityScoring.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
18 
19 // scoring
21 
22 #include <vector>
23 namespace OpenMS
24 {
25 
26  struct RangeMobility;
27  struct RangeMZ;
28 
40  class OPENMS_DLLAPI IonMobilityScoring
41  {
44 
45  struct MobilityPeak
46  {
47  double im;
48  double intensity;
50  MobilityPeak (double im_, double int_) :
51  im(im_),
52  intensity(int_)
53  {}
54  };
55  typedef std::vector< MobilityPeak > IonMobilogram;
56 
57  public:
58 
61 
64 
80  static void driftScoring(const SpectrumSequence& spectra,
81  const std::vector<TransitionType> & transitions,
82  OpenSwath_Scores & scores,
83  const double drift_target,
84  RangeMobility im_range,
85  const double dia_extraction_window_,
86  const bool dia_extraction_ppm_,
87  const bool use_spline,
88  const double drift_extra);
89 
105  static void driftScoringMS1(const SpectrumSequence& spectra,
106  const std::vector<TransitionType> & transitions,
107  OpenSwath_Scores & scores,
108  const double drift_target,
109  RangeMobility im_range,
110  const double dia_extraction_window_,
111  const bool dia_extraction_ppm_,
112  const bool use_spline,
113  const double drift_extra);
114 
129  static void driftScoringMS1Contrast(const SpectrumSequence& spectra, const SpectrumSequence& ms1spectrum,
130  const std::vector<TransitionType> & transitions,
131  OpenSwath_Scores & scores,
132  RangeMobility im_range,
133  const double dia_extraction_window_,
134  const bool dia_extraction_ppm_,
135  const double drift_extra);
136 
149  static void computeIonMobilogram(const SpectrumSequence& spectra,
150  const RangeMZ & mz_range,
151  const RangeMobility & im_range,
152  double & im,
153  double & intensity,
154  IonMobilogram& res,
155  double eps);
156 
157 
158  private:
162  static std::vector<double> computeGrid_(const std::vector< IonMobilogram >& mobilograms, double eps);
163 
164 
165  /*
166  @brief Extracts ion mobility values projected onto a grid
167 
168  For a given ion mobility profile and a grid, compute an ion mobilogram
169  across the grid for each ion mobility data point. Returns two data arrays
170  for the ion mobilogram: intensity (y) and ion mobility (x). Zero values are
171  inserted if no data point was found for a given grid value.
172 
173  @param profile The ion mobility data
174  @param im_grid The grid to be used
175  @param al_int_values The intensity vector (y)
176  @param al_im_values The ion mobility vector (x)
177  @param eps Epsilon used for computing the ion mobility grid
178  @param max_peak_idx The grid position of the maximum
179  */
180  static void alignToGrid_(const IonMobilogram& profile,
181  const std::vector<double>& im_grid,
182  std::vector< double >& al_int_values,
183  std::vector< double >& al_im_values,
184  double eps,
185  Size & max_peak_idx);
186 
187  };
188 }
189 
A class that calls the ion mobility scoring routines.
Definition: IonMobilityScoring.h:41
static void driftScoring(const SpectrumSequence &spectra, const std::vector< TransitionType > &transitions, OpenSwath_Scores &scores, const double drift_target, RangeMobility im_range, const double dia_extraction_window_, const bool dia_extraction_ppm_, const bool use_spline, const double drift_extra)
Performs scoring of the ion mobility dimension in MS2.
~IonMobilityScoring()
Destructor.
static void computeIonMobilogram(const SpectrumSequence &spectra, const RangeMZ &mz_range, const RangeMobility &im_range, double &im, double &intensity, IonMobilogram &res, double eps)
computes ion mobilogram to be used in scoring based on mz_range and im_range. Also integrates intensi...
std::vector< MobilityPeak > IonMobilogram
Definition: IonMobilityScoring.h:55
static void driftScoringMS1(const SpectrumSequence &spectra, const std::vector< TransitionType > &transitions, OpenSwath_Scores &scores, const double drift_target, RangeMobility im_range, const double dia_extraction_window_, const bool dia_extraction_ppm_, const bool use_spline, const double drift_extra)
Performs scoring of the ion mobility dimension in MS1.
OpenSwath::LightTransition TransitionType
Definition: IonMobilityScoring.h:43
static void alignToGrid_(const IonMobilogram &profile, const std::vector< double > &im_grid, std::vector< double > &al_int_values, std::vector< double > &al_im_values, double eps, Size &max_peak_idx)
static void driftScoringMS1Contrast(const SpectrumSequence &spectra, const SpectrumSequence &ms1spectrum, const std::vector< TransitionType > &transitions, OpenSwath_Scores &scores, RangeMobility im_range, const double dia_extraction_window_, const bool dia_extraction_ppm_, const double drift_extra)
Performs scoring of the ion mobility dimension in MS1 and MS2 (contrast)
OpenSwath::LightCompound CompoundType
Definition: IonMobilityScoring.h:42
static std::vector< double > computeGrid_(const std::vector< IonMobilogram > &mobilograms, double eps)
helper function to computeIonMobilogram. Discretizes ion mobility values into a grid.
IonMobilityScoring()
Constructor.
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
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
Definition: IonMobilityScoring.h:46
double intensity
Definition: IonMobilityScoring.h:48
double im
Definition: IonMobilityScoring.h:47
MobilityPeak(double im_, double int_)
Definition: IonMobilityScoring.h:50
A structure to hold the different scores computed by OpenSWATH.
Definition: OpenSwathScores.h:58
Definition: RangeManager.h:345
Definition: RangeManager.h:463
Definition: TransitionExperiment.h:127
Definition: TransitionExperiment.h:20