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 #ifndef OPENMS_DATASTRUCTURES_COMPOMER_H
00036 #define OPENMS_DATASTRUCTURES_COMPOMER_H
00037
00038 #include <vector>
00039
00040 #include <OpenMS/CONCEPT/Macros.h>
00041 #include <OpenMS/DATASTRUCTURES/Map.h>
00042
00043 namespace OpenMS
00044 {
00045
00046 class String;
00047 class StringList;
00048 class Adduct;
00049
00058 class OPENMS_DLLAPI Compomer
00059 {
00060 public:
00062 enum SIDE {LEFT, RIGHT, BOTH};
00063
00064 typedef Map<String, Adduct> CompomerSide;
00065 typedef std::vector<CompomerSide> CompomerComponents;
00066
00068 Compomer();
00069
00071 Compomer(Int net_charge, DoubleReal mass, DoubleReal log_p);
00072
00074 Compomer(const Compomer & p);
00075
00077 Compomer & operator=(const Compomer & source);
00078
00080 void add(const Adduct & a, UInt side);
00081
00088 bool isConflicting(const Compomer & cmp, UInt side_this, UInt side_other) const;
00089
00091 void setID(const Size & id);
00093 const Size & getID() const;
00095 const CompomerComponents & getComponent() const;
00096
00098 const Int & getNetCharge() const;
00099
00101 const DoubleReal & getMass() const;
00102
00104 const Int & getPositiveCharges() const;
00105
00107 const Int & getNegativeCharges() const;
00108
00110 const DoubleReal & getLogP() const;
00111
00113 const DoubleReal & getRTShift() const;
00114
00116 String getAdductsAsString() const;
00117
00120 String getAdductsAsString(UInt side) const;
00121
00123 bool isSingleAdduct(Adduct & a, const UInt side) const;
00124
00131 Compomer removeAdduct(const Adduct & a) const;
00132
00139 Compomer removeAdduct(const Adduct & a, const UInt side) const;
00140
00147 StringList getLabels(const UInt side) const;
00148
00149
00151 void add(const CompomerSide & add_side, UInt side);
00152
00154 friend OPENMS_DLLAPI bool operator<(const Compomer & c1, const Compomer & c2);
00155
00157 friend OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const Compomer & cmp);
00158
00160 friend OPENMS_DLLAPI bool operator==(const Compomer & a, const Compomer & b);
00161
00162 private:
00163
00164 CompomerComponents cmp_;
00165 Int net_charge_;
00166 DoubleReal mass_;
00167 Int pos_charges_;
00168 Int neg_charges_;
00169 DoubleReal log_p_;
00170 DoubleReal rt_shift_;
00171 Size id_;
00172
00173 };
00174
00175 }
00176
00177 #endif //OPENMS_DATASTRUCTURES_COMPOMER_H