Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ModelFitter< PeakType, FeatureType > Class Template Reference

Tests a group of data points in an LC-MS map for goodness-of-fit with a 2D averagine model. More...

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

Inheritance diagram for ModelFitter< PeakType, FeatureType >:
FeaFiModule< PeakType, FeatureType > FeatureFinderDefs DefaultParamHandler

Public Types

enum  { RT = Peak2D::RT, MZ = Peak2D::MZ }
 
typedef IndexSet::const_iterator IndexSetIter
 IndexSet iterator. More...
 
typedef Feature::QualityType QualityType
 Quality of a feature. More...
 
typedef Feature::CoordinateType CoordinateType
 Single coordinate. More...
 
typedef Feature::IntensityType IntensityType
 Single intensity. More...
 
typedef Feature::ChargeType ChargeType
 Isotope charge. More...
 
typedef FeaFiModule< PeakType,
FeatureType > 
Base
 FeaFiModule. More...
 
typedef std::vector< PeakTypeRawDataArrayType
 Raw data container type using for the temporary storage of the input data. More...
 
- Public Types inherited from FeaFiModule< PeakType, FeatureType >
typedef FeatureMap< FeatureType > FeatureMapType
 Output feature map type. More...
 
typedef MSExperiment< PeakTypeMapType
 Input map type. More...
 
typedef MapType::SpectrumType SpectrumType
 Input spectrum type. More...
 
typedef PeakType::IntensityType IntensityType
 Input intensity type. More...
 
typedef PeakType::CoordinateType CoordinateType
 Input coordinate type. More...
 
- Public Types inherited from FeatureFinderDefs
enum  Flag { UNUSED, USED }
 Flags that indicate if a peak is already used in a feature. More...
 
typedef IsotopeCluster::IndexPair IndexPair
 Index to peak consisting of two UInts (scan index / peak index) More...
 
typedef
IsotopeCluster::ChargedIndexSet 
ChargedIndexSet
 Index to peak consisting of two UInts (scan index / peak index) with charge information. More...
 
typedef IsotopeCluster::IndexSet IndexSet
 A set of peak indices. More...
 

Public Member Functions

 ModelFitter (const MSExperiment< PeakType > *map, FeatureMap< FeatureType > *features, FeatureFinder *ff)
 Constructor. More...
 
virtual ~ModelFitter ()
 Destructor. More...
 
void setMonoIsotopicMass (CoordinateType mz)
 Sets or fixed the monoisotopic m/z at a specific position. More...
 
Feature fit (const ChargedIndexSet &index_set)
 Return next feature. More...
 
- Public Member Functions inherited from FeaFiModule< PeakType, FeatureType >
 FeaFiModule (const MSExperiment< PeakType > *map, FeatureMap< FeatureType > *features, FeatureFinder *ff)
 Constructor. More...
 
virtual ~FeaFiModule ()
 destructor More...
 
IntensityType getPeakIntensity (const FeatureFinderDefs::IndexPair &index) const
 Returns the intensity of a peak. More...
 
CoordinateType getPeakMz (const FeatureFinderDefs::IndexPair &index) const
 Returns the m/z of a peak. More...
 
CoordinateType getPeakRt (const FeatureFinderDefs::IndexPair &index) const
 Returns the retention time of a peak. More...
 
void getNextMz (FeatureFinderDefs::IndexPair &index) const
 fills index with the index of next peak in m/z dimension More...
 
void getPrevMz (FeatureFinderDefs::IndexPair &index) const
 fills index with the index of previous peak in m/z dimension More...
 
void getNextRt (FeatureFinderDefs::IndexPair &index)
 fills index with the index of the nearest peak in the next scan More...
 
void getPrevRt (FeatureFinderDefs::IndexPair &index)
 fills index with the index of the nearest peak in the previous scan More...
 
void addConvexHull (const FeatureFinderDefs::IndexSet &set, Feature &feature) const
 Calculates the convex hull of a index set and adds it to the feature. More...
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
virtual DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 

Protected Member Functions

virtual void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
QualityType fitMZLoop_ (const ChargedIndexSet &set, const ChargeType &charge)
 main fit loop More...
 
QualityType evaluate_ (const IndexSet &set) const
 evaluate 2d-model More...
 
QualityType fitRT_ (InterpolationModel *&model) const
 1d fit in RT More...
 
