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

Detailed Description

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

Modified peptides are intentionally rejected for now. The generated mod_x tensor is zero-filled and therefore represents unmodified peptides only.

Member Function Documentation

◆ buildUnmodifiedChargedBatch()

static PeptDeepInputBatch buildUnmodifiedChargedBatch ( const std::vector< std::string > &  peptides,
const std::vector< float > &  charges,
const PeptDeepInputConfig config = PeptDeepInputConfig() 
)
static

Like buildUnmodifiedPeptideBatch(), additionally populating the (scaled) charges field.

Parameters
peptidesA vector of raw uppercase peptide strings.
chargesPrecursor charge states, one per peptide. Must match peptides size.
configPadding policy (terminal tokens, fixed sequence length).
Returns
A PeptDeepInputBatch with aa_indices, mod_x, and charges populated.
Exceptions
Exception::IllegalArgumentif charges.size() != peptides.size(), or via buildUnmodifiedPeptideBatch().

◆ buildUnmodifiedInstrumentBatch()

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

Like buildUnmodifiedChargedBatch(), additionally populating the (scaled) nces and instrument_indices fields.

Parameters
peptidesA vector of raw uppercase peptide strings.
chargesPrecursor charge states, one per peptide. Must match peptides size.
ncesNormalized collision energies, one per peptide. Must match peptides size.
instrument_indicesCategorical instrument identifiers, one per peptide. Must match peptides size.
configPadding policy (terminal tokens, fixed sequence length).
Returns
A PeptDeepInputBatch with all fields populated.
Exceptions
Exception::IllegalArgumentif any of charges/nces/instrument_indices does not match peptides.size(), or via buildUnmodifiedChargedBatch().

◆ buildUnmodifiedPeptideBatch()

static PeptDeepInputBatch buildUnmodifiedPeptideBatch ( const std::vector< std::string > &  peptides,
const PeptDeepInputConfig config = PeptDeepInputConfig() 
)
static

Tokenizes a batch of unmodified peptides into a padded aa_indices/mod_x tensor pair.

Parameters
peptidesA vector of raw uppercase peptide strings. Must be non-empty.
configPadding policy (terminal tokens, fixed sequence length).
Returns
A PeptDeepInputBatch with aa_indices and a zero-filled mod_x populated; charges/nces/instrument_indices left empty.
Exceptions
Exception::IllegalArgumentif peptides is empty or contains an invalid sequence (see validatePeptide()).
Exception::InvalidValueif config.fixed_sequence_length is shorter than the longest encoded peptide.