OpenMS
IsotopeWavelet Class Reference

Implements the isotope wavelet function. More...

#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/IsotopeWavelet.h>

Collaboration diagram for IsotopeWavelet:
[legend]

Classes

union  fi_
 Internal union for fast computation of the power function. More...
 

Static Public Member Functions

static IsotopeWaveletinit (const double max_m, const UInt max_charge)
 
static IsotopeWaveletgetInstance ()
 
static void destroy ()
 
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 function. Please use. More...
 
static double getValueByLambda (const double lambda, const double tz1)
 Returns the value of the isotope wavelet at position t via a fast table lookup. Usually, you do not need to call this function. Please use. More...
 
static double getValueByLambdaExtrapol (const double lambda, const double tz1)
 Returns the value of the isotope wavelet at position t. This function is usually significantly slower than the table lookup performed in. More...
 
static double getValueByLambdaExact (const double lambda, const double tz1)
 
static UInt getMaxCharge ()
 Returns the largest charge state we will consider. More...
 
static void setMaxCharge (const UInt max_charge)
 Sets the max_charge parameter. More...
 
static double getTableSteps ()
 Returns the table_steps_ parameter. More...
 
static double getInvTableSteps ()
 Returns the inv_table_steps_ parameter. More...
 
static void setTableSteps (const double table_steps)
 Sets the table_steps parameter. More...
 
static double getLambdaL (const double m)
 Returns the mass-parameter lambda (linear fit). More...
 
static const IsotopeDistribution::ContainerTypegetAveragine (const double m, UInt *size=nullptr)
 Computes the averagine isotopic distribution we would expect at the de-convoluted mass. More...
 
static Size getGammaTableMaxIndex ()
 Returns the largest possible index for the pre-sampled gamma table. More...
 
static Size getExpTableMaxIndex ()
 Returns the largest possible index for the pre-sampled exp table. More...
 
static float myPow (float a, float b)
 Internally used function; uses register shifts for fast computation of the power function. More...
 
static UInt getMzPeakCutOffAtMonoPos (const double mass, const UInt z)
 
static UInt getNumPeakCutOff (const double mass, const UInt z)
 
static UInt getNumPeakCutOff (const double mz)
 

Protected Member Functions

 IsotopeWavelet ()
 Default Constructor. More...
 
 IsotopeWavelet (const double max_m, const UInt max_charge)
 Constructor. More...
 
virtual ~IsotopeWavelet ()
 Destructor. More...
 

Static Protected Member Functions

static void preComputeExpensiveFunctions_ (const double max_m)
 Should be called once before values are drawn from the isotope wavelet function. The function is automatically called by the public constructor. More...
 
static void computeIsotopeDistributionSize_ (const double max_m)
 Initializes the internally used averagine model; automatically called by the public constructor. More...
 
static float myPow2_ (float i)
 Internally used function; uses register shifts for fast computation of the power function. The function follows http://www.dctsystems.co.uk/Software/power.html , code by Ian Stephenson, DCT Systems, NCCA Bournemouth University. More...
 
static float myLog2_ (float i)
 Internally used function uses register shifts for fast computation of the power function. The function follows http://www.dctsystems.co.uk/Software/power.html , code by Ian Stephenson, DCT Systems, NCCA Bournemouth University. More...
 

Static Protected Attributes

static IsotopeWaveletme_
 
static UInt max_charge_
 
static double table_steps_
 
static double inv_table_steps_
 
static std::vector< double > gamma_table_
 
static std::vector< double > gamma_table_new_
 
static std::vector< double > exp_table_
 
static std::vector< double > sine_table_
 
static CoarseIsotopePatternGenerator solver_
 
static IsotopeDistribution averagine_
 
static Size gamma_table_max_index_
 
static Size exp_table_max_index_
 

Detailed Description

Implements the isotope wavelet function.

The IsotopeWavelet class implements the isotope wavelet as described by R. Hussong, A. Tholey, A. Hildebrandt: Efficient Analysis of Mass Spectrometry Data Using the Isotope Wavelet. Proceedings of the 3rd international Symposium in Computational Life Sciences (Complife07). American Institute of Physics (AIP) Proceedings (2007).

