106 void rescore(std::vector<PeptideIdentification>& peptide_ids,
186 const std::string& enzyme,
189 const std::string& score_type =
"q-value",
190 bool best_hit_only =
false);
223 const std::string& enzyme,
228 bool calc_mass_feature =
false);
248 const std::string& enzyme,
251 const std::string& score_type,
253 bool best_hit_only =
false);
267 const std::string& enzyme,
289 const std::string& enzyme,
292 const std::string& score_type =
"q-value");
352 size_t validation_rows = 0;
529 const std::vector<PeptideIdentification>& peptide_ids,
584 const std::vector<std::pair<size_t, size_t>>& hit_locs);
586 struct ReferenceScale_;
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
In-process Percolator: semi-supervised target/decoy rescoring with q-values + PEPs.
Definition Percolator.h:80
bool usedDefaultDirection() const
Whether the last rescore()/train() call replaced the learned model by the default direction.
static PercolatorModel loadModel(const std::string &filename)
Deserialize a PercolatorModel written by saveModel().
RescoreOutput score_(const RescoreInput &input, const PercolatorModel &model, ReferenceScale_ *scale)
void storeWeights(const std::string &filename) const
Writes the models of the last rescore()/train() call as the percolator executable writes them with it...
std::vector< std::vector< long > > curve_counts
per size and fold: validation targets (-1: fold had stopped)
Definition Percolator.h:354
RescoreOutput score(const RescoreInput &input, const PercolatorModel &model, const RescoreInput &reference)
Score feature rows with a pre-trained model on the scale of a reference set (e.g. its training set).
Size rescorePSMs(PeptideIdentificationList &peptide_ids, const StringList &feature_set, const std::string &enzyme, int min_charge, int max_charge, const std::string &score_type="q-value", bool best_hit_only=false)
Rescore search engine PSMs in place on the standard Percolator (.pin) feature set.
std::vector< std::vector< size_t > > trained_rows
per fold: the input rows of its model's training set, ascending
Definition Percolator.h:348
std::vector< int > scorer
Definition Percolator.h:349
Percolator & operator=(const Percolator &)=delete
std::function< RescoreOutput(const RescoreInput &, const PSMRowLocations &)> PSMScorer
Scores the feature rows that rescorePSMs() built, in place of rescore(): one score,...
Definition Percolator.h:231
PercolatorModel train(const RescoreInput &input)
Train a Percolator model on feature rows. No scoring.
Size scorePSMs(PeptideIdentificationList &peptide_ids, const PercolatorModel &model, PeptideIdentificationList &reference_ids, const StringList &feature_set, const std::string &enzyme, int min_charge, int max_charge, const std::string &score_type="q-value")
Rescore PSMs with a model trained on other PSMs (trainPSMs()), on the scale of those (reference_ids,...
static void fillPINCompatibleFields(const std::vector< PeptideIdentification > &peptide_ids, bool flatten_hits, RescoreInput &input)
Fill PIN-compatible optional fields on a RescoreInput.
Size rescorePSMsWithScorer(PeptideIdentificationList &peptide_ids, const StringList &feature_set, const std::string &enzyme, int min_charge, int max_charge, const std::string &score_type, const PSMScorer &scorer, bool best_hit_only=false)
As rescorePSMs(), but the feature rows are scored by scorer instead of rescore(input).
const CappedTrainingInfo & getCappedTrainingInfo() const
The folds, sample and training sets of the last rescore() if it trained out-of-fold on a capped sampl...
std::unique_ptr< Impl > impl_
Definition Percolator.h:592
double getPi0() const
Pi0 (null fraction) from the last rescore()/score() call.
static void buildPSMRescoreInput(const PeptideIdentificationList &peptide_ids, const StringList &feature_set, const std::string &enzyme, int min_charge, int max_charge, RescoreInput &input, PSMRowLocations &rows, bool calc_mass_feature=false)
The feature matrix of PSM rescoring: what rescorePSMs() trains and scores on, without rescoring.
std::vector< std::pair< size_t, size_t > > PSMRowLocations
Definition Percolator.h:194
std::vector< std::vector< long > > curve_discordant
Definition Percolator.h:355
RescoreOutput score(const RescoreInput &input, const PercolatorModel &model)
Score feature rows using a pre-trained model. No training.
const std::vector< std::vector< double > > & getSvmWeights() const
SVM weights trained in the last rescore()/train() call.
std::vector< int > fold
per input row: its cross-validation fold, whose model scored it
Definition Percolator.h:345
std::vector< char > sampled
Definition Percolator.h:346
PercolatorModel trainPSMs(PeptideIdentificationList &peptide_ids, const StringList &feature_set, const std::string &enzyme, int min_charge, int max_charge)
Train a model on search engine PSMs (the .pin features of rescorePSMs()), for scorePSMs() on other PS...
std::vector< size_t > curve_sizes
training-sample rows of each trained size, in order
Definition Percolator.h:353
std::vector< size_t > chosen_size
per fold: the sample rows of its kept model
Definition Percolator.h:357
RescoreOutput rescore(const RescoreInput &input)
Rescore a feature matrix domain-agnostically.
std::shared_ptr< const PercolatorReset::Output > getResetOutput() const
Result of the last rescorePSMs() call with parameter 'algorithm' = 'reset' (null otherwise).
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
RescoreOutput rescoreReset_(const PeptideIdentificationList &peptide_ids, RescoreInput &ri, const std::vector< std::pair< size_t, size_t > > &hit_locs)
static void saveModel(const PercolatorModel &model, const std::string &filename)
Serialize a PercolatorModel to a plain-text file.
Percolator(const Percolator &)=delete
void rescore(std::vector< PeptideIdentification > &peptide_ids, const StringList &feature_names={})
Rescore PSMs in place. Domain-specific convenience wrapper over rescore(RescoreInput).
The out-of-fold capped training of the last rescore() (subset_mode 'out_of_fold', 'out_of_fold_avg' o...
Definition Percolator.h:344
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
std::vector< std::string > StringList
Vector of String.
Definition TypeAliases.h:39
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Trained Percolator model: averaged SVM weights in raw feature space.
Definition PercolatorTypes.h:137
Output from Percolator::rescore. Aligned 1:1 with the rows of the RescoreInput (RescoreInput::rowCoun...
Definition PercolatorTypes.h:109