Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Compomer.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: Chris Bielow $
32 // $Authors: Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_DATASTRUCTURES_COMPOMER_H
36 #define OPENMS_DATASTRUCTURES_COMPOMER_H
37 
38 #include <OpenMS/CONCEPT/Types.h>
40 #include <OpenMS/OpenMSConfig.h>
41 
42 #include <map>
43 #include <vector>
44 
45 namespace OpenMS
46 {
47 
48  class Adduct;
49  class String;
50 
59  class OPENMS_DLLAPI Compomer
60  {
61 public:
63  enum SIDE {LEFT, RIGHT, BOTH};
64 
65  typedef std::map<String, Adduct> CompomerSide;
66  typedef std::vector<CompomerSide> CompomerComponents;
67 
69  Compomer();
70 
72  Compomer(Int net_charge, double mass, double log_p);
73 
75  Compomer(const Compomer& p);
76 
78  Compomer& operator=(const Compomer& source);
79 
81  void add(const Adduct& a, UInt side);
82 
89  bool isConflicting(const Compomer& cmp, UInt side_this, UInt side_other) const;
90 
92  void setID(const Size& id);
94  const Size& getID() const;
96  const CompomerComponents& getComponent() const;
97 
99  const Int& getNetCharge() const;
100 
102  const double& getMass() const;
103 
105  const Int& getPositiveCharges() const;
106 
108  const Int& getNegativeCharges() const;
109 
111  const double& getLogP() const;
112 
114  const double& getRTShift() const;
115 
117  String getAdductsAsString() const;
118 
121  String getAdductsAsString(UInt side) const;
122 
124  bool isSingleAdduct(Adduct& a, const UInt side) const;
125 
132  Compomer removeAdduct(const Adduct& a) const;
133 
140  Compomer removeAdduct(const Adduct& a, const UInt side) const;
141 
148  StringList getLabels(const UInt side) const;
149 
150 
152  void add(const CompomerSide& add_side, UInt side);
153 
155  friend OPENMS_DLLAPI bool operator<(const Compomer& c1, const Compomer& c2);
156 
158  friend OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const Compomer& cmp);
159 
161  friend OPENMS_DLLAPI bool operator==(const Compomer& a, const Compomer& b);
162 
163 private:
164 
165  CompomerComponents cmp_; //< adducts of left and right side
166  Int net_charge_; //< net charge (right - left)
167  double mass_; //< net mass (right - left)
168  Int pos_charges_; //< net charges on the right
169  Int neg_charges_; //< net charges on the left
170  double log_p_; //< log probability of compomer
171  double rt_shift_; //< expected net RT shift of compomer (-shift_leftside + shift_rightside)
173 
174  }; // \Compomer
175 
176 } // namespace OpenMS
177 
178 #endif //OPENMS_DATASTRUCTURES_COMPOMER_H
CompomerComponents cmp_
Definition: Compomer.h:165
Int neg_charges_
Definition: Compomer.h:169
A more convenient string class.
Definition: String.h:57
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
std::vector< CompomerSide > CompomerComponents
adducts and their abundance etc
Definition: Compomer.h:66
Holds information on an edge connecting two features from a (putative) charge ladder.
Definition: Compomer.h:59
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
Int net_charge_
Definition: Compomer.h:166
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
double rt_shift_
Definition: Compomer.h:171
bool operator<(const MultiplexDeltaMasses &dm1, const MultiplexDeltaMasses &dm2)
std::map< String, Adduct > CompomerSide
Definition: Compomer.h:65
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
Definition: Adduct.h:45
Size id_
Definition: Compomer.h:172
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:74
SIDE
side of compomer (LEFT ^ subtract; RIGHT ^ add)
Definition: Compomer.h:63
double mass_
Definition: Compomer.h:167
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
Int pos_charges_
Definition: Compomer.h:168
double log_p_
Definition: Compomer.h:170
int Int
Signed integer type.
Definition: Types.h:103

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