OpenMS
IsoSpecGeneratorWrapper Class Referenceabstract

Interface for the IsoSpec algorithm - a generator of infinitely-resolved theoretical spectra. More...

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

Inheritance diagram for IsoSpecGeneratorWrapper:
[legend]

Public Member Functions

virtual bool nextConf ()=0
 Move the generator to a next isotopologue. More...
 
virtual Peak1D getConf ()=0
 Obtain the current isotopologue. More...
 
virtual double getMass ()=0
 Obtain the mass of the current isotopologue. More...
 
virtual double getIntensity ()=0
 Obtain the intensity (probability, relative peak height) of the current configuration. More...
 
virtual double getLogIntensity ()=0
 Obtain the natural logarithm of the intensity (probability, relative peak height) of the current configuration. More...
 
virtual ~IsoSpecGeneratorWrapper ()=default
 Destructor. More...
 

Detailed Description

Interface for the IsoSpec algorithm - a generator of infinitely-resolved theoretical spectra.

Provides an interface to the IsoSpec algorithm. See IsoSpecWrapper and FineIsotopePatternGenerator for a more convenient wrapper. Implements a generator pattern using the nextConf function, which can be used to iterate through all configurations:

IsoSpecGeneratorWrapperSubclass iso(...);
while(iso.nextConf())
{
Peak1D conf = iso.getConf(); // and/or getMass, getIntensity, etc.
// do some computations on that conf;
}

The computation is based on the IsoSpec algorithm

Łącki MK, Startek M, Valkenborg D, Gambin A.
IsoSpec: Hyperfast Fine Structure Calculator.
Anal Chem. 2017 Mar 21;89(6):3272-3277. doi: 10.1021/acs.analchem.6b01459.

Constructor & Destructor Documentation

◆ ~IsoSpecGeneratorWrapper()

virtual ~IsoSpecGeneratorWrapper ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getConf()

virtual Peak1D getConf ( )
pure virtual

Obtain the current isotopologue.

Returns
The current isotopologue as a Peak1D
Note
It is invalid (undefined results) to call this method before the first call to nextConf(), or after it returns false

Implemented in IsoSpecOrderedGeneratorWrapper, IsoSpecThresholdGeneratorWrapper, and IsoSpecTotalProbGeneratorWrapper.

◆ getIntensity()

virtual double getIntensity ( )
pure virtual

Obtain the intensity (probability, relative peak height) of the current configuration.

Returns
The intensity (probability) of the current isotopologue
Note
It is invalid (undefined results) to call this method before the first call to nextConf(), or after it returns false

Implemented in IsoSpecOrderedGeneratorWrapper, IsoSpecThresholdGeneratorWrapper, and IsoSpecTotalProbGeneratorWrapper.

◆ getLogIntensity()

virtual double getLogIntensity ( )
pure virtual

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.

Returns
The natural logarithm of intensity (probability) of the current isotopologue
Note
It is invalid (undefined results) to call this method before the first call to nextConf(), or after it returns false

Implemented in IsoSpecOrderedGeneratorWrapper, IsoSpecThresholdGeneratorWrapper, and IsoSpecTotalProbGeneratorWrapper.

◆ getMass()

virtual double getMass ( )
pure virtual

Obtain the mass of the current isotopologue.

Returns
The mass of the current isotopologue
Note
It is invalid (undefined results) to call this method before the first call to nextConf(), or after it returns false

Implemented in IsoSpecOrderedGeneratorWrapper, IsoSpecThresholdGeneratorWrapper, and IsoSpecTotalProbGeneratorWrapper.

◆ nextConf()

virtual bool nextConf ( )
pure virtual

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.

Returns
A boolean value stating whether the generator has been exhausted.

Implemented in IsoSpecOrderedGeneratorWrapper, IsoSpecThresholdGeneratorWrapper, and IsoSpecTotalProbGeneratorWrapper.