OpenMS
|
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 IsoSpecThresholdGeneratorWrapper &)=delete | |
IsoSpecThresholdGeneratorWrapper (const EmpiricalFormula &formula, double threshold, bool absolute) | |
Setup the algorithm to run on an EmpiricalFormula. More... | |
~IsoSpecThresholdGeneratorWrapper () | |
bool | nextConf () final |
Move the generator to a next isotopologue. More... | |
Peak1D | getConf () final |
Obtain the current isotopologue. More... | |
double | getMass () final |
Obtain the mass of the current isotopologue. More... | |
double | getIntensity () final |
Obtain the intensity (probability, relative peak height) of the current configuration. More... | |
double | getLogIntensity () 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 ()=default |
Destructor. More... | |
Protected Attributes | |
std::unique_ptr< 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 IsoSpecTotalProbGeneratorWrapper provides a way to directly parameterize 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, though much less than it used to be) slower than Threshold algorithm.
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) |
|
delete |
IsoSpecThresholdGeneratorWrapper | ( | const EmpiricalFormula & | formula, |
double | threshold, | ||
bool | absolute | ||
) |
Setup the algorithm to run on an EmpiricalFormula.
|
finalvirtual |
Obtain the current isotopologue.
Implements IsoSpecGeneratorWrapper.
|
finalvirtual |
Obtain the intensity (probability, relative peak height) of the current configuration.
Implements IsoSpecGeneratorWrapper.
|
finalvirtual |
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.
|
finalvirtual |
Obtain the mass of the current isotopologue.
Implements IsoSpecGeneratorWrapper.
|
finalvirtual |
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 |