OpenMS
SplineInterpolatedPeaks.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: Lars Nilse $
6 // $Authors: Lars Nilse $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
14 
15 #include <vector>
16 
17 namespace OpenMS
18 {
33 class OPENMS_DLLAPI SplineInterpolatedPeaks
34 {
35  public:
42  SplineInterpolatedPeaks(const std::vector<double>& pos, const std::vector<double>& intensity);
43 
48  SplineInterpolatedPeaks(const MSSpectrum& raw_spectrum);
49 
54  SplineInterpolatedPeaks(const MSChromatogram& raw_chromatogram);
55 
60 
64  double getPosMin() const;
65 
69  double getPosMax() const;
70 
78  size_t size() const;
79 
83  class OPENMS_DLLAPI Navigator
84  {
85  public:
94  Navigator(const std::vector<SplinePackage>* packages, double pos_max, double scaling);
95 
100 
105 
110  double eval(double pos);
111 
119  double getNextPos(double pos);
120 
121  private:
122 
126  const std::vector<SplinePackage> * packages_;
127 
132 
136  double pos_max_;
137 
148  };
149 
164 
165  private:
166 
169 
173  double pos_min_;
174  double pos_max_;
175 
179  std::vector<SplinePackage> packages_;
180 
184  void init_(const std::vector<double>& pos, const std::vector<double>& intensity);
185 
186 
187 };
188 
189 }
190 
The representation of a chromatogram.
Definition: MSChromatogram.h:30
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
iterator class for access of spline packages
Definition: SplineInterpolatedPeaks.h:84
double getNextPos(double pos)
returns the next sensible m/z (or RT) position for scanning through a spectrum (or chromatogram) (fas...
Navigator(const std::vector< SplinePackage > *packages, double pos_max, double scaling)
constructor of iterator
Navigator()
constructor (for pyOpenMS)
size_t last_package_
index of spline package last accessed
Definition: SplineInterpolatedPeaks.h:131
double pos_step_width_scaling_
scaling of the step width
Definition: SplineInterpolatedPeaks.h:147
const std::vector< SplinePackage > * packages_
list of spline packages to be accessed
Definition: SplineInterpolatedPeaks.h:126
double eval(double pos)
returns spline interpolated intensity at this position (fast access since we can start search from la...
double pos_max_
m/z (or RT) limits of the spectrum (or chromatogram)
Definition: SplineInterpolatedPeaks.h:136
Data structure for spline interpolation of MS1 spectra and chromatograms.
Definition: SplineInterpolatedPeaks.h:34
SplineInterpolatedPeaks(const MSSpectrum &raw_spectrum)
constructor taking an MSSpectrum (and an optional scaling factor for the m/z step width)
SplineInterpolatedPeaks::Navigator getNavigator(double scaling=0.7)
returns an iterator for access of spline packages
double getPosMax() const
returns the maximum m/z (or RT) of the spectrum
size_t size() const
Get number of spline packages found during initialization.
SplineInterpolatedPeaks(const std::vector< double > &pos, const std::vector< double > &intensity)
constructor taking two vectors (and an optional scaling factor for the m/z (or RT) step width)
void init_(const std::vector< double > &pos, const std::vector< double > &intensity)
section common for all constructors
SplineInterpolatedPeaks(const MSChromatogram &raw_chromatogram)
constructor taking an MSChromatogram (and an optional scaling factor for the RT step width)
std::vector< SplinePackage > packages_
set of spline packages each interpolating in a certain m/z (or RT) range
Definition: SplineInterpolatedPeaks.h:179
SplineInterpolatedPeaks()
hide default C'tor
double pos_max_
Definition: SplineInterpolatedPeaks.h:174
double getPosMin() const
returns the minimum m/z (or RT) of the spectrum
double pos_min_
m/z (or RT) limits of the spectrum
Definition: SplineInterpolatedPeaks.h:173
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19