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

CentroidPeak.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: Florian Zeller $
00032 // $Authors: Markus Mueller $
00033 // --------------------------------------------------------------------------
00034 //
00035 /*
00036  *  CentroidPeak.h
00037  *  PeakDetection
00038  *
00039  *  Created by Markus Mueller on 10/19/06.
00040  *
00041  *  Ported to OpenMS by Florian Zeller, florian.zeller@bsse.ethz.ch
00042  *  December 2010
00043  *
00044  */
00045 
00046 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_CENTROIDPEAK_H
00047 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_CENTROIDPEAK_H
00048 
00049 #include <OpenMS/CONCEPT/Types.h>
00050 
00051 #include <ostream>
00052 #include <cmath>
00053 #include <vector>
00054 
00055 namespace OpenMS
00056 {
00057 
00058   class OPENMS_DLLAPI CentroidPeak
00059   {
00060 public:
00061 
00062 //static int sfCentroidWindowWidth;
00063 
00064     CentroidPeak();
00065     CentroidPeak(double, double);
00066     CentroidPeak(double, double, double);
00067     CentroidPeak(const CentroidPeak &);
00068     // Copy constructor
00069     CentroidPeak(const CentroidPeak *);
00070 
00071     CentroidPeak & operator=(const CentroidPeak &);
00072 
00073     bool operator<(const CentroidPeak &);
00074 
00075     virtual ~CentroidPeak();
00076 
00077     // getters and setters
00078     double getMass();
00079     double getIntensity();
00080     int getIsotopIdx();
00081     double getSignalToNoise();
00082     double getFittedIntensity();
00083     double getOrgIntensity();
00084     std::string getExtraPeakInfo();
00085     double getRetentionTime();
00086 
00087     void setMass(double pMass);
00088     void setIntensity(double pIntensity);
00089     void setIsotopIdx(double pIsotopIdx);
00090     void setSignalToNoise(double in);
00091     void setFittedIntensity(double pFittedIntensity);
00092     void setOrgIntensity(double pOrgIntensity);
00093     void setExtraPeakInfo(std::string in);
00094     void setRetentionTime(double in);
00095 
00096     void show_info();
00097     void subtractIntensity(double);
00098 
00099 protected:
00100 
00101     int isotopIdx_;
00102     double mass_;
00103     double intensity_;
00104     double fittedIntensity_;
00105     double orgIntensity_;
00106     double tr_;
00107     double signalToNoise_;
00108     std::string extraPeakInfo_;
00109   };
00110 
00111   // Class for deconvoluted isotopic patterns
00112   class DeconvPeak :
00113     public CentroidPeak
00114   {
00115 public:
00116 
00117     DeconvPeak();
00118     DeconvPeak(double, double, int, int, double, double);
00119     DeconvPeak(const DeconvPeak &);
00120     DeconvPeak(const DeconvPeak *);
00121 
00122     DeconvPeak & operator=(const DeconvPeak &);
00123 
00124     virtual ~DeconvPeak();
00125 
00126     // shows the info of the peak:
00127     void show_info();
00128 
00129     // getters and setters
00130     int getCharge();
00131     int getNrIsotopes();
00132     double getC13MassError();
00133     double getScore();
00134     std::vector<CentroidPeak> getIsotopicPeaks();
00135 
00136     void setCharge(int pCharge);
00137     void setNrIsotopes(int pNrIsotopes);
00138     void setC13MassError(double pC13MassError);
00139     void setScore(double pScore);
00140     void setIsotopicPeaks(std::vector<CentroidPeak> pIsotopicPeaks);
00141 
00142 protected:
00143 
00144     int charge_;
00145     int nrIsotopes_;
00146     double c13MassError_;
00147     double score_;
00148     std::vector<CentroidPeak> isotopicPeaks_;
00149   };
00150 
00151   // stream operators
00152   std::ostream & operator<<(std::ostream &, CentroidPeak &);
00153   std::ostream & operator<<(std::ostream &, DeconvPeak &);
00154 
00155   // inline implementation of getters and setters
00156 
00157   inline double CentroidPeak::getMass()
00158   {
00159     return mass_;
00160   }
00161 
00162   inline double CentroidPeak::getIntensity()
00163   {
00164     return intensity_;
00165   }
00166 
00167   inline int CentroidPeak::getIsotopIdx()
00168   {
00169     return isotopIdx_;
00170   }
00171 
00172   inline double CentroidPeak::getSignalToNoise()
00173   {
00174     return signalToNoise_;
00175   }
00176 
00177   inline double CentroidPeak::getFittedIntensity()
00178   {
00179     return fittedIntensity_;
00180   }
00181 
00182   inline double CentroidPeak::getOrgIntensity()
00183   {
00184     return orgIntensity_;
00185   }
00186 
00187   inline std::string CentroidPeak::getExtraPeakInfo()
00188   {
00189     return extraPeakInfo_;
00190   }
00191 
00192   inline double CentroidPeak::getRetentionTime()
00193   {
00194     return tr_;
00195   }
00196 
00197   inline void CentroidPeak::setMass(double pMass)
00198   {
00199     mass_ = pMass;
00200   }
00201 
00202   inline void CentroidPeak::setIntensity(double pIntensity)
00203   {
00204     intensity_ = pIntensity;
00205   }
00206 
00207   inline void CentroidPeak::setIsotopIdx(double pIsotopIdx)
00208   {
00209     isotopIdx_ = (int) pIsotopIdx;
00210   }
00211 
00212   inline void CentroidPeak::setSignalToNoise(double in)
00213   {
00214     signalToNoise_ = in;
00215   }
00216 
00217   inline void CentroidPeak::setFittedIntensity(double pFittedIntensity)
00218   {
00219     fittedIntensity_ = pFittedIntensity;
00220   }
00221 
00222   inline void CentroidPeak::setOrgIntensity(double pOrgIntensity)
00223   {
00224     orgIntensity_ = pOrgIntensity;
00225   }
00226 
00227   inline void CentroidPeak::setExtraPeakInfo(std::string in)
00228   {
00229     extraPeakInfo_ = in;
00230   }
00231 
00232   inline void CentroidPeak::setRetentionTime(double in)
00233   {
00234     tr_ = in;
00235   }
00236 
00237   //
00238 
00239   inline int DeconvPeak::getCharge()
00240   {
00241     return charge_;
00242   }
00243 
00244   inline int DeconvPeak::getNrIsotopes()
00245   {
00246     return nrIsotopes_;
00247   }
00248 
00249   inline double DeconvPeak::getC13MassError()
00250   {
00251     return c13MassError_;
00252   }
00253 
00254   inline double DeconvPeak::getScore()
00255   {
00256     return score_;
00257   }
00258 
00259   inline std::vector<CentroidPeak> DeconvPeak::getIsotopicPeaks()
00260   {
00261     return isotopicPeaks_;
00262   }
00263 
00264   inline void DeconvPeak::setCharge(int pCharge)
00265   {
00266     charge_ = pCharge;
00267   }
00268 
00269   inline void DeconvPeak::setC13MassError(double pC13MassError)
00270   {
00271     c13MassError_ = pC13MassError;
00272   }
00273 
00274   inline void DeconvPeak::setNrIsotopes(int pNrIsotopes)
00275   {
00276     nrIsotopes_ = pNrIsotopes;
00277   }
00278 
00279   inline void DeconvPeak::setScore(double pScore)
00280   {
00281     score_ = pScore;
00282   }
00283 
00284   inline void DeconvPeak::setIsotopicPeaks(std::vector<CentroidPeak> pIsotopicPeaks)
00285   {
00286     isotopicPeaks_ = pIsotopicPeaks;
00287   }
00288 
00289 } // ns
00290 
00291 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_CENTROIDPEAK_H

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