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>
13#include <cstddef>
14#include <cstdint>
15#include <string>
16#include <vector>
17
18namespace OpenMS
19{
20 namespace ML
21 {
23 struct OPENMS_DLLAPI PeptDeepInputConfig
24 {
26 bool add_terminal_tokens = true;
27
30 size_t fixed_sequence_length = 0;
31 };
32
34 struct OPENMS_DLLAPI PeptDeepInputBatch
35 {
36 size_t batch_size = 0;
37 size_t sequence_length = 0;
38
39 std::vector<int64_t> aa_indices;
40 std::vector<float> mod_x;
41
42 std::vector<float> charges;
43 std::vector<float> nces;
44 std::vector<int64_t> instrument_indices;
45 };
46
51 class OPENMS_DLLAPI PeptDeepInputBuilder
52 {
53 public:
60 const std::vector<OpenMS::AASequence>& parsed_peptides,
62
70 const std::vector<OpenMS::AASequence>& parsed_peptides,
71 const std::vector<float>& charges,
73
83 const std::vector<OpenMS::AASequence>& parsed_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:52
static PeptDeepInputBatch buildPrecursorBatch(const std::vector< OpenMS::AASequence > &parsed_peptides, const std::vector< float > &charges, const PeptDeepInputConfig &config=PeptDeepInputConfig())
Builds a tensor batch incorporating precursor charge states (primarily for CCS).
static PeptDeepInputBatch buildPeptideBatch(const std::vector< OpenMS::AASequence > &parsed_peptides, const PeptDeepInputConfig &config=PeptDeepInputConfig())
Builds a baseline tensor batch containing amino acid indices and modification features.
static PeptDeepInputBatch buildProductMetaBatch(const std::vector< OpenMS::AASequence > &parsed_peptides, const std::vector< float > &charges, const std::vector< float > &nces, const std::vector< int64_t > &instrument_indices, const PeptDeepInputConfig &config=PeptDeepInputConfig())
Builds a full tensor batch including Normalized Collision Energies and instrument details (for MS2).
std::vector< float > charges
Definition PeptDeepInput.h:42
std::vector< int64_t > aa_indices
Definition PeptDeepInput.h:39
std::vector< float > mod_x
Definition PeptDeepInput.h:40
std::vector< float > nces
Definition PeptDeepInput.h:43
std::vector< int64_t > instrument_indices
Definition PeptDeepInput.h:44
Flat tensor buffers and dimensions for a PeptDeep ONNX batch.
Definition PeptDeepInput.h:35
Sequence-padding policy for PeptDeep ONNX inputs.
Definition PeptDeepInput.h:24
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19