| OpenMS 2.5.0

Classes | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
SvmTheoreticalSpectrumGenerator Class Reference
Chemistry

Simulates MS2 spectra with support vector machines. More...

`#include <OpenMS/CHEMISTRY/SvmTheoreticalSpectrumGenerator.h>`

Inheritance diagram for SvmTheoreticalSpectrumGenerator:

## Classes

struct | DescriptorSet
| A set of descriptors for a single training row. More...
struct | IonType
| nested class More...
struct | SvmModelParameterSet
| Simple container storing the model parameters required for simulation. More...

## Public Member Functions

void | simulate (PeakSpectrum &spectrum, const AASequence &peptide, boost::random::mt19937_64 &rng, Size precursor_charge)
| Generate the MS/MS according to the given probabilistic model. More...
void | load ()
| Load a trained Svm and Prob. models. More...
const std::vector< IonType > & | getIonTypes ()
| return the set of ion types that are modeled by the loaded SVMs More...
Constructors and Destructors
| SvmTheoreticalSpectrumGenerator ()
| Default constructor. More...
| SvmTheoreticalSpectrumGenerator (const SvmTheoreticalSpectrumGenerator &source)
| Copy constructor. More...
SvmTheoreticalSpectrumGenerator & | operator= (const SvmTheoreticalSpectrumGenerator &tsg)
| Assignment operator. More...
| ~SvmTheoreticalSpectrumGenerator () 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 DefaultParamHandler & | operator= (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 Param & | getParameters () const
| Non-mutable access to the parameters. More...
const Param & | getDefaults () const
| Non-mutable access to the default parameters. More...
const String & | getName () 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 Types

typedef std::map< IonType, double > | IntensityMap

## Protected Member Functions

void | scaleSingleFeature_ (double &value, double feature_min, double feature_max, double lower=-1.0, double upper=1.0)
| scale value to the interval [lower,max] given the maximal and minimal entries for a feature More...
void | scaleDescriptorSet_ (DescriptorSet &desc, double lower, double upper)
| scale value to the interval [lower,max] given the maximal and minimal entries for a feature More...
Size | generateDescriptorSet_ (AASequence peptide, Size position, IonType type, Size precursor_charge, DescriptorSet &desc_set)
| generate the descriptors for an input peptide and a given fragmentation position More...
String | ResidueTypeToString_ (Residue::ResidueType type)
| Returns the ResidueType (e.g. AIon, BIon) as string for peak annotation. More...
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...

## Static Protected Member Functions

static void | initializeMaps_ ()
| initialized the maps More...

## Protected Attributes

Size | precursor_charge_
| charge of the precursors used for training More...
SvmModelParameterSet | mp_
| set of model parameters read from model file More...
std::map< IonType, bool > | hide_type_
| whether ion types are hidden or not 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< String > | subsections_
| 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...

## Static Protected Attributes

static std::map< String, Size > | aa_to_index_
| map AA to integers More...
static std::map< String, double > | hydrophobicity_
| hydrophobicity values for each AA More...
static std::map< String, double > | helicity_
| helicity values for each AA More...
static std::map< String, double > | basicity_
| basicity values for each AA More...
static bool | initializedMaps_
| flag to indicate if the hydrophobicity, helicity, and basicity maps were already initialized More...

## Friends

class | SvmTheoreticalSpectrumGeneratorTrainer

## Detailed Description

Simulates MS2 spectra with support vector machines.

The models are generated with the SvmTheoreticalSpectrumGeneratorTrainer.
Two modes are supported:

- Only a prediction of abundant/missing is performed and for abundant peaks are generated with user defined intensity.
- The intensity is predicted using SVM-regression (only for the primary ion types b and y). For the secondary types a Bayesian model is used.

Currently, only a test model is shipped with OpenMS.
Please find trained models at: http://sourceforge.net/projects/open-ms/files/Supplementary/Simulation/.

Parameters of this class are:

Name | Type | Default | Restrictions | Description
--- | --- | --- | --- | ---
svm_mode | int | 1 |  | whether to predict abundant/missing using SVC (0) or predict intensities using SVR (1)
model_file_name | string | examples/simulation/SvmMSim.model |  | Name of the probabilistic Model file
add_isotopes | string | false | true, false | If set to 1 isotope peaks of the product ion peaks are added
max_isotope | int | 2 |  | Defines the maximal isotopic peak which is added, add_isotopes must be set to 1
add_metainfo | string | false | true, false | Adds the type of peaks as metainfo to the peaks, like y8+, [M-H2O+2H]++
add_first_prefix_ion | string | false | true, false | If set to true e.g. b1 ions are added
hide_y_ions | string | false | true, false | Add peaks of y-ions to the spectrum
hide_y2_ions | string | false | true, false | Add peaks of y-ions to the spectrum
hide_b_ions | string | false | true, false | Add peaks of b-ions to the spectrum
hide_b2_ions | string | false | true, false | Add peaks of b-ions to the spectrum
hide_a_ions | string | false | true, false | Add peaks of a-ions to the spectrum
hide_c_ions | string | false | true, false | Add peaks of c-ions to the spectrum
hide_x_ions | string | false | true, false | Add peaks of x-ions to the spectrum
hide_z_ions | string | false | true, false | Add peaks of z-ions to the spectrum
hide_losses | string | false | true, false | Adds common losses to those ion expect to have them, only water and ammonia loss is considered
y_intensity | float | 1.0 |  | Intensity of the y-ions
b_intensity | float | 1.0 |  | Intensity of the b-ions
a_intensity | float | 1.0 |  | Intensity of the a-ions
c_intensity | float | 1.0 |  | Intensity of the c-ions
x_intensity | float | 1.0 |  | Intensity of the x-ions
z_intensity | float | 1.0 |  | Intensity of the z-ions
relative_loss_intensity | float | 0.1 |  | Intensity of loss ions, in relation to the intact ion intensity

Note:

- If a section name is documented, the documentation is displayed as tooltip.
- Advanced parameter names are italic.

## Class Documentation

## ◆ OpenMS::SvmTheoreticalSpectrumGenerator::DescriptorSet

struct OpenMS::SvmTheoreticalSpectrumGenerator::DescriptorSet

A set of descriptors for a single training row.

Class Members
typedef vector< svm_node > | DescriptorSetType |

Class Members
DescriptorSetType | descriptors |

## ◆ OpenMS::SvmTheoreticalSpectrumGenerator::SvmModelParameterSet

struct OpenMS::SvmTheoreticalSpectrumGenerator::SvmModelParameterSet

Simple container storing the model parameters required for simulation.

Class Members
vector< shared_ptr< SVMWrapper > > | class_models |
map< pair< IonType, Size >, vector< vector< double > > > | conditional_prob |
vector< double > | feature_max |
vector< double > | feature_min |
vector< double > | intensity_bin_boarders |
vector< double > | intensity_bin_values |
vector< IonType > | ion_types |
Size | number_intensity_levels |
Size | number_regions |
vector< shared_ptr< SVMWrapper > > | reg_models |
double | scaling_lower |
double | scaling_upper |
map< IonType, vector< IonType > > | secondary_types |
map< ResidueType, double > | static_intensities |

## Member Typedef Documentation

## ◆ IntensityMap

typedef std::map<IonType, double> IntensityMap

protected

## Constructor & Destructor Documentation

## ◆ SvmTheoreticalSpectrumGenerator() [1/2]

SvmTheoreticalSpectrumGenerator | ( |  | ) |

Default constructor.

## ◆ SvmTheoreticalSpectrumGenerator() [2/2]

SvmTheoreticalSpectrumGenerator | ( | const SvmTheoreticalSpectrumGenerator & | source | ) |

Copy constructor.

## ◆ ~SvmTheoreticalSpectrumGenerator()

~SvmTheoreticalSpectrumGenerator | ( |  | ) |

override

Destructor.

## Member Function Documentation

## ◆ generateDescriptorSet_()

Size generateDescriptorSet_ | ( | AASequence | peptide,
|  | Size | position,
|  | IonType | type,
|  | Size | precursor_charge,
|  | DescriptorSet & | desc_set
| ) |  |

protected

generate the descriptors for an input peptide and a given fragmentation position

## ◆ getIonTypes()

const std::vector<IonType>& getIonTypes | ( |  | ) |

inline

return the set of ion types that are modeled by the loaded SVMs

## ◆ initializeMaps_()

static void initializeMaps_ | ( |  | ) |

static protected

initialized the maps

## ◆ load()

void load | ( |  | ) |

Load a trained Svm and Prob. models.

## ◆ operator=()

SvmTheoreticalSpectrumGenerator& operator= | ( | const SvmTheoreticalSpectrumGenerator & | tsg | ) |

Assignment operator.

## ◆ ResidueTypeToString_()

String ResidueTypeToString_ | ( | Residue::ResidueType | type | ) |

protected

Returns the ResidueType (e.g. AIon, BIon) as string for peak annotation.

## ◆ scaleDescriptorSet_()

void scaleDescriptorSet_ | ( | DescriptorSet & | desc,
|  | double | lower,
|  | double | upper
| ) |  |

protected

scale value to the interval [lower,max] given the maximal and minimal entries for a feature

## ◆ scaleSingleFeature_()

void scaleSingleFeature_ | ( | double & | value,
|  | double | feature_min,
|  | double | feature_max,
|  | double | lower = `-1.0`,
|  | double | upper = `1.0`
| ) |  |

inline protected

scale value to the interval [lower,max] given the maximal and minimal entries for a feature

## ◆ simulate()

void simulate | ( | PeakSpectrum & | spectrum,
|  | const AASequence & | peptide,
|  | boost::random::mt19937_64 & | rng,
|  | Size | precursor_charge
| ) |  |

Generate the MS/MS according to the given probabilistic model.

## ◆ updateMembers_()

void updateMembers_ | ( |  | ) |

override protected virtual

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.

## Friends And Related Function Documentation

## ◆ SvmTheoreticalSpectrumGeneratorTrainer

friend class SvmTheoreticalSpectrumGeneratorTrainer

friend

## Member Data Documentation

## ◆ aa_to_index_

std::map<String, Size> aa_to_index_

static protected

map AA to integers

## ◆ basicity_

std::map<String, double> basicity_

static protected

basicity values for each AA

## ◆ helicity_

std::map<String, double> helicity_

static protected

helicity values for each AA

## ◆ hide_type_

std::map<IonType, bool> hide_type_

protected

whether ion types are hidden or not

## ◆ hydrophobicity_

std::map<String, double> hydrophobicity_

static protected

hydrophobicity values for each AA

## ◆ initializedMaps_

bool initializedMaps_

static protected

flag to indicate if the hydrophobicity, helicity, and basicity maps were already initialized

## ◆ mp_

SvmModelParameterSet mp_

protected

set of model parameters read from model file

## ◆ precursor_charge_

Size precursor_charge_

protected

charge of the precursors used for training