OpenMS
Loading...
Searching...
No Matches
Percolator.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8
9#pragma once
10
14
15#include <memory>
16#include <vector>
17
18namespace OpenMS
19{
75 class OPENMS_DLLAPI Percolator : public DefaultParamHandler
76 {
77 public:
79 ~Percolator() override;
80
81 Percolator(const Percolator&) = delete;
82 Percolator& operator=(const Percolator&) = delete;
83
99 void rescore(std::vector<PeptideIdentification>& peptide_ids,
100 const StringList& feature_names = {});
101
131
151 const std::vector<std::vector<double>>& getSvmWeights() const;
152
168 double getPi0() const;
169
189
234 RescoreOutput score(const RescoreInput& input, const PercolatorModel& model);
235
273 const std::vector<PeptideIdentification>& peptide_ids,
274 bool flatten_hits,
275 RescoreInput& input);
276
296 static void saveModel(const PercolatorModel& model, const std::string& filename);
297
311 static PercolatorModel loadModel(const std::string& filename);
312
313 protected:
314 void updateMembers_() override;
315
316 private:
317 struct Impl;
318 std::unique_ptr<Impl> impl_;
319 };
320}
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
In-process Percolator: semi-supervised target/decoy rescoring with q-values + PEPs.
Definition Percolator.h:76
static PercolatorModel loadModel(const std::string &filename)
Deserialize a PercolatorModel written by saveModel().
~Percolator() override
Percolator & operator=(const Percolator &)=delete
PercolatorModel train(const RescoreInput &input)
Train a Percolator model on feature rows. No scoring.
static void fillPINCompatibleFields(const std::vector< PeptideIdentification > &peptide_ids, bool flatten_hits, RescoreInput &input)
Fill PIN-compatible optional fields on a RescoreInput.
std::unique_ptr< Impl > impl_
Definition Percolator.h:318
double getPi0() const
Pi0 (null fraction) from the last rescore()/score() call.
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.
RescoreOutput rescore(const RescoreInput &input)
Rescore a feature matrix domain-agnostically.
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
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).
std::vector< std::string > StringList
Vector of String.
Definition ListUtils.h:44
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:93
Input to domain-agnostic Percolator::rescore.
Definition PercolatorTypes.h:27
Output from Percolator::rescore. Aligned 1:1 with RescoreInput::features.
Definition PercolatorTypes.h:70