Train SVM models that are used by SvmTheoreticalSpectrumGenerator. More...
#include <OpenMS/CHEMISTRY/SvmTheoreticalSpectrumGeneratorTrainer.h>
Public Member Functions | |
SvmTheoreticalSpectrumGeneratorTrainer & | operator= (const SvmTheoreticalSpectrumGeneratorTrainer &tsg) |
Assignment operator. More... | |
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 More... | |
void | normalizeIntensity (PeakSpectrum &S) const |
Normalizes the intensity of the peaks in the input data. More... | |
Constructors and Destructors | |
SvmTheoreticalSpectrumGeneratorTrainer () | |
Default constructor. More... | |
SvmTheoreticalSpectrumGeneratorTrainer (const SvmTheoreticalSpectrumGeneratorTrainer &source) | |
Copy constructor. More... | |
virtual | ~SvmTheoreticalSpectrumGeneratorTrainer () |
Destructor. More... | |
![]() | |
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 ¶m) |
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 Member Functions | |
void | writeTrainingFile_ (std::vector< DescriptorSet > &training_input, std::vector< double > &training_output, String filename) |
Write a training file that can be passed to libsvm command line tools. More... | |
![]() | |
virtual void | updateMembers_ () |
This method is used to update extra member variables at the end of the setParameters() method. More... | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
Private Types | |
typedef SvmTheoreticalSpectrumGenerator::IonType | IonType |
typedef SvmTheoreticalSpectrumGenerator::DescriptorSet | DescriptorSet |
typedef std::map< std::pair< IonType, Size >, std::vector< double > > | ObservedIntensMap |
Private Member Functions | |
void | countIntensities_ (const PeakSpectrum &spectrum, const AASequence &annotation, IonType type, std::map< std::pair< IonType, Size >, std::vector< double > > &observed_intensities, double tolerance, Size number_of_regions) |
stores the observed intensities for each sector-type combination in a vector More... | |
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 More... | |
Additional Inherited Members | |
![]() | |
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... | |
Train SVM models that are used by SvmTheoreticalSpectrumGenerator.
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 chosen 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.
|
private |
|
private |
|
private |
Default constructor.
SvmTheoreticalSpectrumGeneratorTrainer | ( | const SvmTheoreticalSpectrumGeneratorTrainer & | source | ) |
Copy constructor.
|
virtual |
Destructor.
|
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.
SvmTheoreticalSpectrumGeneratorTrainer& operator= | ( | 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
|
private |
trains the Bayesian secondary peak types models
|
protected |
Write a training file that can be passed to libsvm command line tools.
OpenMS / TOPP release 2.0.0 | Documentation generated on Tue Nov 1 2016 16:34:46 using doxygen 1.8.11 |