Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
IMSElement.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-2017.
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: Timo Sachsenberg $
32 // $Authors: Anton Pervukhin <Anton.Pervukhin@CeBiTec.Uni-Bielefeld.DE> $
33 // --------------------------------------------------------------------------
34 //
35 
36 #ifndef OPENMS_CHEMISTRY_MASSDECOMPOSITION_IMS_IMSELEMENT_H
37 #define OPENMS_CHEMISTRY_MASSDECOMPOSITION_IMS_IMSELEMENT_H
38 
39 #include <string>
40 #include <iosfwd>
42 
43 namespace OpenMS
44 {
45  namespace ims
46  {
47 
59  class OPENMS_DLLAPI IMSElement
60  {
61 public:
63  typedef std::string name_type;
64 
67 
70 
73 
76 
78  static const mass_type ELECTRON_MASS_IN_U;
79 
82  {}
83 
85  IMSElement(const IMSElement & element) :
86  name_(element.name_),
87  sequence_(element.sequence_),
88  isotopes_(element.isotopes_)
89  {}
90 
92  IMSElement(const name_type & name,
93  const isotopes_type & isotopes) :
94  name_(name),
95  sequence_(name),
96  isotopes_(isotopes)
97  {}
98 
100  IMSElement(const name_type & name,
101  mass_type mass) :
102  name_(name),
103  sequence_(name),
104  isotopes_(mass)
105  {}
106 
108  IMSElement(const name_type & name,
109  nominal_mass_type nominal_mass = 0) :
110  name_(name),
111  sequence_(name),
112  isotopes_(nominal_mass)
113  {}
114 
121  const name_type & getName() const
122  {
123  return name_;
124  }
125 
132  void setName(const name_type & name)
133  {
134  this->name_ = name;
135  }
136 
142  const name_type & getSequence() const
143  {
144  return sequence_;
145  }
146 
152  void setSequence(const name_type & sequence)
153  {
154  this->sequence_ = sequence;
155  }
156 
162  nominal_mass_type getNominalMass() const
163  {
164  return isotopes_.getNominalMass();
165  }
166 
173  mass_type getMass(size_type index = 0) const
174  {
175  return isotopes_.getMass(index);
176  }
177 
183  mass_type getAverageMass() const
184  {
185  return isotopes_.getAverageMass();
186  }
187 
194  mass_type getIonMass(int electrons_number = 1) const
195  {
196  return this->getMass() - electrons_number * ELECTRON_MASS_IN_U;
197  }
198 
205  {
206  return isotopes_;
207  }
208 
215  {
216  this->isotopes_ = isotopes;
217  }
218 
225  IMSElement & operator=(const IMSElement & element);
226 
234  bool operator==(const IMSElement & element) const;
235 
243  bool operator!=(const IMSElement & element) const;
244 
246  virtual ~IMSElement() {}
247 
248 private:
250  name_type name_;
251 
253  name_type sequence_;
254 
256  isotopes_type isotopes_;
257  };
258 
265  OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const IMSElement & element);
266 
267  } // namespace ims
268 } // namespace OpenMS
269 
270 #endif // OPENMS_CHEMISTRY_MASSDECOMPOSITION_IMS_ELEMENT_H
nominal_mass_type getNominalMass() const
Definition: IMSElement.h:162
IMSElement(const name_type &name, mass_type mass)
Constructor with name and mass of single isotope.
Definition: IMSElement.h:100
virtual ~IMSElement()
Default destructor.
Definition: IMSElement.h:246
isotopes_type isotopes_
Element&#39;s isotope distribution.
Definition: IMSElement.h:256
void setIsotopeDistribution(const IMSIsotopeDistribution &isotopes)
Definition: IMSElement.h:214
IMSElement(const name_type &name, nominal_mass_type nominal_mass=0)
Constructor with name and nominal mass.
Definition: IMSElement.h:108
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
IMSElement(const name_type &name, const isotopes_type &isotopes)
Constructor with name and isotope distribution.
Definition: IMSElement.h:92
Represents a distribution of isotopes restricted to the first K elements.
Definition: IMSIsotopeDistribution.h:88
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
const IMSIsotopeDistribution & getIsotopeDistribution() const
Definition: IMSElement.h:204
name_type name_
Element&#39;s name.
Definition: IMSElement.h:250
static const mass_type ELECTRON_MASS_IN_U
Mass of electron.
Definition: IMSElement.h:78
peaks_container::size_type size_type
Type of peaks container&#39;s size.
Definition: IMSIsotopeDistribution.h:133
Represents a chemical atom with name and isotope distribution.
Definition: IMSElement.h:59
name_type sequence_
Element&#39;s sequence.
Definition: IMSElement.h:253
const name_type & getSequence() const
Definition: IMSElement.h:142
IMSElement(const IMSElement &element)
Copy constructor.
Definition: IMSElement.h:85
isotopes_type::mass_type mass_type
Type of isotope mass.
Definition: IMSElement.h:69
void setSequence(const name_type &sequence)
Definition: IMSElement.h:152
unsigned int nominal_mass_type
Type of isotope nominal mass.
Definition: IMSIsotopeDistribution.h:99
mass_type getIonMass(int electrons_number=1) const
Definition: IMSElement.h:194
mass_type getMass(size_type index=0) const
Definition: IMSElement.h:173
IMSIsotopeDistribution isotopes_type
Type of element&#39;s isotope distribution.
Definition: IMSElement.h:66
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
IMSElement()
Empty constructor.
Definition: IMSElement.h:81
mass_type getAverageMass() const
Definition: IMSElement.h:183
isotopes_type::size_type size_type
Type of isotopes size.
Definition: IMSElement.h:75
std::string name_type
Type of element&#39;s name.
Definition: IMSElement.h:63
isotopes_type::nominal_mass_type nominal_mass_type
Type of distribution nominal mass.
Definition: IMSElement.h:72
const name_type & getName() const
Definition: IMSElement.h:121
std::ostream & operator<<(std::ostream &os, const IMSAlphabet &alphabet)
void setName(const name_type &name)
Definition: IMSElement.h:132

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:01 using doxygen 1.8.13