OpenMS
Loading...
Searching...
No Matches
PeptDeepInput.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, Justin Sing $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11#include <OpenMS/config.h>
12#include <cstddef>
13#include <cstdint>
14#include <string>
15#include <vector>
16
17namespace OpenMS
18{
19 namespace ML
20 {
22 struct OPENMS_DLLAPI PeptDeepInputConfig
23 {
25 bool add_terminal_tokens = true;
26
29 size_t fixed_sequence_length = 0;
30 };
31
33 struct OPENMS_DLLAPI PeptDeepInputBatch
34 {
35 size_t batch_size = 0;
36 size_t sequence_length = 0;
37
38 std::vector<int64_t> aa_indices;
39 std::vector<float> mod_x;
40
41 std::vector<float> charges;
42 std::vector<float> nces;
43 std::vector<int64_t> instrument_indices;
44 };
45
50 class OPENMS_DLLAPI PeptDeepInputBuilder
51 {
52 public:
60 const std::vector<std::string>& peptides,
62
70 const std::vector<std::string>& peptides,
71 const std::vector<float>& charges,
73
83 const std::vector<std::string>& peptides,
84 const std::vector<float>& charges,
85 const std::vector<float>& nces,
86 const std::vector<int64_t>& instrument_indices,
88 };
89 } // namespace ML
90} // namespace OpenMS
Shared featurization for PeptDeep RT, CCS, and MS2 ONNX predictors.
Definition PeptDeepInput.h:51
static PeptDeepInputBatch buildUnmodifiedPeptideBatch(const std::vector< std::string > &peptides, const PeptDeepInputConfig &config=PeptDeepInputConfig())
Tokenizes a batch of unmodified peptides into a padded aa_indices/mod_x tensor pair.
static PeptDeepInputBatch buildUnmodifiedChargedBatch(const std::vector< std::string > &peptides, const std::vector< float > &charges, const PeptDeepInputConfig &config=PeptDeepInputConfig())
Like buildUnmodifiedPeptideBatch(), additionally populating the (scaled) charges field.
static PeptDeepInputBatch buildUnmodifiedInstrumentBatch(const std::vector< std::string > &peptides, const std::vector< float > &charges, const std::vector< float > &nces, const std::vector< int64_t > &instrument_indices, const PeptDeepInputConfig &config=PeptDeepInputConfig())
Like buildUnmodifiedChargedBatch(), additionally populating the (scaled) nces and instrument_indices ...
std::vector< float > charges
Definition PeptDeepInput.h:41
std::vector< int64_t > aa_indices
Definition PeptDeepInput.h:38
std::vector< float > mod_x
Definition PeptDeepInput.h:39
std::vector< float > nces
Definition PeptDeepInput.h:42
std::vector< int64_t > instrument_indices
Definition PeptDeepInput.h:43
Flat tensor buffers and dimensions for a PeptDeep ONNX batch.
Definition PeptDeepInput.h:34
Sequence-padding policy for PeptDeep ONNX inputs.
Definition PeptDeepInput.h:23
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19