Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
IsotopicDist.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-2013.
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: Florian Zeller $
32 // $Authors: Lukas Mueller, Markus Mueller $
33 // --------------------------------------------------------------------------
34 //
35 /*
36  * IsotopicDist.h
37  * PeakDetection
38  *
39  * Created by Markus Mueller on 10/19/06.
40  *
41  * Ported to OpenMS by Florian Zeller, florian.zeller@bsse.ethz.ch
42  * December 2010
43  *
44  */
45 
46 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_ISOTOPICDIST_H
47 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_ISOTOPICDIST_H
48 
49 #include <OpenMS/CONCEPT/Types.h>
50 
52 
53 namespace OpenMS
54 {
55 
56  class OPENMS_DLLAPI IsotopicDist
57  {
58 public:
59 
60  // static doubles fDetectableIsoFact;
61  // static doubles fIntensityCV;
62 
63  static void init();
64  static bool getMatchingPeaks(std::list<CentroidPeak>::iterator, std::list<CentroidPeak>::iterator, int, double &,
65  double, std::list<std::list<CentroidPeak>::iterator> &);
66  static void subtractMatchingPeaks(std::list<std::list<CentroidPeak>::iterator> &, int, double, DeconvPeak &);
67  // static void getDistribution(double,double*&,double*&);
68  // static void getMassBounds(double,int,int,int,double,double&,double&);
69 
70  // static bool getDebug() {return sfDebug;}
71  // static std::ostream* getDebugStream() {return sfStream;}
72 
73  // static void setDebug(bool pDebug) {sfDebug = pDebug;}
74  // static void setDebugStream(std::ostream* pStream) {sfStream = pStream;}
75 
76 private:
77 
78  static int getIndex(double, int);
79 
80  static double sfIsoDist10[96][20];
81  static double sfIsoDist50[96][20];
82  static double sfIsoDist90[96][20];
83  static double sfIsoMass10[96][20];
84  static double sfIsoMass50[96][20];
85  static double sfIsoMass90[96][20];
86  static int sfNrIsotopes[96];
87  static int sfMaxMassIndex;
88  static int sfMaxIsotopeIndex;
89  static double sfMinMass;
90  static double sfMaxMass;
91  static double sfMassStep;
92 
93  //static bool sfDebug;
94  //static std::ostream* sfStream;
95  };
96 
97 // Returns lower and upper mass bounds for all isotopic peaks
98 //NEVER USED
99  /*
100  inline void IsotopicDist::getMassBounds(
101  double pMass, // m/z of monoisotopic peak
102  int pCharge, // charge
103  int pIdx, // index in isodist table
104  int pIsotope, // 0 = mono isotopic peaks, 1 = C13 peak, ....
105  double pTol, // Mass error (without calibration) of centroids
106  double& pLower, // Iso dist masses as C array, monoisotopic peak is set to 0 mass
107  double& pUpper) // Iso dist intensities as C array
108  {
109  pLower = pMass + sfIsoDist10[pIdx][pIsotope]/pCharge - pTol;
110  pUpper = pMass + sfIsoMass90[pIdx][pIsotope]/pCharge + pTol;
111  }
112  */
113 
114 // Returns index in isotopic tables
115  inline int IsotopicDist::getIndex(double pMass, // m/z of monoisotopic peak
116  int pCharge) // charge
117  {
118  double diff;
119  int idx;
120 
121  diff = (pMass * pCharge - sfMinMass) / sfMassStep;
122  if (diff < 0)
123  idx = 0;
124  else if (diff < sfMaxMassIndex)
125  idx = (int) ((pMass * pCharge - sfMinMass) / sfMassStep);
126  else
127  idx = sfMaxMassIndex;
128 
129  return idx;
130  }
131 
132 } // ns
133 
134 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_ISOTOPICDIST_H
static int getIndex(double, int)
Definition: IsotopicDist.h:115
static double sfMassStep
Definition: IsotopicDist.h:91
static int sfMaxMassIndex
Definition: IsotopicDist.h:87
static double sfMaxMass
Definition: IsotopicDist.h:90
Definition: IsotopicDist.h:56
static double sfMinMass
Definition: IsotopicDist.h:89
static int sfMaxIsotopeIndex
Definition: IsotopicDist.h:88
Definition: CentroidPeak.h:112

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:15 using doxygen 1.8.5