QualityType fitMZ_ (InterpolationModel *&model, const ChargeType &charge) const
 1d fit in MZ More...
 
void doProjectionDim_ (const Int dim, const ChargedIndexSet &index_set, RawDataArrayType &set) const
 Project the raw data into 1-dim array. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

ProductModel< 2 > model2D_
 2D model More...
 
Math::BasicStatistics mz_stat_
 statistics for mz More...
 
Math::AsymmetricStatistics rt_stat_
 statistics for rt More...
 
RawDataArrayType mz_input_data_
 mz raw data More...
 
RawDataArrayType rt_input_data_
 rt raw data More...
 
CoordinateType tolerance_stdev_box_
 tolerance used for bounding box More...
 
CoordinateType monoisotopic_mz_
 monoistopic mass More...
 
CoordinateType interpolation_step_mz_
 interpolation step size (in m/z) More...
 
CoordinateType interpolation_step_rt_
 interpolation step size (in retention time) More...
 
Int max_isotope_
 maximum isotopic rank to be considered More...
 
CoordinateType iso_stdev_first_
 first stdev More...
 
CoordinateType iso_stdev_last_
 last stdev More...
 
CoordinateType iso_stdev_stepsize_
 step size More...
 
Int first_mz_model_
 first mz model (0=Gaussian, 1....n = charge ) More...
 
Int last_mz_model_
 last mz model More...
 
CoordinateType isotope_stdev_
 isotope stdev More...
 
String algorithm_
 algorithm More...
 
Int max_iteration_
 Maximum number of iterations. More...
 
CoordinateType deltaAbsError_
 Absolute error. More...
 
CoordinateType deltaRelError_
 Relative error. More...
 
Math::BasicStatistics basic_stat_
 statistics More...
 
QualityType quality_rt_
 fit quality in RT dimension More...
 
QualityType quality_mz_
 fit quality in MZ dimension More...
 
- Protected Attributes inherited from FeaFiModule< PeakType, FeatureType >
const MapTypemap_
 Input data pointer. More...
 
FeatureMapTypefeatures_
 Output data pointer. More...
 
FeatureFinderff_
 Pointer to the calling FeatureFinder that is used to access the feature flags and report progress. More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Private Member Functions

 ModelFitter ()
 Not implemented. More...
 
ModelFitteroperator= (const ModelFitter &)
 Not implemented. More...
 
 ModelFitter (const ModelFitter &)
 Not implemented. More...
 

Detailed Description

template<class PeakType, class FeatureType>
class OpenMS::ModelFitter< PeakType, FeatureType >

Tests a group of data points in an LC-MS map for goodness-of-fit with a 2D averagine model.

The ModelFitter class uses a gaussian or isotope model in m/z and bigauss, lmagauss (bigauss with Levenberg-Marquardt) or emg (exponentially modified Gaussian with lma optimized parameters) in retention time.

For the isotope model, we test different charge states and peaks widths.

Todo:
Fix problem with other peak types than Peak1D and enable the respective tests for FeatureFinderAlgorithmSimple, FeatureFinderAlgorithmSimplest, FeatureFinderAlgorithmWavelet (Clemens)
Parameters of this class are:

