OpenMS
SplineInterpolatedPeaks.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- 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:
92  Navigator(const std::vector<SplinePackage> * packages, double posMax, double scaling);
93 
98 
103 
108  double eval(double pos);
109 
117  double getNextPos(double pos);
118 
119  private:
120 
124  const std::vector<SplinePackage> * packages_;
125 
130 
134  double pos_max_;
135 
146  };
147 
162 
163  private:
164 
167 
171  double pos_min_;
172  double pos_max_;
173 
177  std::vector<SplinePackage> packages_;
178 
182  void init_(const std::vector<double>& pos, const std::vector<double>& intensity);
183 
184 
185 };
186 
187 }
188 
The representation of a chromatogram.
Definition: MSChromatogram.h:31
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()
constructor (for pyOpenMS)
size_t last_package_
index of spline package last accessed
Definition: SplineInterpolatedPeaks.h:129
double pos_step_width_scaling_
scaling of the step width
Definition: SplineInterpolatedPeaks.h:145
const std::vector< SplinePackage > * packages_
list of spline packages to be accessed
Definition: SplineInterpolatedPeaks.h:124
Navigator(const std::vector< SplinePackage > *packages, double posMax, double scaling)
constructor of iterator
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:134
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:177
SplineInterpolatedPeaks()
hide default C'tor
double pos_max_
Definition: SplineInterpolatedPeaks.h:172
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:171
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22