| OpenMS 2.5.0

Public Member Functions | Protected Attributes | List of all members
IsoSpecThresholdWrapper Class Reference

A non-generator version of IsoSpecThresholdGeneratorWrapper. More...

`#include <OpenMS/CHEMISTRY/ISOTOPEDISTRIBUTION/IsoSpecWrapper.h>`

Inheritance diagram for IsoSpecThresholdWrapper:

## Public Member Functions

| IsoSpecThresholdWrapper (const std::vector< int > &isotopeNumbers, const std::vector< int > &atomCounts, const std::vector< std::vector< double > > &isotopeMasses, const std::vector< std::vector< double > > &isotopeProbabilities, double threshold, bool absolute)
| Constructor. More...
| IsoSpecThresholdWrapper (const EmpiricalFormula &formula, double threshold, bool absolute)
| Setup the algorithm to run on an EmpiricalFormula. More...
virtual IsotopeDistribution | run () override final
| Run the algorithm. More...
Public Member Functions inherited from IsoSpecWrapper
virtual | ~IsoSpecWrapper ()

## Protected Attributes

IsoSpec::IsoThresholdGenerator | ITG

## Detailed Description

A non-generator version of IsoSpecThresholdGeneratorWrapper.

This is the simplest algorithm - most users will however want to use IsoSpecTotalProbWrapper. The reason for it is that when thresholding by peak intensity one has no idea how far the obtained spectrum is from a real spectrum. For example, consider human insulin: if the threshold is set at 0.1 of the most intense peak, then the peaks above the threshold account for 99.7% of total probability for water, 82% for substance P, only 60% for human insulin, and 23% for titin. For a threshold of 0.01, the numbers will be: still 99.7% for water, 96% for substance P, 88% for human insulin and 72% for titin (it also took 5 minutes on an average notebook computer to process the 17 billion configurations involved).

As you can see the threshold does not have a straightforward correlation to the accuracy of the final spectrum obtained - and accuracy of final spectrum is often what the user is interested in. The IsoSpeTotalcProbGeneratorWrapper provides a way to directly parametrise based on the desired accuracy of the final spectrum - and should be used instead in most cases. The trade-off is that it's (slightly) slower than Threshold algorithm. This speed gap will be dramatically improved with IsoSpec 2.0.

Note
  The eligible isotopologues are NOT guaranteed to be generated in any particular order.

## Constructor & Destructor Documentation

## ◆ IsoSpecThresholdWrapper() [1/2]

IsoSpecThresholdWrapper | ( | const std::vector< int > & | isotopeNumbers,
|  | const std::vector< int > & | atomCounts,
|  | const std::vector< std::vector< double > > & | isotopeMasses,
|  | const std::vector< std::vector< double > > & | isotopeProbabilities,
|  | double | threshold,
|  | bool | absolute
| ) |  |

Constructor.

Parameters

  isotopeNumbers | A vector of how many isotopes each element has, e.g. [2, 2, 3])
  atomCounts | How many atoms of each we have [e.g. 12, 6, 6 for Glucose]
  isotopeMasses | Array with the individual elements isotopic masses
  isotopeProbabilities | Array with the individual elements isotopic probabilities
  threshold | Intensity threshold: will only compute peaks above this threshold
  absolute | Whether the threshold is absolute or relative (relative to the most intense peak)

Note
  This constructor is only useful if you need to define non-standard abundances of isotopes, for other uses the one accepting EmpiricalFormula is easier to use.

## ◆ IsoSpecThresholdWrapper() [2/2]

IsoSpecThresholdWrapper | ( | const EmpiricalFormula & | formula,
|  | double | threshold,
|  | bool | absolute
| ) |  |

Setup the algorithm to run on an EmpiricalFormula.

## Member Function Documentation

## ◆ run()

virtual IsotopeDistribution run | ( |  | ) |

final override virtual

Run the algorithm.

This method will run the algorithm with parameters as set up by the constructor. It will return an IsotopeDistribution containing the observed configurations. The configurations are explicitly stored in memory, which may become a problem when considering some especially large distributions. If this, or (a rather small) performance overhead is a concern, then the generator methods (see IsoSpecGeneratorWrapper) should be used instead.

This method is provided for convenience. As calling that method invalidates the object (the method should not be called again, nor anything other than destroying the object should be done with it), the most common usage pattern of IsoSpecGeneratorWrapper classes with the run method is:

IsotopeDistribution dist = IsoSpecGeneratorWrapperSubclass(...).run();
// do something with dist;

Note
  Calling this method invalidates the object! In future versions this limitation might be removed.

Implements IsoSpecWrapper.

## Member Data Documentation

## ◆ ITG

IsoSpec::IsoThresholdGenerator ITG

protected