Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions

SvmTheoreticalSpectrumGeneratorTrainer Class Reference
[Chemistry]

Train SVM models that are used by SvmTheoreticalSpectrumGenerator. More...

#include <OpenMS/CHEMISTRY/SvmTheoreticalSpectrumGeneratorTrainer.h>

Inheritance diagram for SvmTheoreticalSpectrumGeneratorTrainer:
DefaultParamHandler

List of all members.

Public Member Functions

SvmTheoreticalSpectrumGeneratorTraineroperator= (const SvmTheoreticalSpectrumGeneratorTrainer &tsg)
 Assignment operator.
void trainModel (const PeakMap &spectra, const std::vector< AASequence > &annotations, String filename, Int precursor_charge)
 trains an SVM for each ion_type and stores them in files <filename>_residue_loss_charge.svm
void normalizeIntensity (PeakSpectrum &S) const
 Normalizes the intensity of the peaks in the input data.
Constructors and Destructors

 SvmTheoreticalSpectrumGeneratorTrainer ()
 Default constructor.
 SvmTheoreticalSpectrumGeneratorTrainer (const SvmTheoreticalSpectrumGeneratorTrainer &source)
 Copy constructor.
virtual ~SvmTheoreticalSpectrumGeneratorTrainer ()
 Destructor.

Protected Member Functions

void writeTrainingFile_ (std::vector< DescriptorSet > &training_input, std::vector< DoubleReal > &training_output, String filename)
 Write a training file that can be passed to libsvm command line tools.

Private Types

typedef
SvmTheoreticalSpectrumGenerator::IonType 
IonType
typedef
SvmTheoreticalSpectrumGenerator::DescriptorSet 
DescriptorSet
typedef std::map< std::pair
< IonType, Size >, std::vector
< DoubleReal > > 
ObservedIntensMap

Private Member Functions

void countIntensities_ (const PeakSpectrum &spectrum, const AASequence &annotation, IonType type, std::map< std::pair< IonType, Size >, std::vector< DoubleReal > > &observed_intensities, DoubleReal tolerance, Size number_of_regions)
 stores the observed intensities for each sector-type combination in a vector
void trainSecondaryTypes_ (TextFile &info_outfile, Size number_of_regions, Size number_of_intensity_levels, ObservedIntensMap &observed_intensities, const std::vector< IonType > &ion_types, const std::vector< bool > &is_primary)
 trains the Bayesian secondary peak types models

Detailed Description

