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
89 static constexpr const char* NCE_META_VALUE = "peptdeep_nce";
90
129 void annotate(const PeakMap& spectra,
130 std::vector<ProteinIdentification>& protein_ids,
131 PeptideIdentificationList& peptide_ids);
132
135 double getUsedNCE() const;
136
139 double getRTCalibrationError() const;
140
143
148
149 protected:
150 void updateMembers_() override;
151
162
166 void annotateRun_(const std::string& run_id,
167 const std::map<std::string, double>& collision_energies,
168 PeptideIdentificationList& peptide_ids,
169 const std::vector<Row>& rows,
170 const std::vector<Size>& run_rows,
171 const std::vector<std::string>& uniq_seq,
172 const std::vector<float>& uniq_charge,
173 bool higher_score_better,
174 PeptDeepMS2Inference& ms2_inference,
175 PeptDeepRTInference& rt_inference);
176
177 std::string ms2_model_;
178 std::string rt_model_;
179 double nce_{-1.0};
180 double nce_grid_halfwidth_{6.0};
181 double nce_grid_step_{2.0};
182 double nce_fallback_{30.0};
183 Size nce_sample_size_{2000};
184 std::string instrument_;
185 double calibration_quantile_{0.5};
186 std::string rt_model_type_{"b_spline"};
187 Size rt_num_nodes_{5};
188 int ms2_min_ordinal_{1};
189 double ms2_strong_fraction_{0.05};
190 Size batch_size_{500};
191 Int threads_{4};
192
193 double used_nce_{-1.0};
194 double rt_calibration_error_{-1.0};
195 Size num_psms_{0};
196 Size num_predicted_psms_{0};
197 };
198
199} // 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:160
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:158
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:155
double score
search score, used to pick the calibration set
Definition PeptDeepRescoring.h:159
~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:177
Size len
peptide length
Definition PeptDeepRescoring.h:157
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:184
std::string rt_model_
Definition PeptDeepRescoring.h:178
Size hit
index into that identification's hits
Definition PeptDeepRescoring.h:156
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:154
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