OpenMS
Loading...
Searching...
No Matches
PeptDeepMS2Inference.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: Satyam Yadav $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11#include <string>
12#include <vector>
13#include <cstdint>
14#include <OpenMS/config.h>
16
17namespace OpenMS {
18
23class OPENMS_DLLAPI PeptDeepMS2Inference {
24public:
30 explicit PeptDeepMS2Inference(const std::string& model_path, int threads = 4, size_t batch_size = 500);
31
34
48 std::vector<std::vector<float>> predictMS2(
49 const std::vector<std::string>& peptides,
50 const std::vector<float>& charges,
51 const std::vector<float>& nces,
52 const std::vector<int64_t>& instrument_indices);
53
55 static constexpr size_t ION_CHANNELS = 8;
57 enum Channel : size_t { B_Z1 = 0, B_Z2 = 1, Y_Z1 = 2, Y_Z2 = 3 };
59 static constexpr size_t NO_ION = static_cast<size_t>(-1);
60
73 static size_t ionIndex(size_t length, char type, size_t ordinal, int charge, size_t channels = ION_CHANNELS);
74
75private:
78};
79
80} // namespace OpenMS
Owns the ONNX Runtime session of one model file, for the predictors built on it.
Definition ONNXPredictorBase.h:44
Inference engine for PeptDeep MS2 Fragment Intensity prediction.
Definition PeptDeepMS2Inference.h:23
size_t batch_size_
Definition PeptDeepMS2Inference.h:77
Channel
The channels of a cleavage position: [b_z1, b_z2, y_z1, y_z2, b_modloss_z1, b_modloss_z2,...
Definition PeptDeepMS2Inference.h:57
PeptDeepMS2Inference(const std::string &model_path, int threads=4, size_t batch_size=500)
Constructor initializes the ONNX session with the specified model graph.
~PeptDeepMS2Inference()
Destructor.
static size_t ionIndex(size_t length, char type, size_t ordinal, int charge, size_t channels=ION_CHANNELS)
The index into a prediction of predictMS2() of the b or y ion of a peptide.
std::vector< std::vector< float > > predictMS2(const std::vector< std::string > &peptides, const std::vector< float > &charges, const std::vector< float > &nces, const std::vector< int64_t > &instrument_indices)
Predicts MS2 fragment intensities for a batch of peptide sequences.
ONNXPredictorBase model_
Definition PeptDeepMS2Inference.h:76
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19