OpenMS
Loading...
Searching...
No Matches
PeptDeepRescoring.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Team -- 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
11#include <OpenMS/config.h>
16
17#include <map>
18#include <string>
19#include <vector>
20
21namespace OpenMS
22{
23 class PeptideIdentificationList;
24 class ProteinIdentification;
25 class PeptDeepMS2Inference;
26 class PeptDeepRTInference;
27
72 class OPENMS_DLLAPI PeptDeepRescoring :
74 public ProgressLogger
75 {
76 public:
79
82
85
115 void annotate(const PeakMap& spectra,
116 std::vector<ProteinIdentification>& protein_ids,
117 PeptideIdentificationList& peptide_ids);
118
121 double getUsedNCE() const;
122
125 double getRTCalibrationError() const;
126
129
134
135 protected:
136 void updateMembers_() override;
137
148
152 void annotateRun_(const std::string& run_id,
153 const std::map<std::string, double>& collision_energies,
154 PeptideIdentificationList& peptide_ids,
155 const std::vector<Row>& rows,
156 const std::vector<Size>& run_rows,
157 const std::vector<std::string>& uniq_seq,
158 const std::vector<float>& uniq_charge,
159 bool higher_score_better,
160 PeptDeepMS2Inference& ms2_inference,
161 PeptDeepRTInference& rt_inference);
162
163 std::string ms2_model_;
164 std::string rt_model_;
165 double nce_{-1.0};
166 double nce_grid_halfwidth_{6.0};
167 double nce_grid_step_{2.0};
168 double nce_fallback_{30.0};
169 Size nce_sample_size_{2000};
170 std::string instrument_;
171 double calibration_quantile_{0.5};
172 std::string rt_model_type_{"b_spline"};
173 Size rt_num_nodes_{5};
174 int ms2_min_ordinal_{1};
175 double ms2_strong_fraction_{0.05};
176 Size batch_size_{500};
177 Int threads_{4};
178
179 double used_nce_{-1.0};
180 double rt_calibration_error_{-1.0};
181 Size num_psms_{0};
182 Size num_predicted_psms_{0};
183 };
184
185} // namespace OpenMS
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
Inference engine for PeptDeep MS2 Fragment Intensity prediction.
Definition PeptDeepMS2Inference.h:23
Predicts peptide retention times with the PeptDeep RT model (peptdeep_rt_dynamic.onnx)
Definition PeptDeepRTInference.h:26
Annotates PSMs with rescoring features derived from PeptDeep predictions.
Definition PeptDeepRescoring.h:75
bool calibration_candidate
best hit of its spectrum and not a decoy
Definition PeptDeepRescoring.h:146
void annotate(const PeakMap &spectra, std::vector< ProteinIdentification > &protein_ids, PeptideIdentificationList &peptide_ids)
Annotates peptide_ids in place and registers the features for rescoring.
Size getNumPredictedPSMs() const
double getRTCalibrationError() const
Size key
index into the de-duplicated (sequence, charge) list
Definition PeptDeepRescoring.h:144
void annotateRun_(const std::string &run_id, const std::map< std::string, double > &collision_energies, PeptideIdentificationList &peptide_ids, const std::vector< Row > &rows, const std::vector< Size > &run_rows, const std::vector< std::string > &uniq_seq, const std::vector< float > &uniq_charge, bool higher_score_better, PeptDeepMS2Inference &ms2_inference, PeptDeepRTInference &rt_inference)
Size pi
index into the PeptideIdentificationList
Definition PeptDeepRescoring.h:141
double score
search score, used to pick the calibration set
Definition PeptDeepRescoring.h:145
~PeptDeepRescoring() override
Destructor.
PeptDeepRescoring()
Constructor. Sets the default parameters; the model paths start empty and must be set.
double getUsedNCE() const
std::string ms2_model_
Definition PeptDeepRescoring.h:163
Size len
peptide length
Definition PeptDeepRescoring.h:143
static StringList featureNames()
Names of the features this class adds to each PSM, in a stable order.
Size getNumPSMs() const
Number of PSMs (peptide hits) seen by the last annotate() call.
std::string instrument_
Definition PeptDeepRescoring.h:170
std::string rt_model_
Definition PeptDeepRescoring.h:164
Size hit
index into that identification's hits
Definition PeptDeepRescoring.h:142
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
Row of the flat PSM work list built by annotate().
Definition PeptDeepRescoring.h:140
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:27
int Int
Signed integer type.
Definition Types.h:72
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