OpenMS  2.8.0
Classes | List of all members
OptimizePeakDeconvolution Class Reference

This class provides the deconvolution of peak regions using non-linear optimization. More...

#include <OpenMS/TRANSFORMATIONS/RAW2PEAK/OptimizePeakDeconvolution.h>

Inheritance diagram for OptimizePeakDeconvolution:
[legend]
Collaboration diagram for OptimizePeakDeconvolution:
[legend]

Classes

struct  Data
 Class containing the data needed for optimization. More...
 

Public Types

Type definitions
typedef std::vector< Peak1DRawDataVector
 
typedef RawDataVector::iterator PeakIterator
 

Public Member Functions

Constructors and Destructor
 OptimizePeakDeconvolution ()
 Constructor. More...
 
 OptimizePeakDeconvolution (const OptimizePeakDeconvolution &opt)
 Copy-Constructor. More...
 
 ~OptimizePeakDeconvolution () override
 Destructor. 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...
 

Assignment

OptimizationFunctions::PenaltyFactorsIntensity penalties_
 
Int charge_
 Charge state of the current isotope pattern. More...
 
static const double dist_
 distance between two isotopic peaks More...
 
OptimizePeakDeconvolutionoperator= (const OptimizePeakDeconvolution &opt)
 
const OptimizationFunctions::PenaltyFactorsIntensitygetPenalties () const
 Non-mutable access to the penalty parameter. More...
 
void setPenalties (const OptimizationFunctions::PenaltyFactorsIntensity &penalties)
 Mutable access to the penalty parameter. More...
 
Int getCharge () const
 Non-mutable access to the charge. More...
 
void setCharge (const Int charge)
 Mutable access to the charge. More...
 
bool optimize (std::vector< PeakShape > &peaks, Data &data)
 Performs a nonlinear optimization of the peaks that belong to the current isotope pattern. More...
 
Size getNumberOfPeaks_ (Int charge, std::vector< PeakShape > &temp_shapes, Data &data)
 
void setNumberOfPeaks_ (Data &data, const std::vector< PeakShape > &temp_shapes, Int charge)
 A function to determine the number of peaks that lie in the current m/z interval given the distance between the peaks by the current charge state. More...
 
void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
 Writes all parameters to meta values. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. 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...
 

Detailed Description

This class provides the deconvolution of peak regions using non-linear optimization.

Given a vector of peak shapes, this class optimizes all peak shapes parameters using a non-linear optimization. For the non-linear optimization we use the Levenberg-Marquardt algorithm. There are a few constraints for the parameters: the positions are equidistant according to the peptide mass rule, e.g. two consecutive isotopic peaks are 1.003/charge away from each other. Besides the peaks have all the same left and right width, respectively.

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
max_iteration int10  maximal number of iterations for the fitting step
eps_abs float1.0e-04  if the absolute error gets smaller than this value the fitting is stopped
eps_rel float1.0e-04  if the relative error gets smaller than this value the fitting is stopped
fwhm_threshold float1.0  If a peaks is broader than fwhm_threshold, it is assumed that it contains another peaks and an additional peak is added.
penalties:left_width float0.0  penalty term for the fitting of the left width:If the left width gets too broad or negative during the fitting it can be penalized.
penalties:right_width float0.0  penalty term for the fitting of the right width:If the right width gets too broad or negative during the fitting it can be penalized.
penalties:height float0.0  penalty term for the fitting of the intensity:If it gets negative during the fitting it can be penalized.
penalties:position float0.0  penalty term for the fitting of the peak position:If the position changes more than 0.5Da during the fitting it can be penalized as well as discrepancies of the peptide mass rule.

Note:

Class Documentation

◆ OpenMS::OptimizePeakDeconvolution::Data

struct OpenMS::OptimizePeakDeconvolution::Data

Class containing the data needed for optimization.

Collaboration diagram for OptimizePeakDeconvolution::Data:
[legend]
Class Members
Int charge
vector< PeakShape > peaks
PenaltyFactorsIntensity penalties
vector< double > positions
vector< double > signal

Member Typedef Documentation

◆ PeakIterator

typedef RawDataVector::iterator PeakIterator

◆ RawDataVector

typedef std::vector<Peak1D> RawDataVector

Constructor & Destructor Documentation

◆ OptimizePeakDeconvolution() [1/2]

Constructor.

◆ OptimizePeakDeconvolution() [2/2]

Copy-Constructor.

◆ ~OptimizePeakDeconvolution()

~OptimizePeakDeconvolution ( )
inlineoverride

Destructor.

Member Function Documentation

◆ getCharge()

Int getCharge ( ) const
inline

Non-mutable access to the charge.

◆ getNumberOfPeaks_()

Size getNumberOfPeaks_ ( Int  charge,
std::vector< PeakShape > &  temp_shapes,
Data data 
)

◆ getPenalties()

const OptimizationFunctions::PenaltyFactorsIntensity& getPenalties ( ) const
inline

Non-mutable access to the penalty parameter.

Accessors

◆ operator=()

OptimizePeakDeconvolution& operator= ( const OptimizePeakDeconvolution opt)
inline

◆ optimize()

bool optimize ( std::vector< PeakShape > &  peaks,
Data data 
)

Performs a nonlinear optimization of the peaks that belong to the current isotope pattern.

◆ setCharge()

void setCharge ( const Int  charge)
inline

Mutable access to the charge.

◆ setNumberOfPeaks_()

void setNumberOfPeaks_ ( Data data,
const std::vector< PeakShape > &  temp_shapes,
Int  charge 
)
protected

A function to determine the number of peaks that lie in the current m/z interval given the distance between the peaks by the current charge state.

◆ setPenalties()

void setPenalties ( const OptimizationFunctions::PenaltyFactorsIntensity penalties)
inline

Mutable access to the penalty parameter.

◆ updateMembers_()

void updateMembers_ ( )
overrideprotectedvirtual

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ charge_

Int charge_
protected

Charge state of the current isotope pattern.

Referenced by OptimizePeakDeconvolution::operator=().

◆ dist_

const double dist_
staticprotected

distance between two isotopic peaks

◆ penalties_