38 #include <OpenMS/config.h>
47 #include <boost/random/mersenne_twister.hpp>
92 residue((
Residue::ResidueType) 0),
100 residue(local_residue),
108 residue(rhs.residue),
133 return charge < rhs.
charge;
222 return mp_.ion_types;
250 inline void scaleSingleFeature_(
double & value,
double feature_min,
double feature_max,
double lower = -1.0,
double upper = 1.0);
273 if (feature_max == feature_min)
278 if (value <= feature_min)
282 else if (value >= feature_max)
288 value = lower + (upper - lower) *
289 (value - feature_min) /
290 (feature_max - feature_min);
295 std::cerr <<
"negative value!! " << value <<
" l: " << lower <<
" u: " << upper <<
" fm: " << feature_min <<
" fma: " << feature_max <<
" prev: " << prev << std::endl;
Representation of a peptide/protein sequence.
Definition: AASequence.h:112
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:93
The representation of a 1D spectrum.
Definition: MSSpectrum.h:71
Representation of a residue.
Definition: Residue.h:63
ResidueType
Definition: Residue.h:152
A more convenient string class.
Definition: String.h:61
Train SVM models that are used by SvmTheoreticalSpectrumGenerator.
Definition: SvmTheoreticalSpectrumGeneratorTrainer.h:67
Simulates MS2 spectra with support vector machines.
Definition: SvmTheoreticalSpectrumGenerator.h:73
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:270
double scaling_upper
Definition: SvmTheoreticalSpectrumGenerator.h:181
String ResidueTypeToString_(Residue::ResidueType type)
Returns the ResidueType (e.g. AIon, BIon) as string for peak annotation.
static std::map< String, double > basicity_
basicity values for each AA
Definition: SvmTheoreticalSpectrumGenerator.h:244
std::vector< svm_node > DescriptorSetType
Definition: SvmTheoreticalSpectrumGenerator.h:142
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.
std::vector< double > intensity_bin_values
Definition: SvmTheoreticalSpectrumGenerator.h:187
std::map< Residue::ResidueType, double > static_intensities
Definition: SvmTheoreticalSpectrumGenerator.h:157
SvmModelParameterSet mp_
set of model parameters read from model file
Definition: SvmTheoreticalSpectrumGenerator.h:232
Size number_regions
Definition: SvmTheoreticalSpectrumGenerator.h:169
std::vector< double > feature_max
Definition: SvmTheoreticalSpectrumGenerator.h:172
std::vector< boost::shared_ptr< SVMWrapper > > reg_models
Definition: SvmTheoreticalSpectrumGenerator.h:154
double scaling_lower
Definition: SvmTheoreticalSpectrumGenerator.h:178
DescriptorSetType descriptors
Definition: SvmTheoreticalSpectrumGenerator.h:143
std::map< std::pair< IonType, Size >, std::vector< std::vector< double > > > conditional_prob
Definition: SvmTheoreticalSpectrumGenerator.h:190
static std::map< String, Size > aa_to_index_
map AA to integers
Definition: SvmTheoreticalSpectrumGenerator.h:235
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
std::map< IonType, std::vector< IonType > > secondary_types
Definition: SvmTheoreticalSpectrumGenerator.h:163
void load()
Load a trained Svm and Prob. models.
const std::vector< IonType > & getIonTypes()
return the set of ion types that are modeled by the loaded SVMs
Definition: SvmTheoreticalSpectrumGenerator.h:220
void scaleDescriptorSet_(DescriptorSet &desc, double lower, double upper)
scale value to the interval [lower,max] given the maximal and minimal entries for a feature
std::vector< double > feature_min
Definition: SvmTheoreticalSpectrumGenerator.h:175
SvmTheoreticalSpectrumGenerator(const SvmTheoreticalSpectrumGenerator &source)
Copy constructor.
std::vector< double > intensity_bin_boarders
Definition: SvmTheoreticalSpectrumGenerator.h:184
static std::map< String, double > hydrophobicity_
hydrophobicity values for each AA
Definition: SvmTheoreticalSpectrumGenerator.h:238
static bool initializedMaps_
flag to indicate if the hydrophobicity, helicity, and basicity maps were already initialized
Definition: SvmTheoreticalSpectrumGenerator.h:265
static void initializeMaps_()
initialized the maps
Size precursor_charge_
charge of the precursors used for training
Definition: SvmTheoreticalSpectrumGenerator.h:229
Size number_intensity_levels
Definition: SvmTheoreticalSpectrumGenerator.h:166
SvmTheoreticalSpectrumGenerator & operator=(const SvmTheoreticalSpectrumGenerator &tsg)
Assignment operator.
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
std::map< IonType, double > IntensityMap
Definition: SvmTheoreticalSpectrumGenerator.h:226
static std::map< String, double > helicity_
helicity values for each AA
Definition: SvmTheoreticalSpectrumGenerator.h:241
std::vector< boost::shared_ptr< SVMWrapper > > class_models
Definition: SvmTheoreticalSpectrumGenerator.h:151
~SvmTheoreticalSpectrumGenerator() override
Destructor.
std::map< IonType, bool > hide_type_
whether ion types are hidden or not
Definition: SvmTheoreticalSpectrumGenerator.h:247
SvmTheoreticalSpectrumGenerator()
Default constructor.
std::vector< IonType > ion_types
Definition: SvmTheoreticalSpectrumGenerator.h:160
A set of descriptors for a single training row.
Definition: SvmTheoreticalSpectrumGenerator.h:141
Simple container storing the model parameters required for simulation.
Definition: SvmTheoreticalSpectrumGenerator.h:149
int Int
Signed integer type.
Definition: Types.h:102
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Size< TNeedle >::Type position(const PatternAuxData< TNeedle > &dh)
Definition: AhoCorasickAmbiguous.h:563
nested class
Definition: SvmTheoreticalSpectrumGenerator.h:83
Int charge
Definition: SvmTheoreticalSpectrumGenerator.h:86
IonType()
Definition: SvmTheoreticalSpectrumGenerator.h:91
bool operator<(const IonType &rhs) const
Definition: SvmTheoreticalSpectrumGenerator.h:126
IonType & operator=(const IonType &rhs)
Definition: SvmTheoreticalSpectrumGenerator.h:115
IonType(const IonType &rhs)
Definition: SvmTheoreticalSpectrumGenerator.h:107
EmpiricalFormula loss
Definition: SvmTheoreticalSpectrumGenerator.h:85
IonType(Residue::ResidueType local_residue, EmpiricalFormula local_loss=EmpiricalFormula(), Int local_charge=1)
Definition: SvmTheoreticalSpectrumGenerator.h:99
Residue::ResidueType residue
Definition: SvmTheoreticalSpectrumGenerator.h:84