OpenMS
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
IsotopeModel Class Reference

#include <OpenMS/FEATUREFINDER/IsotopeModel.h>

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

Public Types

enum  Averagines {
  C = 0 , H , N , O ,
  S , AVERAGINE_NUM
}
 
typedef InterpolationModel::CoordinateType CoordinateType
 
typedef InterpolationModel::CoordinateType IntensityType
 
- Public Types inherited from InterpolationModel
typedef double IntensityType
 
typedef DPosition< 1 > PositionType
 
typedef double CoordinateType
 
using KeyType = double
 
typedef Math::LinearInterpolation< KeyTypeLinearInterpolation
 
- Public Types inherited from BaseModel
typedef double IntensityType
 
typedef double CoordinateType
 
typedef DPosition< 1 > PositionType
 
typedef DPeak< 1 >::Type PeakType
 
typedef std::vector< PeakTypeSamplesType
 

Public Member Functions

 IsotopeModel ()
 Default constructor. More...
 
 IsotopeModel (const IsotopeModel &source)
 copy constructor More...
 
 ~IsotopeModel () override
 destructor More...
 
virtual IsotopeModeloperator= (const IsotopeModel &source)
 assignment operator More...
 
UInt getCharge () const
 
void setOffset (CoordinateType offset) override
 set the offset of the model More...
 
CoordinateType getOffset ()
 
EmpiricalFormula getFormula ()
 return the Averagine peptide formula (mass calculated from mean mass and charge – use .setParameters() to set them) More...
 
virtual void setSamples (const EmpiricalFormula &formula)
 set sample/supporting points of interpolation More...
 
CoordinateType getCenter () const override
 get the center of the Isotope model More...
 
const IsotopeDistributiongetIsotopeDistribution () const
 the Isotope distribution (without widening) from the last setSamples() call More...
 
virtual void setSamples ()
 set sample/supporting points of interpolation (from base class) More...
 
- Public Member Functions inherited from InterpolationModel
 InterpolationModel ()
 Default constructor. More...
 
 InterpolationModel (const InterpolationModel &source)
 copy constructor More...
 
 ~InterpolationModel () override=default
 destructor More...
 
InterpolationModeloperator= (const InterpolationModel &source)
 assignment operator More...
 
IntensityType getIntensity (const PositionType &pos) const override
 access model predicted intensity at position pos More...
 
IntensityType getIntensity (CoordinateType coord) const
 access model predicted intensity at position pos More...
 
const LinearInterpolationgetInterpolation () const
 Returns the interpolation class. More...
 
CoordinateType getScalingFactor () const
 get the scaling for the model More...
 
void getSamples (SamplesType &cont) const override
 get reasonable set of samples from the model (i.e. for printing) More...
 
void setInterpolationStep (CoordinateType interpolation_step)
 Set the interpolation step for the linear interpolation of the model. More...
 
void setScalingFactor (CoordinateType scaling)
 
- Public Member Functions inherited from BaseModel
 BaseModel ()
 Default constructor. More...
 
 BaseModel (const BaseModel &source)
 copy constructor More...
 
 ~BaseModel () override
 Destructor. More...
 
BaseModeloperator= (const BaseModel &source)
 assignment operator More...
 
virtual bool isContained (const PositionType &pos) const
 check if position pos is part of the model regarding the models cut-off. More...
 
template<typename PeakType >
void fillIntensity (PeakType &peak) const
 Convenience function to set the intensity of a peak to the predicted intensity at its current position, calling virtual void getIntensity(). More...
 
template<class PeakIterator >
void fillIntensities (PeakIterator begin, PeakIterator end) const
 Convenience function that applies fillIntensity() to an iterator range. More...
 
virtual IntensityType getCutOff () const
 get cutoff value More...
 
virtual void setCutOff (IntensityType cut_off)
 set cutoff value More...
 
virtual void getSamples (std::ostream &os)
 fill stream with reasonable set of samples from the model (i.e. for printing) 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...
 
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

