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-2013.
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: Stephan Aiche $
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 <ostream>
41 #include <iostream>
42 
44 
45 namespace OpenMS
46 {
47  namespace ims
48  {
49 
61  class OPENMS_DLLAPI IMSElement
62  {
63 public:
65  typedef std::string name_type;
66 
69 
72 
75 
78 
81 
84  {}
85 
87  IMSElement(const IMSElement & element) :
88  name_(element.name_),
89  sequence_(element.sequence_),
90  isotopes_(element.isotopes_)
91  {}
92 
94  IMSElement(const name_type & name,
95  const isotopes_type & isotopes) :
96  name_(name),
97  sequence_(name),
98  isotopes_(isotopes)
99  {}
100 
102  IMSElement(const name_type & name,
103  mass_type mass) :
104  name_(name),
105  sequence_(name),
106  isotopes_(mass)
107  {}
108 
110  IMSElement(const name_type & name,
111  nominal_mass_type nominal_mass = 0) :
112  name_(name),
113  sequence_(name),
114  isotopes_(nominal_mass)
115  {}
116 
123  const name_type & getName() const
124  {
125  return name_;
126  }
127 
134  void setName(const name_type & name)
135  {
136  this->name_ = name;
137  }
138 
144  const name_type & getSequence() const
145  {
146  return sequence_;
147  }
148 
154  void setSequence(const name_type & sequence)
155  {
156  this->sequence_ = sequence;
157  }
158 
165  {
166  return isotopes_.getNominalMass();
167  }
168 
175  mass_type getMass(size_type index = 0) const
176  {
177  return isotopes_.getMass(index);
178  }
179 
186  {
187  return isotopes_.getAverageMass();
188  }
189 
196  mass_type getIonMass(int electrons_number = 1) const
197  {
198  return this->getMass() - electrons_number * ELECTRON_MASS_IN_U;
199  }
200 
207  {
208  return isotopes_;
209  }
210 
217  {
218  this->isotopes_ = isotopes;
219  }
220 
227  IMSElement & operator=(const IMSElement & element);
228 
236  bool operator==(const IMSElement & element) const;
237 
245  bool operator!=(const IMSElement & element) const;
246 
248  virtual ~IMSElement() {}
249 
250 private:
253 
256 
259  };
260 
267  OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const IMSElement & element);
268 
269  } // namespace ims
270 } // namespace OpenMS
271 
272 #endif // OPENMS_CHEMISTRY_MASSDECOMPOSITION_IMS_ELEMENT_H
IMSElement(const name_type &name, mass_type mass)
Constructor with name and mass of single isotope.
Definition: IMSElement.h:102
const IMSIsotopeDistribution & getIsotopeDistribution() const
Definition: IMSElement.h:206
virtual ~IMSElement()
Default destructor.
Definition: IMSElement.h:248
isotopes_type isotopes_
Element&#39;s isotope distribution.
Definition: IMSElement.h:258
void setIsotopeDistribution(const IMSIsotopeDistribution &isotopes)
Definition: IMSElement.h:216
mass_type getMass(size_type index=0) const
Definition: IMSElement.h:175
const name_type & getSequence() const
Definition: IMSElement.h:144
IMSElement(const name_type &name, nominal_mass_type nominal_mass=0)
Constructor with name and nominal mass.
Definition: IMSElement.h:110
const name_type & getName() const
Definition: IMSElement.h:123
IMSElement(const name_type &name, const isotopes_type &isotopes)
Constructor with name and isotope distribution.
Definition: IMSElement.h:94
Represents a distribution of isotopes restricted to the first K elements.
Definition: IMSIsotopeDistribution.h:88
name_type name_
Element&#39;s name.
Definition: IMSElement.h:252
static const mass_type ELECTRON_MASS_IN_U
Mass of electron.
Definition: IMSElement.h:80
mass_type getIonMass(int electrons_number=1) const
Definition: IMSElement.h:196
peaks_container::size_type size_type
Type of peaks container&#39;s size.
Definition: IMSIsotopeDistribution.h:130
Represents a chemical atom with name and isotope distribution.
Definition: IMSElement.h:61
name_type sequence_
Element&#39;s sequence.
Definition: IMSElement.h:255
IMSElement(const IMSElement &element)
Copy constructor.
Definition: IMSElement.h:87
isotopes_type::mass_type mass_type
Type of isotope mass.
Definition: IMSElement.h:71
mass_type getAverageMass() const
Definition: IMSElement.h:185
void setSequence(const name_type &sequence)
Definition: IMSElement.h:154
IMSIsotopeDistribution isotopes_type
Type of element&#39;s isotope distribution.
Definition: IMSElement.h:68
nominal_mass_type getNominalMass() const
Definition: IMSElement.h:164
IMSElement()
Empty constructor.
Definition: IMSElement.h:83
isotopes_type::size_type size_type
Type of isotopes size.
Definition: IMSElement.h:77
std::string name_type
Type of element&#39;s name.
Definition: IMSElement.h:65
isotopes_type::nominal_mass_type nominal_mass_type
Type of distribution nominal mass.
Definition: IMSElement.h:74
std::ostream & operator<<(std::ostream &os, const IMSAlphabet &alphabet)
void setName(const name_type &name)
Definition: IMSElement.h:134

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:15 using doxygen 1.8.5