Train SVM models that are used by SvmTheoreticalSpectrumGenerator.

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
write_training_files stringfalse true, falseIf set to true no models are trained but files (__training.dat) are produced for the selected primary ion types. They can be used as input for LibSVM command line tools
number_intensity_levels int7  The number of intensity bins (for secondary type models)
number_regions int3  The number of regions each spectrum is split to (for secondary type models)
parent_tolerance float2.5  The maximum difference between theoretical and experimental parent mass to accept training spectrum
peak_tolerance float0.5  The maximum mass error for a peak to the expected mass of some ion type
add_b_ions stringtrue true, falseTrain simulator for b-ions
add_y_ions stringtrue true, falseTrain simulator for y-ions
add_a_ions stringfalse true, falseTrain simulator for a-ions
add_c_ions stringfalse true, falseTrain simulator for c-ions
add_x_ions stringfalse true, falseTrain simulator for x-ions
add_z_ions stringfalse true, falseTrain simulator for z-ions
add_losses stringfalse true, falseTrain simulator for neutral losses of H2O and NH3 for b-ions and y-ions
add_b2_ions stringfalse true, falseTrain simulator for doubly charged b-ions
add_y2_ions stringfalse true, falseTrain simulator for double charged y-ions
svm:svc_type int0 min: 0 max: 1Type of the SVC: 0=C_SVC 1=NU_SVC
svm:svr_type int1 min: 0 max: 1Type of the SVR: 0=EPSILON_SVR 1=NU_SVR
svm:scaling stringtrue true, falseApply scaling of feature values
svm:scaling_lower float0  Lower bound for scaling
svm:scaling_upper float1  Upper bound for scaling
svm:n_fold int5 min: 1n_fold cross validation is performed
svm:grid stringfalse true, falsePerform grid search
svm:additive_cv stringfalse true, falseAdditive step size (if false multiplicative)
svm:svc:kernel_type int2 min: 0 max: 3Type of the kernel: 0=LINEAR 1=POLY 2=RBF 3=SIGMOID
svm:svc:degree int3 min: 1For POLY
svm:svc:gamma float0 min: 0For POLY/RBF/SIGMOID
svm:svc:C float1  Cost of constraint violation
svm:svc:nu float0.5  For NU_SVC, ONE_CLASS and NU_SVR
svm:svc:balancing stringtrue true, falseUse class balanced SVC training
svm:svc:degree_start int1 min: 1starting point of degree
svm:svc:degree_step_size int2  step size point of degree
svm:svc:degree_stop int4  stopping point of degree
svm:svc:gamma_start float1e-05 min: 0 max: 1starting point of gamma
svm:svc:gamma_step_size int100  step size point of gamma
svm:svc:gamma_stop float0.1  stopping point of gamma
svm:svc:c_start float0.1  starting point of c
svm:svc:c_step_size int100  step size of c
svm:svc:c_stop int1000  stopping point of c
svm:svc:nu_start float0.3 min: 0 max: 1starting point of nu
svm:svc:nu_step_size int2  step size of nu
svm:svc:nu_stop float0.6 min: 0 max: 1stopping point of nu
svm:svr:kernel_type int2 min: 0 max: 3Type of the kernel: 0=LINEAR 1=POLY 2=RBF 3=SIGMOID
svm:svr:degree int3 min: 1For POLY
svm:svr:gamma float0 min: 0For POLY/RBF/SIGMOID
svm:svr:C float1  Cost of constraint violation
svm:svr:p float0.1  The epsilon for the loss function in epsilon-SVR
svm:svr:nu float0.5  For NU_SVC, ONE_CLASS and NU_SVR
svm:svr:degree_start int1 min: 1starting point of degree
svm:svr:degree_step_size int2  step size point of degree
svm:svr:degree_stop int4  stopping point of degree
svm:svr:gamma_start float1e-05 min: 0 max: 1starting point of gamma
svm:svr:gamma_step_size int100  step size point of gamma
svm:svr:gamma_stop float0.1  stopping point of gamma
svm:svr:p_start float1e-05  starting point of p
svm:svr:p_step_size int100  step size point of p
svm:svr:p_stop float0.1  stopping point of p
svm:svr:c_start float0.1  starting point of c
svm:svr:c_step_size int100  step size of c
svm:svr:c_stop int1000  stopping point of c
svm:svr:nu_start float0.3 min: 0 max: 1starting point of nu
svm:svr:nu_step_size int2  step size of nu
svm:svr:nu_stop float0.6 min: 0 max: 1stopping point of nu

Note:

This class implements the algorithm used by the homonymous tool which can be used to train models for MS/MS spectrum simulation.
For the primary ion types (y, b) a SVM is trained using the libSVM library.
All important libSVM parameters are accessible as parameters.
Please refer to the libSVM manuals for detailed description of the parameters. Default values are choses as in the svm-training tool delivered with libSVM.

For the secondary types (a, c, x, z, losses, b2, y2) a simple Bayesian model is used.


Member Typedef Documentation

typedef std::map<std::pair<IonType, Size>, std::vector<DoubleReal> > ObservedIntensMap [private]

Constructor & Destructor Documentation

Default constructor.

virtual ~SvmTheoreticalSpectrumGeneratorTrainer (  )  [virtual]

Destructor.


Member Function Documentation

void countIntensities_ ( const PeakSpectrum spectrum,
const AASequence annotation,
IonType  type,
std::map< std::pair< IonType, Size >, std::vector< DoubleReal > > &  observed_intensities,
DoubleReal  tolerance,
Size  number_of_regions 
) [private]

stores the observed intensities for each sector-type combination in a vector

void normalizeIntensity ( PeakSpectrum S  )  const

Normalizes the intensity of the peaks in the input data.

Assignment operator.

void trainModel ( const PeakMap spectra,
const std::vector< AASequence > &  annotations,
String  filename,
Int  precursor_charge 
)

trains an SVM for each ion_type and stores them in files <filename>_residue_loss_charge.svm

void trainSecondaryTypes_ ( TextFile info_outfile,
Size  number_of_regions,
Size  number_of_intensity_levels,
ObservedIntensMap observed_intensities,
const std::vector< IonType > &  ion_types,
const std::vector< bool > &  is_primary 
) [private]

trains the Bayesian secondary peak types models

void writeTrainingFile_ ( std::vector< DescriptorSet > &  training_input,
std::vector< DoubleReal > &  training_output,
String  filename 
) [protected]

Write a training file that can be passed to libsvm command line tools.


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:50 using doxygen 1.7.1