Note
This class features a singleton design pattern.

Class Documentation

◆ OpenMS::IsotopeWavelet::fi_

union OpenMS::IsotopeWavelet::fi_

Internal union for fast computation of the power function.

Collaboration diagram for IsotopeWavelet::fi_:
[legend]
Class Members
float f
Int i

Constructor & Destructor Documentation

◆ IsotopeWavelet() [1/2]

IsotopeWavelet ( )
protected

Default Constructor.

◆ IsotopeWavelet() [2/2]

IsotopeWavelet ( const double  max_m,
const UInt  max_charge 
)
protected

Constructor.

Parameters
max_mThe maximal de-convoluted mass that occurs in the current data set.
max_chargeThe maximal charge state we would like to analyze.

◆ ~IsotopeWavelet()

virtual ~IsotopeWavelet ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ computeIsotopeDistributionSize_()

static void computeIsotopeDistributionSize_ ( const double  max_m)
staticprotected

Initializes the internally used averagine model; automatically called by the public constructor.

Parameters
max_mThe maximal de-convoluted mass that occurs in the current data set.

◆ destroy()

static void destroy ( )
static

Deletes the singleton instance.

◆ getAveragine()

static const IsotopeDistribution::ContainerType& getAveragine ( const double  m,
UInt size = nullptr 
)
static

Computes the averagine isotopic distribution we would expect at the de-convoluted mass.

Parameters
mThe de-convoluted mass m.
sizeReturns the number of significant peaks within a pattern occurring at mass m.
Returns
The isotopic distribution.

◆ getExpTableMaxIndex()

static Size getExpTableMaxIndex ( )
inlinestatic

Returns the largest possible index for the pre-sampled exp table.

◆ getGammaTableMaxIndex()

static Size getGammaTableMaxIndex ( )
inlinestatic

Returns the largest possible index for the pre-sampled gamma table.

◆ getInstance()

static IsotopeWavelet* getInstance ( )
inlinestatic

Returns an pointer to the current instance of the class.

◆ getInvTableSteps()

static double getInvTableSteps ( )
inlinestatic

Returns the inv_table_steps_ parameter.

This is an internally used parameter controlling the precision of several pre-sampling steps. Normally, this parameter can be left unchanged.

◆ getLambdaL()

static double getLambdaL ( const double  m)
static

◆ getMaxCharge()

static UInt getMaxCharge ( )
inlinestatic

Returns the largest charge state we will consider.

◆ getMzPeakCutOffAtMonoPos()

◆ getNumPeakCutOff() [1/2]

◆ getNumPeakCutOff() [2/2]

static UInt getNumPeakCutOff ( const double  mz)
static

◆ getTableSteps()

static double getTableSteps ( )
inlinestatic

Returns the table_steps_ parameter.

This is an internally used parameter controlling the precision of several pre-sampling steps. Normally, this parameter can be left unchanged.

◆ getValueByLambda()

static double getValueByLambda ( const double  lambda,
const double  tz1 
)
static

Returns the value of the isotope wavelet at position t via a fast table lookup. Usually, you do not need to call this function. Please use.

See also
sampleTheWavelet instead.

Note that this functions returns the pure function value of psi and not the normalized (average=0) value given by Psi.

Parameters
lambdaThe mass-parameter lambda.
tz1t (the position) times the charge (z) plus 1.

Referenced by IsotopeWaveletTransform< PeakType >::getTransform(), and IsotopeWaveletTransform< PeakType >::getTransformHighRes().

◆ getValueByLambdaExact()

static double getValueByLambdaExact ( const double  lambda,
const double  tz1 
)
static

◆ getValueByLambdaExtrapol()

static double getValueByLambdaExtrapol ( const double  lambda,
const double  tz1 
)
static

Returns the value of the isotope wavelet at position t. This function is usually significantly slower than the table lookup performed in.

See also
getValueByLambda. Nevertheless, it might be necessary to call this function due to extrapolating reasons caused by the alignment of the wavelet.

