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

Shared featurization for PeptDeep RT, CCS, and MS2 ONNX predictors. More...

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

Static Public Member Functions

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 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 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).
 

Detailed Description

Shared featurization for PeptDeep RT, CCS, and MS2 ONNX predictors.

Dynamically handles both unmodified and modified peptides, parsing modifications natively into a 109-element elemental feature tensor using empirical formulas.

Member Function Documentation

◆ buildPeptideBatch()

static PeptDeepInputBatch buildPeptideBatch ( const std::vector< OpenMS::AASequence > &  parsed_peptides,
const PeptDeepInputConfig &  config = PeptDeepInputConfig() 
)
static

Builds a baseline tensor batch containing amino acid indices and modification features.

Parameters
[in]parsed_peptidesA vector of pre-parsed AASequence objects.
[in]configConfiguration dictating padding and terminal token policies.
Returns
A PeptDeepInputBatch populated with sequence lengths, aa_indices, and mod_x.
Exceptions
Exception::IllegalArgumentIf the batch is empty, any peptide sequence is empty, or an encoded peptide exceeds fixed sequence length.

◆ buildPrecursorBatch()

static PeptDeepInputBatch buildPrecursorBatch ( const std::vector< OpenMS::AASequence > &  parsed_peptides,
const std::vector< float > &  charges,
const PeptDeepInputConfig &  config = PeptDeepInputConfig() 
)
static

Builds a tensor batch incorporating precursor charge states (primarily for CCS).

Parameters
[in]parsed_peptidesA vector of pre-parsed AASequence objects.
[in]chargesA vector of precursor charges corresponding to the peptides.
[in]configConfiguration dictating padding and terminal token policies.
Returns
A PeptDeepInputBatch populated with baseline features and scaled charges.
Exceptions
Exception::IllegalArgumentIf the size of the vectors do not match, the batch is empty, any peptide sequence is empty, or an encoded peptide exceeds fixed sequence length.

◆ buildProductMetaBatch()

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() 
)
static

Builds a full tensor batch including Normalized Collision Energies and instrument details (for MS2).

Parameters
[in]parsed_peptidesA vector of pre-parsed AASequence objects.
[in]chargesA vector of precursor charges corresponding to the peptides.
[in]ncesA vector of Normalized Collision Energies (NCE).
[in]instrument_indicesA vector of instrument identifier indices.
[in]configConfiguration dictating padding and terminal token policies.
Returns
A fully populated PeptDeepInputBatch ready for MS2 ONNX inference.
Exceptions
Exception::IllegalArgumentIf the size of the vectors do not match, the batch is empty, any peptide sequence is empty, or an encoded peptide exceeds fixed sequence length.