Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

Compomer.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------------
00002 //                   OpenMS -- Open-Source Mass Spectrometry
00003 // --------------------------------------------------------------------------
00004 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
00005 // ETH Zurich, and Freie Universitaet Berlin 2002-2012.
00006 //
00007 // This software is released under a three-clause BSD license:
00008 //  * Redistributions of source code must retain the above copyright
00009 //    notice, this list of conditions and the following disclaimer.
00010 //  * Redistributions in binary form must reproduce the above copyright
00011 //    notice, this list of conditions and the following disclaimer in the
00012 //    documentation and/or other materials provided with the distribution.
00013 //  * Neither the name of any author or any participating institution
00014 //    may be used to endorse or promote products derived from this software
00015 //    without specific prior written permission.
00016 // For a full list of authors, refer to the file AUTHORS.
00017 // --------------------------------------------------------------------------
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
00022 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // --------------------------------------------------------------------------
00031 // $Maintainer: Chris Bielow $
00032 // $Authors: Chris Bielow $
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_; //< adducts of left and right side
00165     Int net_charge_;         //< net charge (right - left)
00166     DoubleReal mass_;        //< net mass (right - left)
00167     Int pos_charges_;        //< net charges on the right
00168     Int neg_charges_;        //< net charges on the left
00169     DoubleReal log_p_;   //< log probability of compomer
00170     DoubleReal rt_shift_; //< expected net RT shift of compomer (-shift_leftside + shift_rightside)
00171     Size id_;
00172 
00173   }; // \Compomer
00174 
00175 } // namespace OpenMS
00176 
00177 #endif //OPENMS_DATASTRUCTURES_COMPOMER_H

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:38 using doxygen 1.7.1