OpenMS
DeconvolvedSpectrum.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: Kyowon Jeong, Jihyung Kim $
6 // $Authors: Kyowon Jeong, Jihyung Kim $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
14 #include <iomanip>
15 
16 namespace OpenMS
17 {
18  class PeakGroup;
19 
29  class OPENMS_DLLAPI DeconvolvedSpectrum
30  {
31  public:
33 
35  DeconvolvedSpectrum() = default;
36 
41  explicit DeconvolvedSpectrum(int scan_number);
42 
44  ~DeconvolvedSpectrum() = default;
45 
48 
50  DeconvolvedSpectrum(DeconvolvedSpectrum&& other) noexcept = default;
51 
53  DeconvolvedSpectrum& operator=(const DeconvolvedSpectrum& deconvolved_spectrum) = default;
54 
60  MSSpectrum toSpectrum(int to_charge, uint min_ms_level, double tol = 10.0, bool retain_undeconvolved = false);
61 
64 
67 
69  int getPrecursorCharge() const;
70 
72  const Precursor& getPrecursor() const;
73 
77  double getCurrentMaxMass(double max_mass) const;
78 
82  double getCurrentMinMass(double min_mass) const;
83 
87  int getCurrentMaxAbsCharge(int max_abs_charge) const;
88 
90  int getScanNumber() const;
91 
94 
97 
100 
103 
105  void setPrecursor(const Precursor& precursor);
106 
108  void setPrecursorIntensity(float i);
109 
111  void setPrecursorScanNumber(int scan_number);
112 
115 
118 
120  void setOriginalSpectrum(const MSSpectrum& spec);
121 
123  void setPeakGroups(std::vector<PeakGroup>& x);
124 
125  //std::vector<PeakGroup> getNonOverlappingPeakGroups() const;
126 
128  std::vector<PeakGroup>::const_iterator begin() const noexcept;
129  std::vector<PeakGroup>::const_iterator end() const noexcept;
130 
131  std::vector<PeakGroup>::iterator begin() noexcept;
132  std::vector<PeakGroup>::iterator end() noexcept;
133 
134  const PeakGroup& operator[](Size i) const;
135  PeakGroup& operator[](Size i);
136  void push_back(const PeakGroup& pg);
137  void pop_back();
138  PeakGroup& back();
139  Size size() const noexcept;
140  void clear();
141  void reserve(Size n);
142  bool empty() const;
143  bool isDecoy() const;
144 
146  void sort();
148  void sortByQscore();
149 
151  bool operator<(const DeconvolvedSpectrum& a) const;
152 
153  bool operator>(const DeconvolvedSpectrum& a) const;
154 
155  bool operator==(const DeconvolvedSpectrum& a) const;
156 
157 
158  private:
160  std::vector<PeakGroup> peak_groups_;
162  MSSpectrum spec_;
164  PeakGroup precursor_peak_group_;
166  Precursor precursor_peak_;
168  Precursor::ActivationMethod activation_method_ = Precursor::ActivationMethod::CID;
170  int scan_number_ = 0, precursor_scan_number_ = 0;
172  FLASHDeconvHelperStructs::IsobaricQuantities quantities_;
173  };
174 } // namespace OpenMS
A class representing a deconvolved spectrum. DeconvolvedSpectrum consists of PeakGroups representing ...
Definition: DeconvolvedSpectrum.h:30
void setPrecursor(const Precursor &precursor)
set precursor for MSn for n>1
void setOriginalSpectrum(const MSSpectrum &spec)
original spectrum setter
const MSSpectrum & getOriginalSpectrum() const
original spectrum getter
std::vector< PeakGroup >::const_iterator begin() const noexcept
iterators and vector operators for std::vector<PeakGroup> peak_groups_ in this spectrum
void setPrecursorIntensity(float i)
set precursor peak intensity
FLASHDeconvHelperStructs::LogMzPeak LogMzPeak
Definition: DeconvolvedSpectrum.h:32
FLASHDeconvHelperStructs::IsobaricQuantities getQuantities() const
return isobaric quantities
void setPeakGroups(std::vector< PeakGroup > &x)
set peak groups in this spectrum
DeconvolvedSpectrum(int scan_number)
Constructor for DeconvolvedSpectrum. Takes the spectrum and scan number calculated from outside.
int getPrecursorCharge() const
precursor charge getter (set in registerPrecursor)
~DeconvolvedSpectrum()=default
default destructor
int getCurrentMaxAbsCharge(int max_abs_charge) const
const PeakGroup & getPrecursorPeakGroup() const
get precursor peak group for MSn (n>1) spectrum. It returns an empty peak group if no peak group is r...
DeconvolvedSpectrum(DeconvolvedSpectrum &&other) noexcept=default
move constructor
double getCurrentMinMass(double min_mass) const
double getCurrentMaxMass(double max_mass) const
void setPrecursorPeakGroup(const PeakGroup &pg)
set precursor peakGroup
DeconvolvedSpectrum(const DeconvolvedSpectrum &)=default
copy constructor
void setPrecursorScanNumber(int scan_number)
set precursor scan number
MSSpectrum toSpectrum(int to_charge, uint min_ms_level, double tol=10.0, bool retain_undeconvolved=false)
int getScanNumber() const
get scan number of the original spectrum
const Precursor::ActivationMethod & getActivationMethod() const
get activation method
void setQuantities(const FLASHDeconvHelperStructs::IsobaricQuantities &quantities)
set isobaric quantities
DeconvolvedSpectrum()=default
default constructor
const Precursor & getPrecursor() const
get precursor peak
void setActivationMethod(const Precursor::ActivationMethod &method)
set activation method
DeconvolvedSpectrum & operator=(const DeconvolvedSpectrum &deconvolved_spectrum)=default
assignment operator
int getPrecursorScanNumber() const
get precursor scan number - only if it is registered. Otherwise return 0
log transformed peak. After deconvolution, all necessary information from deconvolution such as charg...
Definition: FLASHDeconvHelperStructs.h:166
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Class describing a deconvolved mass. A mass contains multiple (LogMz) peaks of different charges and ...
Definition: PeakGroup.h:26
Precursor meta information.
Definition: Precursor.h:35
ActivationMethod
Method of activation.
Definition: Precursor.h:59
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
FLASHIda C++ to C# (or vice versa) bridge functions The functions here are called in C# to invoke fun...
Definition: FeatureDeconvolution.h:22
Isobaric quantities.
Definition: FLASHDeconvHelperStructs.h:152
Wrapper struct for all the structs needed by the FLASHDeconv Three structures are defined: Precalcula...
Definition: FLASHDeconvHelperStructs.h:30