NameTypeDefaultRestrictionsDescription
fit_algorithm stringsimple simple, simplest, waveletFitting algorithm type (internal parameter).
max_iteration int500 min: 1Maximum number of iterations for fitting with Levenberg-Marquardt algorithm.
deltaAbsError float0.0001 min: 0Absolute error used by the Levenberg-Marquardt algorithm.
deltaRelError float0.0001 min: 0Relative error used by the Levenberg-Marquardt algorithm.
tolerance_stdev_bounding_box float3 min: 0Bounding box has range [minimim of data, maximum of data] enlarged by tolerance_stdev_bounding_box times the standard deviation of the data
intensity_cutoff_factor float0.0500000007450581 min: 0 max: 1Cutoff peaks with a predicted intensity below intensity_cutoff_factor times the maximal intensity of the model
feature_intensity_sum int1 min: 0 max: 1Determines what is reported as feature intensity.
1: the sum of peak intensities;
0: the maximum intensity of all peaks
min_num_peaks:final int5 min: 1Minimum number of peaks left after cutoff. If smaller, feature will be discarded.
min_num_peaks:extended int10 min: 1Minimum number of peaks after extension. If smaller, feature will be discarded.
rt:interpolation_step float0.200000002980232 min: 0Step size in seconds used to interpolate model for RT.
mz:interpolation_step float0.0299999993294477 min: 0.001Interpolation step size for m/z.
mz:model_type:first int1 min: 0Numeric id of first m/z model fitted (usually indicating the charge state), 0 = no isotope pattern (fit a single gaussian).
mz:model_type:last int4 min: 0Numeric id of last m/z model fitted (usually indicating the charge state), 0 = no isotope pattern (fit a single gaussian).
quality:type stringCorrelation Correlation, RankCorrelationType of the quality measure used to assess the fit of model vs data.
quality:minimum float0.649999976158142 min: 0 max: 1Minimum quality of fit, features below this threshold are discarded.
isotope_model:stdev:first float0.0399999991059303 min: 0First standard deviation to be considered for isotope model.
isotope_model:stdev:last float0.119999997317791 min: 0Last standard deviation to be considered for isotope model.
isotope_model:stdev:step float0.0399999991059303 min: 0Step size for standard deviations considered for isotope model.
isotope_model:averagines:C float0.0444398894906044 min: 0Number of C atoms per Dalton of the mass.
isotope_model:averagines:H float0.0698157176375389 min: 0Number of H atoms per Dalton of the mass.
isotope_model:averagines:N float0.0122177302837372 min: 0Number of N atoms per Dalton of the mass.
isotope_model:averagines:O float0.0132939899340272 min: 0Number of O atoms per Dalton of the mass.
isotope_model:averagines:S float0.000375250005163252 min: 0Number of S atoms per Dalton of the mass.
isotope_model:isotope:trim_right_cutoff float0.00100000004749745 min: 0Cutoff for averagine distribution, trailing isotopes below this relative intensity are not considered.
isotope_model:isotope:maximum int100 min: 1Maximum number of isotopes being used for the IsotopeModel.
isotope_model:isotope:distance float1.00049495697021 min: 0Distance between consecutive isotopic peaks.

Note:

Member Typedef Documentation

typedef FeaFiModule<PeakType, FeatureType> Base

Isotope charge.

typedef Feature::CoordinateType CoordinateType

Single coordinate.

typedef IndexSet::const_iterator IndexSetIter

IndexSet iterator.

Single intensity.

Quality of a feature.

typedef std::vector<PeakType> RawDataArrayType

Raw data container type using for the temporary storage of the input data.

Member Enumeration Documentation

anonymous enum
Enumerator
RT 
MZ 

Constructor & Destructor Documentation

ModelFitter ( const MSExperiment< PeakType > *  map,
FeatureMap< FeatureType > *  features,
FeatureFinder ff 
)
inline
virtual ~ModelFitter ( )
inlinevirtual

Destructor.

ModelFitter ( )
private

Not implemented.

ModelFitter ( const ModelFitter< PeakType, FeatureType > &  )
private

Not implemented.

Member Function Documentation

void doProjectionDim_ ( const Int  dim,
const ChargedIndexSet index_set,
RawDataArrayType set 
) const
inlineprotected
QualityType evaluate_ ( const IndexSet set) const
inlineprotected
Feature fit ( const ChargedIndexSet index_set)
inline

Return next feature.

Exceptions
Exception::UnableToFitis thrown if fitting cannot be performed
Exception::InvalidParameterif first and last charge to test do not define a range (first<=last)

