OpenMS
2.5.0
|
Provides a threshold-based generator of isotopologues: generates all isotopologues more probable than a given probability threshold. More...
#include <OpenMS/CHEMISTRY/ISOTOPEDISTRIBUTION/IsoSpecWrapper.h>
Public Member Functions | |
IsoSpecThresholdGeneratorWrapper (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... | |
IsoSpecThresholdGeneratorWrapper (const EmpiricalFormula &formula, double threshold, bool absolute) | |
Setup the algorithm to run on an EmpiricalFormula. More... | |
virtual bool | nextConf () override final |
Move the generator to a next isotopologue. More... | |
virtual Peak1D | getConf () override final |
Obtain the current isotopologue. More... | |
virtual double | getMass () override final |
Obtain the mass of the current isotopologue. More... | |
virtual double | getIntensity () override final |
Obtain the intensity (probability, relative peak height) of the current configuration. More... | |
virtual double | getLogIntensity () override final |
Obtain the natural logarithm of the intensity (probability, relative peak height) of the current configuration. More... | |
Public Member Functions inherited from IsoSpecGeneratorWrapper | |
virtual | ~IsoSpecGeneratorWrapper () |
Destructor. More... | |
Protected Attributes | |
IsoSpec::IsoThresholdGenerator | ITG |
Provides a threshold-based generator of isotopologues: generates all isotopologues more probable than a given probability threshold.
This is the simplest generator - most users will however want to use IsoSpecTotalProbGeneratorWrapper. 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.
IsoSpecThresholdGeneratorWrapper | ( | 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.
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) |
IsoSpecThresholdGeneratorWrapper | ( | const EmpiricalFormula & | formula, |
double | threshold, | ||
bool | absolute | ||
) |
Setup the algorithm to run on an EmpiricalFormula.
|
inlinefinaloverridevirtual |
Obtain the current isotopologue.
Implements IsoSpecGeneratorWrapper.
|
inlinefinaloverridevirtual |
Obtain the intensity (probability, relative peak height) of the current configuration.
Implements IsoSpecGeneratorWrapper.
|
inlinefinaloverridevirtual |
Obtain the natural logarithm of the intensity (probability, relative peak height) of the current configuration.
This will be more precise (and faster) than just calling std::log(getIntensity()) - it will produce correct results even for configurations so unlikely that the double-precision floating point number returned from getIntensity() underflows to zero.
Implements IsoSpecGeneratorWrapper.
|
inlinefinaloverridevirtual |
Obtain the mass of the current isotopologue.
Implements IsoSpecGeneratorWrapper.
|
inlinefinaloverridevirtual |
Move the generator to a next isotopologue.
Advance the internal generator to the next isotopologue. The value returned determines whether the generator has been exhausted (that is, all eligible configurations have already been visited). It is invalid to call any other generator methods before the first call to nextConf(), as well as after this method returns false.
Implements IsoSpecGeneratorWrapper.
|
protected |