OpenMS
DeconvolvedSpectrum.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-2022.
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: Kyowon Jeong, Jihyung Kim $
32 // $Authors: Kyowon Jeong, Jihyung Kim $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
40 #include <iomanip>
41 
42 namespace OpenMS
43 {
44  class PeakGroup;
45 
55  class OPENMS_DLLAPI DeconvolvedSpectrum
56  {
57  public:
59 
61  DeconvolvedSpectrum() = default;
62 
67  explicit DeconvolvedSpectrum(int scan_number);
68 
70  ~DeconvolvedSpectrum() = default;
71 
73  DeconvolvedSpectrum(const DeconvolvedSpectrum&) = default;
74 
76  DeconvolvedSpectrum(DeconvolvedSpectrum&& other) noexcept = default;
77 
79  DeconvolvedSpectrum& operator=(const DeconvolvedSpectrum& deconvolved_spectrum) = default;
80 
81 
87  MSSpectrum toSpectrum(int to_charge, uint min_ms_level, double tol = 10.0, bool retain_undeconvolved = false);
88 
90  const MSSpectrum& getOriginalSpectrum() const;
91 
93  PeakGroup& getPrecursorPeakGroup();
94 
96  int getPrecursorCharge() const;
97 
99  const Precursor& getPrecursor() const;
100 
104  double getCurrentMaxMass(double max_mass) const;
105 
109  double getCurrentMinMass(double min_mass) const;
110 
114  int getCurrentMaxAbsCharge(int max_abs_charge) const;
115 
117  int getScanNumber() const;
118 
120  int getPrecursorScanNumber() const;
121 
123  const Precursor::ActivationMethod& getActivationMethod() const;
124 
126  void setPrecursor(const Precursor& precursor);
127 
129  void setPrecursorIntensity(float i);
130 
132  void setPrecursorScanNumber(int scan_number);
133 
135  void setActivationMethod(const Precursor::ActivationMethod& method);
136 
138  void setPrecursorPeakGroup(const PeakGroup& pg);
139 
141  void setOriginalSpectrum(const MSSpectrum& spec);
142 
144  void setPeakGroups(std::vector<PeakGroup>& x);
145 
147  std::vector<PeakGroup>::const_iterator begin() const noexcept;
148  std::vector<PeakGroup>::const_iterator end() const noexcept;
149 
150  std::vector<PeakGroup>::iterator begin() noexcept;
151  std::vector<PeakGroup>::iterator end() noexcept;
152 
153  const PeakGroup& operator[](Size i) const;
154  PeakGroup& operator[](Size i);
155  void push_back(const PeakGroup& pg);
156  Size size() const noexcept;
157  void clear();
158  void reserve(Size n);
159  bool empty() const;
160 
162  void sort();
164  void sortByQscore();
165 
166  private:
168  std::vector<PeakGroup> peak_groups_;
170  MSSpectrum spec_;
172  PeakGroup precursor_peak_group_;
174  Precursor precursor_peak_;
176  Precursor::ActivationMethod activation_method_;
178  int scan_number_ = 0, precursor_scan_number_ = 0;
179  };
180 } // namespace OpenMS
Precursor meta information.
Definition: Precursor.h:58
FLASHDeconvHelperStructs::LogMzPeak LogMzPeak
Definition: DeconvolvedSpectrum.h:58
log transformed peak. After deconvolution, all necessary information from deconvolution such as charg...
Definition: FLASHDeconvHelperStructs.h:164
STL namespace.
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
Class describing a deconvolved mass. A mass contains multiple (LogMz) peaks of different charges and ...
Definition: PeakGroup.h:51
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
ActivationMethod
Method of activation.
Definition: Precursor.h:84
A class representing a deconvolved spectrum. DeconvolvedSpectrum consists of PeakGroups representing ...
Definition: DeconvolvedSpectrum.h:55