36 #ifndef OPENMS_CHEMISTRY_SVMTHEORETICALSPECTRUMGENERATOR_H 37 #define OPENMS_CHEMISTRY_SVMTHEORETICALSPECTRUMGENERATOR_H 39 #include <OpenMS/config.h> 48 #include <boost/random/mersenne_twister.hpp> 93 residue((
Residue::ResidueType) 0),
101 residue(local_residue),
109 residue(rhs.residue),
134 return charge < rhs.
charge;
223 return mp_.ion_types;
251 inline void scaleSingleFeature_(
double & value,
double feature_min,
double feature_max,
double lower = -1.0,
double upper = 1.0);
254 void scaleDescriptorSet_(
DescriptorSet & desc,
double lower,
double upper);
263 static void initializeMaps_();
268 void updateMembers_();
274 if (feature_max == feature_min)
279 if (value <= feature_min)
283 else if (value >= feature_max)
289 value = lower + (upper - lower) *
290 (value - feature_min) /
291 (feature_max - feature_min);
296 std::cerr <<
"negative value!! " << value <<
" l: " << lower <<
" u: " << upper <<
" fm: " << feature_min <<
" fma: " << feature_max <<
" prev: " << prev << std::endl;
302 #endif // #ifdef OPENMS_CHEMISTRY_SVMTHEORETICALSPECTRUMGENERATORTRAINER_H static std::map< String, double > hydrophobicity_
hydrophobicity values for each AA
Definition: SvmTheoreticalSpectrumGenerator.h:239
nested class
Definition: SvmTheoreticalSpectrumGenerator.h:83
static std::map< String, Size > aa_to_index_
map AA to integers
Definition: SvmTheoreticalSpectrumGenerator.h:236
std::vector< double > intensity_bin_values
Definition: SvmTheoreticalSpectrumGenerator.h:188
A more convenient string class.
Definition: String.h:57
std::map< IonType, std::vector< IonType > > secondary_types
Definition: SvmTheoreticalSpectrumGenerator.h:164
std::vector< double > feature_max
Definition: SvmTheoreticalSpectrumGenerator.h:173
std::vector< double > feature_min
Definition: SvmTheoreticalSpectrumGenerator.h:176
Size number_regions
Definition: SvmTheoreticalSpectrumGenerator.h:170
double scaling_upper
Definition: SvmTheoreticalSpectrumGenerator.h:182
static std::map< String, double > helicity_
helicity values for each AA
Definition: SvmTheoreticalSpectrumGenerator.h:242
static std::map< String, double > basicity_
basicity values for each AA
Definition: SvmTheoreticalSpectrumGenerator.h:245
IonType()
Definition: SvmTheoreticalSpectrumGenerator.h:92
std::map< Residue::ResidueType, double > static_intensities
Definition: SvmTheoreticalSpectrumGenerator.h:158
Residue::ResidueType residue
Definition: SvmTheoreticalSpectrumGenerator.h:85
Representation of a peptide/protein sequence.
Definition: AASequence.h:108
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
std::vector< svm_node > DescriptorSetType
Definition: SvmTheoreticalSpectrumGenerator.h:143
Representation of a residue.
Definition: Residue.h:62
Simulates MS2 spectra with support vector machines.
Definition: SvmTheoreticalSpectrumGenerator.h:72
EmpiricalFormula loss
Definition: SvmTheoreticalSpectrumGenerator.h:86
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
Simple container storing the model parameters required for simulation.
Definition: SvmTheoreticalSpectrumGenerator.h:149
Train SVM models that are used by SvmTheoreticalSpectrumGenerator.
Definition: SvmTheoreticalSpectrumGeneratorTrainer.h:66
A set of descriptors for a single training row.
Definition: SvmTheoreticalSpectrumGenerator.h:141
static bool initializedMaps_
flag to indicate if the hydrophobicity, helicity, and basicity maps were already initialized ...
Definition: SvmTheoreticalSpectrumGenerator.h:266
IonType(const IonType &rhs)
Definition: SvmTheoreticalSpectrumGenerator.h:108
std::map< IonType, double > IntensityMap
Definition: SvmTheoreticalSpectrumGenerator.h:227
std::vector< boost::shared_ptr< SVMWrapper > > reg_models
Definition: SvmTheoreticalSpectrumGenerator.h:155
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 ...
Definition: SvmTheoreticalSpectrumGenerator.h:271
const std::vector< IonType > & getIonTypes()
return the set of ion types that are modeled by the loaded SVMs
Definition: SvmTheoreticalSpectrumGenerator.h:221
ResidueType
Definition: Residue.h:144
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
std::vector< boost::shared_ptr< SVMWrapper > > class_models
Definition: SvmTheoreticalSpectrumGenerator.h:152
Size precursor_charge_
charge of the precursors used for training
Definition: SvmTheoreticalSpectrumGenerator.h:230
bool operator<(const IonType &rhs) const
Definition: SvmTheoreticalSpectrumGenerator.h:127
DescriptorSetType descriptors
Definition: SvmTheoreticalSpectrumGenerator.h:144
SvmModelParameterSet mp_
set of model parameters read from model file
Definition: SvmTheoreticalSpectrumGenerator.h:233
IonType(Residue::ResidueType local_residue, EmpiricalFormula local_loss=EmpiricalFormula(), Int local_charge=1)
Definition: SvmTheoreticalSpectrumGenerator.h:100
std::vector< double > intensity_bin_boarders
Definition: SvmTheoreticalSpectrumGenerator.h:185
std::map< IonType, bool > hide_type_
whether ion types are hidden or not
Definition: SvmTheoreticalSpectrumGenerator.h:248
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
Size number_intensity_levels
Definition: SvmTheoreticalSpectrumGenerator.h:167
Int charge
Definition: SvmTheoreticalSpectrumGenerator.h:87
IonType & operator=(const IonType &rhs)
Definition: SvmTheoreticalSpectrumGenerator.h:116
int Int
Signed integer type.
Definition: Types.h:103
std::vector< IonType > ion_types
Definition: SvmTheoreticalSpectrumGenerator.h:161
double scaling_lower
Definition: SvmTheoreticalSpectrumGenerator.h:179
std::map< std::pair< IonType, Size >, std::vector< std::vector< double > > > conditional_prob
Definition: SvmTheoreticalSpectrumGenerator.h:191