Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
IsotopeWavelet.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: $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_ISOTOPEWAVELET_H
36 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_ISOTOPEWAVELET_H
37 
41 
42 namespace OpenMS
43 {
51  class OPENMS_DLLAPI IsotopeWavelet
52  {
53 public:
54 
56  static IsotopeWavelet * init(const double max_m, const UInt max_charge);
57 
60  {
61  return me_;
62  }
63 
65  static void destroy();
66 
67 
77  static double getValueByMass(const double t, const double m, const UInt z, const Int mode = +1)
78  {
79  return getValueByLambda(getLambdaL(m * z - z * mode * Constants::IW_PROTON_MASS), t * z + 1);
80  }
81 
90  static double getValueByLambda(const double lambda, const double tz1);
91 
104  static double getValueByLambdaExtrapol(const double lambda, const double tz1);
105 
106  static double getValueByLambdaExact(const double lambda, const double tz1);
107 
108 
111  {
112  return max_charge_;
113  }
114 
116  static void setMaxCharge(const UInt max_charge)
117  {
118  max_charge_ = max_charge;
119  }
120 
125  static double getTableSteps()
126  {
127  return table_steps_;
128  }
129 
134  static double getInvTableSteps()
135  {
136  return inv_table_steps_;
137  }
138 
140  static void setTableSteps(const double table_steps)
141  {
142  inv_table_steps_ = 1. / table_steps;
143  table_steps_ = table_steps;
144  }
145 
147  static double getLambdaL(const double m);
148 
149 
154  static const IsotopeDistribution::ContainerType & getAveragine(const double m, UInt * size = NULL);
155 
156 
159  {
160  return gamma_table_max_index_;
161  }
162 
165  {
166  return exp_table_max_index_;
167  }
168 
171  static float myPow(float a, float b);
172 
173  static UInt getMzPeakCutOffAtMonoPos(const double mass, const UInt z);
174 
175  static UInt getNumPeakCutOff(const double mass, const UInt z);
176 
177  static UInt getNumPeakCutOff(const double mz);
178 
179 
180 protected:
181 
183  static IsotopeWavelet * me_;
184 
186  IsotopeWavelet();
187 
191  IsotopeWavelet(const double max_m, const UInt max_charge);
192 
193 
195  virtual ~IsotopeWavelet();
196 
197 
206  static void preComputeExpensiveFunctions_(const double max_m);
207 
208 
211  static void computeIsotopeDistributionSize_(const double max_m);
212 
213 
218  static float myPow2_(float i);
219 
224  static float myLog2_(float i);
225 
227  union fi_
228  {
230  float f;
231  };
232 
235 
237  static double table_steps_;
238  static double inv_table_steps_;
239 
241  static std::vector<double> gamma_table_;
242  static std::vector<double> gamma_table_new_;
243 
245  static std::vector<double> exp_table_;
246 
248  static std::vector<double> sine_table_;
249 
252 
255 
256  };
257 
258 } //namespace
259 
260 #endif
float f
Definition: IsotopeWavelet.h:230
static std::vector< double > gamma_table_
Definition: IsotopeWavelet.h:241
static Size gamma_table_max_index_
Definition: IsotopeWavelet.h:253
const double IW_PROTON_MASS
Definition: IsotopeWaveletConstants.h:69
static std::vector< double > exp_table_
Definition: IsotopeWavelet.h:245
static void setMaxCharge(const UInt max_charge)
Sets the max_charge parameter.
Definition: IsotopeWavelet.h:116
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
Isotope distribution class.
Definition: IsotopeDistribution.h:62
Int i
Definition: IsotopeWavelet.h:229
static std::vector< double > gamma_table_new_
Definition: IsotopeWavelet.h:242
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
static double inv_table_steps_
Definition: IsotopeWavelet.h:238
Implements the isotope wavelet function.
Definition: IsotopeWavelet.h:51
static IsotopeWavelet * me_
Definition: IsotopeWavelet.h:183
static Size getExpTableMaxIndex()
Returns the largest possible index for the pre-sampled exp table.
Definition: IsotopeWavelet.h:164
static UInt getMaxCharge()
Returns the largest charge state we will consider.
Definition: IsotopeWavelet.h:110
static IsotopeWavelet * getInstance()
Definition: IsotopeWavelet.h:59
static void setTableSteps(const double table_steps)
Sets the table_steps parameter.
Definition: IsotopeWavelet.h:140
static double table_steps_
Definition: IsotopeWavelet.h:237
static Size exp_table_max_index_
Definition: IsotopeWavelet.h:254
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
static Size getGammaTableMaxIndex()
Returns the largest possible index for the pre-sampled gamma table.
Definition: IsotopeWavelet.h:158
Internal union for fast computation of the power function.
Definition: IsotopeWavelet.h:227
static UInt max_charge_
Definition: IsotopeWavelet.h:234
static double getInvTableSteps()
Returns the inv_table_steps_ parameter.
Definition: IsotopeWavelet.h:134
static double getTableSteps()
Returns the table_steps_ parameter.
Definition: IsotopeWavelet.h:125
std::vector< std::pair< Size, double > > ContainerType
container type, first holds the weight of the isotope, second the probability
Definition: IsotopeDistribution.h:69
int Int
Signed integer type.
Definition: Types.h:103
static double getValueByMass(const double t, const double m, const UInt z, const Int mode=+1)
Returns the value of the isotope wavelet at position t. Usually, you do not need to call this functio...
Definition: IsotopeWavelet.h:77
static IsotopeDistribution averagine_
Definition: IsotopeWavelet.h:251
static std::vector< double > sine_table_
Definition: IsotopeWavelet.h:248

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