References FeaFiModule< PeakType, FeatureType >::addConvexHull(), IsotopeCluster::ChargedIndexSet::charge, ModelDescription< D >::createModel(), ModelFitter< PeakType, FeatureType >::doProjectionDim_(), Feature::encloses(), FeaFiModule< PeakType, FeatureType >::ff_, ModelFitter< PeakType, FeatureType >::first_mz_model_, ModelFitter< PeakType, FeatureType >::fitMZLoop_(), ModelFitter< PeakType, FeatureType >::fitRT_(), ConvexHull2D::getBoundingBox(), BaseFeature::getCharge(), Feature::getConvexHull(), ProductModel< 2 >::getIntensity(), ProductModel< 2 >::getModel(), Feature::getModelDescription(), Peak2D::getMZ(), DefaultParamHandler::getName(), Feature::getOverallQuality(), FeatureFinder::getPeakFlag(), FeaFiModule< PeakType, FeatureType >::getPeakIntensity(), FeaFiModule< PeakType, FeatureType >::getPeakMz(), FeaFiModule< PeakType, FeatureType >::getPeakRt(), Feature::getQuality(), Peak2D::getRT(), Feature::getSubordinates(), Param::getValue(), BaseModel< D >::isContained(), ModelFitter< PeakType, FeatureType >::last_mz_model_, ModelFitter< PeakType, FeatureType >::model2D_, ModelFitter< PeakType, FeatureType >::MZ, ModelFitter< PeakType, FeatureType >::mz_input_data_, ModelFitter< PeakType, FeatureType >::mz_stat_, DefaultParamHandler::param_, ModelFitter< PeakType, FeatureType >::quality_mz_, ModelFitter< PeakType, FeatureType >::quality_rt_, ModelFitter< PeakType, FeatureType >::RT, ModelFitter< PeakType, FeatureType >::rt_input_data_, ModelFitter< PeakType, FeatureType >::rt_stat_, BaseFeature::setCharge(), BaseModel< D >::setCutOff(), Peak2D::setIntensity(), MetaInfoInterface::setMetaValue(), ProductModel< 2 >::setModel(), Feature::setModelDescription(), Peak2D::setMZ(), Feature::setOverallQuality(), Feature::setQuality(), Peak2D::setRT(), ProductModel< 2 >::setScale(), FeatureFinderDefs::UNUSED, AsymmetricStatistics< Real >::update(), and BasicStatistics< RealT >::update().

Referenced by FeatureFinderAlgorithmSimplest< PeakType, FeatureType >::run(), and FeatureFinderAlgorithmSimple< PeakType, FeatureType >::run().

QualityType fitMZ_ ( InterpolationModel *&  model,
const ChargeType charge 
) const
inlineprotected
QualityType fitMZLoop_ ( const ChargedIndexSet set,
const ChargeType charge 
)
inlineprotected
QualityType fitRT_ ( InterpolationModel *&  model) const
inlineprotected
ModelFitter& operator= ( const ModelFitter< PeakType, FeatureType > &  )
private

Not implemented.

void setMonoIsotopicMass ( CoordinateType  mz)
inline

Sets or fixed the monoisotopic m/z at a specific position.

Parameters
mzThe monoisotopic m/z that occurres in the current data set.

References ModelFitter< PeakType, FeatureType >::monoisotopic_mz_.

virtual void updateMembers_ ( )
inlineprotectedvirtual

Member Data Documentation

String algorithm_
protected
Math::BasicStatistics basic_stat_
protected

statistics

CoordinateType deltaAbsError_
protected

Absolute error.

Test for the convergence of the sequence by comparing the last iteration step dx with the absolute error epsabs and relative error epsrel to the current position x

Referenced by ModelFitter< PeakType, FeatureType >::fitMZ_(), ModelFitter< PeakType, FeatureType >::fitRT_(), and ModelFitter< PeakType, FeatureType >::updateMembers_().

CoordinateType deltaRelError_
protected
Int first_mz_model_
protected

first mz model (0=Gaussian, 1....n = charge )

Referenced by ModelFitter< PeakType, FeatureType >::fit(), and ModelFitter< PeakType, FeatureType >::updateMembers_().

CoordinateType interpolation_step_mz_
protected
CoordinateType interpolation_step_rt_
protected

interpolation step size (in retention time)

Referenced by ModelFitter< PeakType, FeatureType >::fitRT_(), and ModelFitter< PeakType, FeatureType >::updateMembers_().

CoordinateType iso_stdev_first_
protected
CoordinateType iso_stdev_last_
protected
CoordinateType iso_stdev_stepsize_
protected
CoordinateType isotope_stdev_
protected
Int last_mz_model_
protected
Int max_isotope_
protected
Int max_iteration_
protected
ProductModel<2> model2D_
protected
CoordinateType monoisotopic_mz_
protected
RawDataArrayType mz_input_data_
protected
Math::BasicStatistics mz_stat_
protected
QualityType quality_mz_
protected
QualityType quality_rt_
protected

fit quality in RT dimension

Referenced by ModelFitter< PeakType, FeatureType >::fit().

RawDataArrayType rt_input_data_
protected
Math::AsymmetricStatistics rt_stat_
protected
CoordinateType tolerance_stdev_box_
protected

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:34 using doxygen 1.8.5