83 void encodeCompositionVectors(
const std::vector<String> & sequences,
const String & allowed_characters, std::vector<std::vector<std::pair<Int, double> > > & composition_vectors);
88 void encodeLibSVMVectors(
const std::vector<std::vector<std::pair<Int, double> > > & feature_vectors, std::vector<svm_node *> & libsvm_vectors);
92 std::vector<double> & labels);
96 std::vector<double> & labels,
97 const String & allowed_characters);
105 std::vector<double> & labels,
106 const String & allowed_characters,
107 UInt maximum_sequence_length);
115 std::vector<double> & labels,
116 const String & allowed_characters);
127 const String & allowed_characters,
129 std::vector<std::pair<Int, double> > & libsvm_vector,
131 bool unpaired =
false,
132 bool length_encoding =
false);
136 std::vector<double> & labels,
138 const String & allowed_characters,
141 bool unpaired =
false,
142 bool length_encoding =
false);
147 const String & allowed_characters,
149 std::vector<std::vector<std::pair<Int, double> > > & vectors);
175 const String & allowed_characters,
176 std::vector<std::pair<Int, double> > & values,
177 bool is_right_border =
false);
188 const String & allowed_characters =
"ACDEFGHIKLMNPQRSTVWY",
189 UInt maximum_sequence_length = 50)
191 std::vector<double> predicted_retention_times;
194 std::vector<double> temp_rts;
195 temp_rts.resize(sequences.size(), 0);
196 svm_problem * prediction_data =
200 maximum_sequence_length);
201 svm.
predict(prediction_data, predicted_retention_times);
203 return predicted_retention_times;
209 std::pair<Int, double> b);
Representation of a peptide/protein sequence.
Definition: AASequence.h:112
Serves for encoding sequences into feature vectors.
Definition: LibSVMEncoder.h:56
svm_problem * loadLibSVMProblem(const String &filename)
loads the LibSVM-encoded data stored in 'filename'
void encodeOligoBorders(String sequence, UInt k_mer_length, const String &allowed_characters, UInt border_length, std::vector< std::pair< Int, double > > &libsvm_vector, bool strict=false, bool unpaired=false, bool length_encoding=false)
encodes the borders of the sequence as k_mer oligos and stores them in 'libsvm_vector'
~LibSVMEncoder()
Destructor.
void encodeCompositionVectors(const std::vector< String > &sequences, const String &allowed_characters, std::vector< std::vector< std::pair< Int, double > > > &composition_vectors)
stores composition vectors of the sequences given by 'sequence' in 'composition_vectors'
svm_problem * encodeLibSVMProblemWithCompositionVectors(const std::vector< String > &sequences, std::vector< double > &labels, const String &allowed_characters)
creates composition vectors for 'sequences' and stores them in LibSVM compliant format
svm_node * encodeLibSVMVector(const std::vector< std::pair< Int, double > > &feature_vector)
encodes the feature vector in LibSVM compliant format
svm_problem * encodeLibSVMProblemWithCompositionLengthAndWeightVectors(const std::vector< String > &sequences, std::vector< double > &labels, const String &allowed_characters)
creates composition vectors with additional length and average weight information for 'sequences' and...
svm_problem * encodeLibSVMProblemWithCompositionAndLengthVectors(const std::vector< String > &sequences, std::vector< double > &labels, const String &allowed_characters, UInt maximum_sequence_length)
creates composition vectors with additional length information for 'sequences' and stores them in Lib...
LibSVMEncoder()
Constructor.
static void destroyProblem(svm_problem *problem)
frees all the memory of the svm_problem instance
void libSVMVectorsToString(svm_problem *vector, String &output)
stores a string representation of the encoded sequences in 'vectors' in 'output'
svm_problem * encodeLibSVMProblemWithOligoBorderVectors(const std::vector< String > &sequences, std::vector< double > &labels, UInt k_mer_length, const String &allowed_characters, UInt border_length, bool strict=false, bool unpaired=false, bool length_encoding=false)
creates oligo border vectors vectors for 'sequences' and stores them in LibSVM compliant format
void encodeCompositionVector(const String &sequence, std::vector< std::pair< Int, double > > &encoded_vector, const String &allowed_characters="ACDEFGHIKLMNPQRSTVWY")
stores a composition vector of 'sequence' in 'encoded_vector'
static std::vector< double > predictPeptideRT(const std::vector< String > &sequences, SVMWrapper &svm, const String &allowed_characters="ACDEFGHIKLMNPQRSTVWY", UInt maximum_sequence_length=50)
Definition: LibSVMEncoder.h:186
bool storeLibSVMProblem(const String &filename, const svm_problem *problem) const
stores the LibSVM-encoded data in a text file that can be used by the LibSVM applications (svm-scale,...
void encodeOligo(const AASequence &sequence, UInt k_mer_length, const String &allowed_characters, std::vector< std::pair< Int, double > > &values, bool is_right_border=false)
encodes an AASequence instance in oligo encoding
svm_problem * encodeLibSVMProblem(const std::vector< svm_node * > &vectors, std::vector< double > &labels)
encodes the LibSVM compliant vectors into a LibSVM compliant structure
static bool cmpOligos_(std::pair< Int, double > a, std::pair< Int, double > b)
comparator for oligos encoded by encodeOligo
void encodeLibSVMVectors(const std::vector< std::vector< std::pair< Int, double > > > &feature_vectors, std::vector< svm_node * > &libsvm_vectors)
encodes the feature vectors in LibSVM compliant format
void libSVMVectorToString(svm_node *vector, String &output)
stores a string representation of the encoded sequence 'vector' in 'output'
void encodeProblemWithOligoBorderVectors(const std::vector< AASequence > &sequences, UInt k_mer_length, const String &allowed_characters, UInt border_length, std::vector< std::vector< std::pair< Int, double > > > &vectors)
creates oligo border vectors vectors for 'sequences' and stores them in 'vectors'
Serves as a wrapper for the libsvm.
Definition: SVMWrapper.h:82
void predict(struct svm_problem *problem, std::vector< double > &predicted_labels)
predicts the labels using the trained model
A more convenient string class.
Definition: String.h:61
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47