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