OpenMS
Loading...
Searching...
No Matches
RescoreInput Struct Reference

Input to domain-agnostic Percolator::rescore. More...

#include <OpenMS/ANALYSIS/ID/PercolatorTypes.h>

Public Member Functions

size_t rowCount () const
 Number of rows: of features, or else of the dense feature_matrix.
 
size_t featureCount () const
 Number of features per row: of the first row of features, or else feature_names.size() (0 without rows)
 
const double * row (size_t i) const
 The featureCount() values of row i: of features, or else of the dense feature_matrix.
 

Public Attributes

std::vector< std::vector< double > > features
 
std::vector< bool > is_decoy
 Target (false) or decoy (true) label per row.
 
std::vector< int > cv_group_keys
 
StringList feature_names
 Names aligned 1:1 with feature columns; used for logging only.
 
std::vector< int > scan_numbers
 Optional per-row PIN-compatible fields.
 
std::vector< int > spec_file_numbers
 
std::vector< double > exp_masses
 
std::vector< double > calc_masses
 
std::vector< double > feature_matrix
 The feature matrix in one dense block, in place of features.
 
std::vector< std::string > peptide_keys
 

Detailed Description

Input to domain-agnostic Percolator::rescore.

Row ordering is preserved in the output. Each row corresponds to one data point — the row's semantics (PSM, transition, peak group, etc.) are determined by the caller.

Member Function Documentation

◆ featureCount()

size_t featureCount ( ) const
inline

Number of features per row: of the first row of features, or else feature_names.size() (0 without rows)

◆ row()

const double * row ( size_t  i) const
inline

The featureCount() values of row i: of features, or else of the dense feature_matrix.

◆ rowCount()

size_t rowCount ( ) const
inline

Number of rows: of features, or else of the dense feature_matrix.

Member Data Documentation

◆ calc_masses

std::vector<double> calc_masses

◆ cv_group_keys

std::vector<int> cv_group_keys

Per-row integer key used to group rows into the same cross-validation fold. Rows sharing a key will never be split across folds. Leave empty to use row index (each row in its own group). Supply this when rows have natural duplication (e.g., multiple PSMs from one spectrum, multiple transitions from one precursor).

◆ exp_masses

std::vector<double> exp_masses

◆ feature_matrix

std::vector<double> feature_matrix

The feature matrix in one dense block, in place of features.

Row-major: row i holds the values of the feature_names.size() features at [i * feature_names.size(), (i + 1) * feature_names.size()). Used when features is empty (at most one of the two may hold rows); the number of rows is then is_decoy.size(). rowCount(), featureCount() and row() read the rows of either layout.

Percolator::buildPSMRescoreInput() builds the feature matrix of PSM rescoring this way, straight from the PSMs.

◆ feature_names

StringList feature_names

Names aligned 1:1 with feature columns; used for logging only.

◆ features

std::vector<std::vector<double> > features

[n_rows][n_features] scalar features per row. Rows must all have the same length. Empty if the rows are in the dense feature_matrix.

◆ is_decoy

std::vector<bool> is_decoy

Target (false) or decoy (true) label per row.

◆ peptide_keys

std::vector<std::string> peptide_keys

Optional per-row peptide key for peptide-level q-values (Percolator parameter 'peptide_level'): rows with the same key and label are one peptide, as the percolator executable groups PSMs by the PIN 'Peptide' string between the flanks (incl. modifications). Empty, or one entry per row.

◆ scan_numbers

std::vector<int> scan_numbers

Optional per-row PIN-compatible fields.

When supplied, these override the synthetic defaults (scan = row_index, specFileNr = 0, expMass = calcMass = 0.0) that the wrapper uses internally. Populate them when the in-process output must be bitwise-identical to running the external percolator binary on a .pin file derived from the same PSMs: Percolator's internal PSM sort order (OrderScanHash hashes specFileNr and scan) determines the CV fold assignment, so scan_numbers and spec_file_numbers must match those that PercolatorInfile::store would emit.

Percolator::fillPINCompatibleFields() is a helper that derives all four vectors from a vector of PeptideIdentifications using the same conventions as PercolatorInfile::store.

Each vector is either empty (in which case the default is used) or contains exactly n_rows entries, one per feature row.

◆ spec_file_numbers

std::vector<int> spec_file_numbers