Usually, you do not need to call this function. Please use

See also
sampleTheWavelet instead.

Note that this functions returns the pure function value of psi and not the normalized (average=0) value given by Psi.

Parameters
lambdaThe mass-parameter lambda.
tz1t (the position) times the charge (z) plus 1.

◆ getValueByMass()

static double getValueByMass ( const double  t,
const double  m,
const UInt  z,
const Int  mode = +1 
)
inlinestatic

Returns the value of the isotope wavelet at position t. Usually, you do not need to call this function. Please use.

See also
sampleTheWavelet instead.

Note that this functions returns the pure function value of psi and not the normalized (average=0) value given by Psi.

Parameters
tThe position at which the wavelet has to be drawn (within the coordinate system of the wavelet).
mThe m/z position within the signal (i.e. the mass not de-charged) within the signal.
zThe charge z we want to detect.
modeIndicates whether positive mode (+1) or negative mode (-1) has been used for ionization.

References OpenMS::Constants::IW_PROTON_MASS.

◆ init()

static IsotopeWavelet* init ( const double  max_m,
const UInt  max_charge 
)
static

The init function; creates an instance of this singleton class.

Referenced by IsotopeWaveletTransform< PeakType >::IsotopeWaveletTransform().

◆ myLog2_()

static float myLog2_ ( float  i)
staticprotected

Internally used function uses register shifts for fast computation of the power function. The function follows http://www.dctsystems.co.uk/Software/power.html , code by Ian Stephenson, DCT Systems, NCCA Bournemouth University.

Note
Please, do not modify this function.

◆ myPow()

static float myPow ( float  a,
float  b 
)
static

Internally used function; uses register shifts for fast computation of the power function.

Note
Please, do not modify this function.

◆ myPow2_()

static float myPow2_ ( float  i)
staticprotected

Internally used function; uses register shifts for fast computation of the power function. The function follows http://www.dctsystems.co.uk/Software/power.html , code by Ian Stephenson, DCT Systems, NCCA Bournemouth University.

Note
Please, do not modify this function.

◆ preComputeExpensiveFunctions_()

static void preComputeExpensiveFunctions_ ( const double  max_m)
staticprotected

Should be called once before values are drawn from the isotope wavelet function. The function is automatically called by the public constructor.

The function pre-computes the expensive gamma function. Parameters related to this function are:

See also
max_charge_ and
peak_cutoff_. If both of these are set correctly
getValue will never compute the gamma function online.
Parameters
max_mThe maximal de-convoluted mass that occurs in the current data set.

◆ setMaxCharge()

static void setMaxCharge ( const UInt  max_charge)
inlinestatic

Sets the max_charge parameter.

◆ setTableSteps()

static void setTableSteps ( const double  table_steps)
inlinestatic

Sets the table_steps parameter.

Member Data Documentation

◆ averagine_

IsotopeDistribution averagine_
staticprotected

◆ exp_table_

std::vector<double> exp_table_
staticprotected

Internal table for the precomputed values of the exponential function.

◆ exp_table_max_index_

Size exp_table_max_index_
staticprotected

◆ gamma_table_

std::vector<double> gamma_table_
staticprotected

Internal table for the precomputed values of the gamma function.

◆ gamma_table_max_index_

Size gamma_table_max_index_
staticprotected

◆ gamma_table_new_

std::vector<double> gamma_table_new_
staticprotected

◆ inv_table_steps_

double inv_table_steps_
staticprotected

◆ max_charge_

UInt max_charge_
staticprotected

This parameter determines the maximal charge state we will consider.

◆ me_

IsotopeWavelet* me_
staticprotected

The singleton pointer.

◆ sine_table_

std::vector<double> sine_table_
staticprotected

Internal table for the precomputed values of the exponential function.

◆ solver_

CoarseIsotopePatternGenerator solver_
staticprotected

Internally used averagine model.

◆ table_steps_

double table_steps_
staticprotected

This parameter determines the sample rate for the pre-computation of the gamma function.