void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

CoordinateType isotope_stdev_
 
CoordinateType isotope_lorentz_fwhm_
 
UInt charge_
 
CoordinateType mean_
 
CoordinateType monoisotopic_mz_
 
double averagine_ [AVERAGINE_NUM]
 
Int max_isotope_
 
double trim_right_cutoff_
 
double isotope_distance_
 
IsotopeDistribution isotope_distribution_
 
- Protected Attributes inherited from InterpolationModel
LinearInterpolation interpolation_
 
CoordinateType interpolation_step_
 
CoordinateType scaling_
 
- Protected Attributes inherited from BaseModel
IntensityType cut_off_
 
- 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...
 

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...
 

Detailed Description

@brief Isotope distribution approximated using linear interpolation.

This models a smoothed (widened) distribution, i.e. can be used to sample actual raw peaks (depending on the points you query). If you only want the distribution (no widening), use either EmpiricalFormula::getIsotopeDistribution() // for a certain sum formula or IsotopeDistribution::estimateFromPeptideWeight (double average_weight) // for averagine

Peak widening is achieved by either a Gaussian or Lorentzian shape.

@htmlinclude OpenMS_IsotopeModel.parameters

Member Typedef Documentation

◆ CoordinateType

◆ IntensityType

Member Enumeration Documentation

◆ Averagines

enum Averagines
Enumerator
AVERAGINE_NUM 

Constructor & Destructor Documentation

◆ IsotopeModel() [1/2]

Default constructor.

◆ IsotopeModel() [2/2]

IsotopeModel ( const IsotopeModel source)

copy constructor

◆ ~IsotopeModel()

~IsotopeModel ( )
override

destructor

Member Function Documentation

◆ getCenter()

CoordinateType getCenter ( ) const
overridevirtual

get the center of the Isotope model

This is a m/z-value not necessarily the monoisotopic mass.

Reimplemented from InterpolationModel.

◆ getCharge()

UInt getCharge ( ) const

◆ getFormula()

EmpiricalFormula getFormula ( )

return the Averagine peptide formula (mass calculated from mean mass and charge – use .setParameters() to set them)

◆ getIsotopeDistribution()

const IsotopeDistribution& getIsotopeDistribution ( ) const

the Isotope distribution (without widening) from the last setSamples() call

Useful to determine the number of isotopes that the model contains and their position

◆ getOffset()

CoordinateType getOffset ( )

◆ operator=()

virtual IsotopeModel& operator= ( const IsotopeModel source)
virtual

assignment operator

◆ setOffset()

void setOffset ( CoordinateType  offset)
overridevirtual

set the offset of the model

The whole model will be shifted to the new offset without being computing all over. This leaves a discrepancy which is minor in small shifts (i.e. shifting by one or two standard deviations) but can get significant otherwise. In that case use setParameters() which enforces a recomputation of the model.

Reimplemented from InterpolationModel.

◆ setSamples() [1/2]

virtual void setSamples
inlinevirtual

set sample/supporting points of interpolation (from base class)

Reimplemented from InterpolationModel.

◆ setSamples() [2/2]

virtual void setSamples ( const EmpiricalFormula formula)
virtual

set sample/supporting points of interpolation

◆ 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 InterpolationModel.

Member Data Documentation

◆ averagine_

double averagine_[AVERAGINE_NUM]
protected

◆ charge_

UInt charge_
protected

◆ isotope_distance_

double isotope_distance_
protected

◆ isotope_distribution_

IsotopeDistribution isotope_distribution_
protected

◆ isotope_lorentz_fwhm_

CoordinateType isotope_lorentz_fwhm_
protected

◆ isotope_stdev_

CoordinateType isotope_stdev_
protected

◆ max_isotope_

Int max_isotope_
protected

◆ mean_

CoordinateType mean_
protected

◆ monoisotopic_mz_

CoordinateType monoisotopic_mz_
protected

◆ trim_right_cutoff_

double trim_right_cutoff_
protected