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-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: Timo Sachsenberg $
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/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/SuperHirnConfig.h>
50 
51 #include <OpenMS/CONCEPT/Types.h>
52 
54 #include <list>
55 
56 namespace OpenMS
57 {
58 
59  class SUPERHIRN_DLLAPI IsotopicDist
60  {
61 public:
62 
63  // static doubles fDetectableIsoFact;
64  // static doubles fIntensityCV;
65 
66  static void init();
67  static bool getMatchingPeaks(std::list<CentroidPeak>::iterator, std::list<CentroidPeak>::iterator, int, double &,
68  double, std::list<std::list<CentroidPeak>::iterator> &);
69  static void subtractMatchingPeaks(std::list<std::list<CentroidPeak>::iterator> &, int, double, DeconvPeak &);
70  // static void getDistribution(double,double*&,double*&);
71  // static void getMassBounds(double,int,int,int,double,double&,double&);
72 
73  // static bool getDebug() {return sfDebug;}
74  // static std::ostream* getDebugStream() {return sfStream;}
75 
76  // static void setDebug(bool pDebug) {sfDebug = pDebug;}
77  // static void setDebugStream(std::ostream* pStream) {sfStream = pStream;}
78 
79 private:
80 
81  static int getIndex(double, int);
82 
83  static double sfIsoDist10[96][20];
84  static double sfIsoDist50[96][20];
85  static double sfIsoDist90[96][20];
86  static double sfIsoMass10[96][20];
87  static double sfIsoMass50[96][20];
88  static double sfIsoMass90[96][20];
89  static int sfNrIsotopes[96];
90  static int sfMaxMassIndex;
91  static int sfMaxIsotopeIndex;
92  static double sfMinMass;
93  static double sfMaxMass;
94  static double sfMassStep;
95 
96  //static bool sfDebug;
97  //static std::ostream* sfStream;
98  };
99 
100 // Returns lower and upper mass bounds for all isotopic peaks
101 //NEVER USED
102  /*
103  inline void IsotopicDist::getMassBounds(
104  double pMass, // m/z of monoisotopic peak
105  int pCharge, // charge
106  int pIdx, // index in isodist table
107  int pIsotope, // 0 = mono isotopic peaks, 1 = C13 peak, ....
108  double pTol, // Mass error (without calibration) of centroids
109  double& pLower, // Iso dist masses as C array, monoisotopic peak is set to 0 mass
110  double& pUpper) // Iso dist intensities as C array
111  {
112  pLower = pMass + sfIsoDist10[pIdx][pIsotope]/pCharge - pTol;
113  pUpper = pMass + sfIsoMass90[pIdx][pIsotope]/pCharge + pTol;
114  }
115  */
116 
117 // Returns index in isotopic tables
118  inline int IsotopicDist::getIndex(double pMass, // m/z of monoisotopic peak
119  int pCharge) // charge
120  {
121  double diff;
122  int idx;
123 
124  diff = (pMass * pCharge - sfMinMass) / sfMassStep;
125  if (diff < 0)
126  idx = 0;
127  else if (diff < sfMaxMassIndex)
128  idx = (int) ((pMass * pCharge - sfMinMass) / sfMassStep);
129  else
130  idx = sfMaxMassIndex;
131 
132  return idx;
133  }
134 
135 } // ns
136 
137 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_ISOTOPICDIST_H
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
static int getIndex(double, int)
Definition: IsotopicDist.h:118
static double sfMassStep
Definition: IsotopicDist.h:94
static int sfMaxMassIndex
Definition: IsotopicDist.h:90
static double sfMaxMass
Definition: IsotopicDist.h:93
Definition: IsotopicDist.h:59
static double sfMinMass
Definition: IsotopicDist.h:92
static int sfMaxIsotopeIndex
Definition: IsotopicDist.h:91
Definition: CentroidPeak.h:114

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