OpenMS  3.0.0
Precursor.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: Mathias Walzer $
32 // $Authors: Marc Sturm, Mathias Walzer $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <OpenMS/KERNEL/Peak1D.h>
41 
42 #include <set>
43 
44 namespace OpenMS
45 {
58  class OPENMS_DLLAPI Precursor :
59  public CVTermList,
60  public Peak1D
61  {
62 
63 public:
65  Precursor() = default;
67  Precursor(const Precursor&) = default;
68 
69  // note: we implement the move constructor ourselves due to a bug in MSVS
70  // 2015/2017 which cannot produce a default move constructor for classes
71  // that contain STL containers (other than vector).
72 
74  Precursor(Precursor&&) noexcept;
76  ~Precursor() override = default;
77 
79  Precursor& operator=(const Precursor&) = default;
81  Precursor& operator=(Precursor&&) & = default;
82 
85  {
86  CID,
87  PSD,
88  PD,
89  SID,
90  BIRD,
91  ECD,
92  IMD,
93  SORI,
94  HCID,
95  LCID,
96  PHD,
97  ETD,
98  PQD,
99  TRAP,
100  HCD,
103  SIZE_OF_ACTIVATIONMETHOD
104  };
106  static const std::string NamesOfActivationMethod[SIZE_OF_ACTIVATIONMETHOD];
107  static const std::string NamesOfActivationMethodShort[SIZE_OF_ACTIVATIONMETHOD];
108 
110  bool operator==(const Precursor & rhs) const;
112  bool operator!=(const Precursor & rhs) const;
113 
115  const std::set<ActivationMethod>& getActivationMethods() const;
117  std::set<ActivationMethod>& getActivationMethods();
119  StringList getActivationMethodsAsString() const;
121  void setActivationMethods(const std::set<ActivationMethod> & activation_methods);
122 
124  double getActivationEnergy() const;
126  void setActivationEnergy(double activation_energy);
127 
138  double getIsolationWindowLowerOffset() const;
140  void setIsolationWindowLowerOffset(double bound);
141 
152  double getIsolationWindowUpperOffset() const;
154  void setIsolationWindowUpperOffset(double bound);
155 
163  double getDriftTime() const;
165  void setDriftTime(double drift_time);
166 
170  DriftTimeUnit getDriftTimeUnit() const;
171 
175  void setDriftTimeUnit(DriftTimeUnit dt);
176 
177 
188  double getDriftTimeWindowLowerOffset() const;
190  void setDriftTimeWindowLowerOffset(double drift_time);
191 
202  double getDriftTimeWindowUpperOffset() const;
204  void setDriftTimeWindowUpperOffset(double drift_time);
205 
207  Int getCharge() const;
209  void setCharge(Int charge);
210 
212  std::vector<Int>& getPossibleChargeStates();
214  const std::vector<Int>& getPossibleChargeStates() const;
216  void setPossibleChargeStates(const std::vector<Int> & possible_charge_states);
217 
219  inline double getUnchargedMass() const
220  {
221  int c = charge_;
222  (c == 0) ? c = 2 : c = charge_;
223  return getMZ() * c - c * Constants::PROTON_MASS_U;
224  }
225 
226 protected:
227 
228  std::set<ActivationMethod> activation_methods_;
229  double activation_energy_{};
230  double window_low_{};
231  double window_up_{};
232  double drift_time_{-1};
233  double drift_window_low_{};
234  double drift_window_up_{};
236  Int charge_{};
237  std::vector<Int> possible_charge_states_;
238  };
239 } // namespace OpenMS
240 
OpenMS::Precursor::INSOURCE
in-source collision-induced dissociation (MS:1001880)
Definition: Precursor.h:101
OpenMS::Precursor::getUnchargedMass
double getUnchargedMass() const
Returns the uncharged mass of the precursor, if charge is unknown, i.e. 0, our best guess is doubly c...
Definition: Precursor.h:219
OpenMS::Precursor::SORI
Sustained off-resonance irradiation.
Definition: Precursor.h:93
OpenMS::DriftTimeUnit::NONE
No unit.
OpenMS::Precursor::TRAP
trap-type collision-induced dissociation (MS:1002472)
Definition: Precursor.h:99
OpenMS::Precursor::HCD
beam-type collision-induced dissociation (MS:1000422) "HCD"
Definition: Precursor.h:100
OpenMS::Precursor::SID
Surface-induced dissociation.
Definition: Precursor.h:89
OpenMS::Precursor::activation_methods_
std::set< ActivationMethod > activation_methods_
Definition: Precursor.h:228
KDTree::operator!=
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
Peak1D.h
OpenMS::Precursor::BIRD
Blackbody infrared radiative dissociation.
Definition: Precursor.h:90
OpenMS::Precursor::PHD
Photodissociation.
Definition: Precursor.h:96
OpenMS::Constants::c
const double c
Definition: Constants.h:209
OpenMS::DriftTimeUnit
DriftTimeUnit
Drift time unit for ion mobility.
Definition: IMTypes.h:45
OpenMS::Precursor::IMD
Infrared multiphoton dissociation.
Definition: Precursor.h:92
OpenMS::Precursor::CID
Collision-induced dissociation.
Definition: Precursor.h:86
OpenMS::Precursor::ECD
Electron capture dissociation.
Definition: Precursor.h:91
OpenMS::Precursor::ETD
Electron transfer dissociation.
Definition: Precursor.h:97
OpenMS::Constants::PROTON_MASS_U
const double PROTON_MASS_U
Definition: Constants.h:116
Constants.h
OpenMS::Precursor::LCID
Low-energy collision-induced dissociation.
Definition: Precursor.h:95
OpenMS::Precursor
Precursor meta information.
Definition: Precursor.h:58
OpenMS::Int
int Int
Signed integer type.
Definition: Types.h:102
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::Peak1D
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:53
OpenMS::StringList
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
OpenMS::Precursor::PQD
Pulsed q dissociation.
Definition: Precursor.h:98
IMTypes.h
OpenMS::CVTermList
Representation of controlled vocabulary term list.
Definition: CVTermList.h:52
OpenMS::Precursor::PSD
Post-source decay.
Definition: Precursor.h:87
CVTermList.h
OpenMS::Internal::operator==
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
OpenMS::Precursor::LIFT
Bruker proprietary method (MS:1002000)
Definition: Precursor.h:102
OpenMS::Precursor::PD
Plasma desorption.
Definition: Precursor.h:88
OpenMS::Precursor::ActivationMethod
ActivationMethod
Method of activation.
Definition: Precursor.h:84
OpenMS::Precursor::possible_charge_states_
std::vector< Int > possible_charge_states_
Definition: Precursor.h:237
OpenMS::Precursor::HCID
High-energy collision-induced dissociation.
Definition: Precursor.h:94