Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef OPENMS_CHEMISTRY_MASSDECOMPOSITION_IMS_IMSELEMENT_H
00037 #define OPENMS_CHEMISTRY_MASSDECOMPOSITION_IMS_IMSELEMENT_H
00038
00039 #include <string>
00040 #include <ostream>
00041 #include <iostream>
00042
00043 #include <OpenMS/CHEMISTRY/MASSDECOMPOSITION/IMS/IMSIsotopeDistribution.h>
00044
00045 namespace OpenMS
00046 {
00047 namespace ims
00048 {
00049
00061 class OPENMS_DLLAPI IMSElement
00062 {
00063 public:
00065 typedef std::string name_type;
00066
00068 typedef IMSIsotopeDistribution isotopes_type;
00069
00071 typedef isotopes_type::mass_type mass_type;
00072
00074 typedef isotopes_type::nominal_mass_type nominal_mass_type;
00075
00077 typedef isotopes_type::size_type size_type;
00078
00080 static const mass_type ELECTRON_MASS_IN_U;
00081
00083 IMSElement()
00084 {}
00085
00087 IMSElement(const IMSElement & element) :
00088 name_(element.name_),
00089 sequence_(element.sequence_),
00090 isotopes_(element.isotopes_)
00091 {}
00092
00094 IMSElement(const name_type & name,
00095 const isotopes_type & isotopes) :
00096 name_(name),
00097 sequence_(name),
00098 isotopes_(isotopes)
00099 {}
00100
00102 IMSElement(const name_type & name,
00103 mass_type mass) :
00104 name_(name),
00105 sequence_(name),
00106 isotopes_(mass)
00107 {}
00108
00110 IMSElement(const name_type & name,
00111 nominal_mass_type nominal_mass = 0) :
00112 name_(name),
00113 sequence_(name),
00114 isotopes_(nominal_mass)
00115 {}
00116
00123 const name_type & getName() const
00124 {
00125 return name_;
00126 }
00127
00134 void setName(const name_type & name)
00135 {
00136 this->name_ = name;
00137 }
00138
00144 const name_type & getSequence() const
00145 {
00146 return sequence_;
00147 }
00148
00154 void setSequence(const name_type & sequence)
00155 {
00156 this->sequence_ = sequence;
00157 }
00158
00164 nominal_mass_type getNominalMass() const
00165 {
00166 return isotopes_.getNominalMass();
00167 }
00168
00175 mass_type getMass(size_type index = 0) const
00176 {
00177 return isotopes_.getMass(index);
00178 }
00179
00185 mass_type getAverageMass() const
00186 {
00187 return isotopes_.getAverageMass();
00188 }
00189
00196 mass_type getIonMass(int electrons_number = 1) const
00197 {
00198 return this->getMass() - electrons_number * ELECTRON_MASS_IN_U;
00199 }
00200
00206 const IMSIsotopeDistribution & getIsotopeDistribution() const
00207 {
00208 return isotopes_;
00209 }
00210
00216 void setIsotopeDistribution(const IMSIsotopeDistribution & isotopes)
00217 {
00218 this->isotopes_ = isotopes;
00219 }
00220
00227 IMSElement & operator=(const IMSElement & element);
00228
00236 bool operator==(const IMSElement & element) const;
00237
00245 bool operator!=(const IMSElement & element) const;
00246
00248 virtual ~IMSElement() {}
00249
00250 private:
00252 name_type name_;
00253
00255 name_type sequence_;
00256
00258 isotopes_type isotopes_;
00259 };
00260
00267 OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const IMSElement & element);
00268
00269 }
00270 }
00271
00272 #endif // OPENMS_CHEMISTRY_MASSDECOMPOSITION_IMS_ELEMENT_H