OpenMS
Loading...
Searching...
No Matches
PeptDeepMS2Inference Class Reference

Inference engine for PeptDeep MS2 Fragment Intensity prediction. More...

#include <OpenMS/ML/PEPTDEEP/PeptDeepMS2Inference.h>

Collaboration diagram for PeptDeepMS2Inference:
[legend]

Public Member Functions

 PeptDeepMS2Inference (const std::string &model_path, int intra_op_threads=4, size_t batch_size=500)
 Constructor initializes the ONNX session with the specified model graph.
 
 ~PeptDeepMS2Inference ()
 Destructor.
 
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.
 

Private Attributes

ONNXPredictorBase model_
 
size_t batch_size_
 

Detailed Description

Inference engine for PeptDeep MS2 Fragment Intensity prediction.

This class parses and tokenizes raw peptide string sequences into structural integer arrays and evaluates them through the ONNX Runtime backend to predict fragment intensities.

Constructor & Destructor Documentation

◆ PeptDeepMS2Inference()

PeptDeepMS2Inference ( const std::string &  model_path,
int  intra_op_threads = 4,
size_t  batch_size = 500 
)
explicit

Constructor initializes the ONNX session with the specified model graph.

Parameters
model_pathAbsolute or relative path to the PeptDeep MS2 ONNX model file.
intra_op_threadsNumber of ONNX execution threads (default 4).
batch_sizeMaximum number of peptides to process in a single ONNX run (default 500).
Exceptions
Exception::BaseExceptionif the model file cannot be found or loaded by the runtime.

◆ ~PeptDeepMS2Inference()

Destructor.

Member Function Documentation

◆ predictMS2()

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.

Parameters
peptidesA vector of raw uppercase peptide strings.
chargesA vector of precursor charge states (must match peptides size).
ncesA vector of normalized collision energies (must match peptides size).
instrument_indicesA vector of categorical integers representing MS instruments (e.g., 0=Lumos, 1=QE, 2=timsTOF, 3=Sciex).
Returns
A vector of flattened fragment intensity arrays, one for each peptide. Native shape ordering is contiguous by fragment and ion type [b_1, y_1, b_2, y_2...].
Exceptions
std::invalid_argumentif the sequence string is empty, too long, or contains unmapped characters.

Member Data Documentation

◆ batch_size_

size_t batch_size_
private

◆ model_

ONNXPredictorBase model_
private