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

IsotopicDist.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: Lukas Mueller, Markus Mueller $
00033 // --------------------------------------------------------------------------
00034 //
00035 /*
00036  *  IsotopicDist.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_ISOTOPICDIST_H
00047 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_ISOTOPICDIST_H
00048 
00049 #include <OpenMS/CONCEPT/Types.h>
00050 
00051 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/CentroidPeak.h>
00052 
00053 namespace OpenMS
00054 {
00055 
00056   class OPENMS_DLLAPI IsotopicDist
00057   {
00058 public:
00059 
00060     //  static doubles fDetectableIsoFact;
00061     //  static doubles fIntensityCV;
00062 
00063     static void init();
00064     static bool getMatchingPeaks(std::list<CentroidPeak>::iterator, std::list<CentroidPeak>::iterator, int, double &,
00065                                  double, std::list<std::list<CentroidPeak>::iterator> &);
00066     static void subtractMatchingPeaks(std::list<std::list<CentroidPeak>::iterator> &, int, double, DeconvPeak &);
00067     // static void getDistribution(double,double*&,double*&);
00068     // static void getMassBounds(double,int,int,int,double,double&,double&);
00069 
00070     // static bool getDebug() {return sfDebug;}
00071     // static std::ostream* getDebugStream() {return sfStream;}
00072 
00073     // static void setDebug(bool pDebug) {sfDebug = pDebug;}
00074     // static void setDebugStream(std::ostream* pStream) {sfStream = pStream;}
00075 
00076 private:
00077 
00078     static int getIndex(double, int);
00079 
00080     static double sfIsoDist10[96][20];
00081     static double sfIsoDist50[96][20];
00082     static double sfIsoDist90[96][20];
00083     static double sfIsoMass10[96][20];
00084     static double sfIsoMass50[96][20];
00085     static double sfIsoMass90[96][20];
00086     static int sfNrIsotopes[96];
00087     static int sfMaxMassIndex;
00088     static int sfMaxIsotopeIndex;
00089     static double sfMinMass;
00090     static double sfMaxMass;
00091     static double sfMassStep;
00092 
00093     //static bool sfDebug;
00094     //static std::ostream* sfStream;
00095   };
00096 
00097 // Returns lower and upper mass bounds for all isotopic peaks
00098 //NEVER USED
00099   /*
00100    inline void IsotopicDist::getMassBounds(
00101    double pMass, // m/z of monoisotopic peak
00102    int pCharge, // charge
00103    int pIdx, // index in isodist table
00104    int pIsotope, // 0 = mono isotopic peaks, 1 = C13 peak, ....
00105    double pTol, // Mass error (without calibration) of centroids
00106    double& pLower, // Iso dist masses as C array, monoisotopic peak is set to 0 mass
00107    double& pUpper) // Iso dist intensities as C array
00108    {
00109    pLower = pMass + sfIsoDist10[pIdx][pIsotope]/pCharge - pTol;
00110    pUpper = pMass + sfIsoMass90[pIdx][pIsotope]/pCharge + pTol;
00111    }
00112    */
00113 
00114 // Returns index in isotopic tables
00115   inline int IsotopicDist::getIndex(double pMass,   // m/z of monoisotopic peak
00116                                     int pCharge) // charge
00117   {
00118     double diff;
00119     int idx;
00120 
00121     diff = (pMass * pCharge - sfMinMass) / sfMassStep;
00122     if (diff < 0)
00123       idx = 0;
00124     else if (diff < sfMaxMassIndex)
00125       idx = (int) ((pMass * pCharge - sfMinMass) / sfMassStep);
00126     else
00127       idx = sfMaxMassIndex;
00128 
00129     return idx;
00130   }
00131 
00132 } // ns
00133 
00134 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_ISOTOPICDIST_H

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