OpenMS
PercolatorInfile Class Reference

Class for storing Percolator tab-delimited input files. More...

#include <OpenMS/FORMAT/PercolatorInfile.h>

Static Public Member Functions

static void store (const String &pin_file, const std::vector< PeptideIdentification > &peptide_ids, const StringList &feature_set, const std::string &enz, int min_charge, int max_charge)
 
static std::vector< PeptideIdentificationload (const String &pin_file, bool higher_score_better, const String &score_name, const StringList &extra_scores, StringList &filenames, String decoy_prefix="", double threshold=0.01, bool SageAnnotation=false)
 Loads peptide identifications from a Percolator input file. More...
 
static String getScanIdentifier (const PeptideIdentification &pid, size_t index)
 

Static Protected Member Functions

static TextFile preparePin_ (const std::vector< PeptideIdentification > &peptide_ids, const StringList &feature_set, const std::string &enz, int min_charge, int max_charge)
 
static bool isEnz_ (const char &n, const char &c, const std::string &enz)
 
static Size countEnzymatic_ (const String &peptide, const std::string &enz)
 

Detailed Description

Class for storing Percolator tab-delimited input files.

Member Function Documentation

◆ countEnzymatic_()

static Size countEnzymatic_ ( const String peptide,
const std::string &  enz 
)
staticprotected

◆ getScanIdentifier()

static String getScanIdentifier ( const PeptideIdentification pid,
size_t  index 
)
static

◆ isEnz_()

static bool isEnz_ ( const char &  n,
const char &  c,
const std::string &  enz 
)
staticprotected

◆ load()

static std::vector<PeptideIdentification> load ( const String pin_file,
bool  higher_score_better,
const String score_name,
const StringList extra_scores,
StringList filenames,
String  decoy_prefix = "",
double  threshold = 0.01,
bool  SageAnnotation = false 
)
static

Loads peptide identifications from a Percolator input file.

This function reads a Percolator input file (pin_file) and returns a vector of PeptideIdentification objects. It extracts relevantinformation such as peptide sequences, scores, charges, annotations, and protein accessions, applying specified thresholds and handling decoy targets as needed. Note: If a filename column is encountered the set of filenames is filled in the order of appearance and PeptideIdentifications annotated with the id_merge_index meta value to link them to the filename (similar to a merged idXML file).

Parameters
pin_filehe path to the Percolator input file with a .pin extension.
higher_score_betterA boolean flag indicating whether higher scores are considered better (true) or lower scores are better (false).
score_nameThe name of the primary score to be used for ranking peptide hits.
extra_scoresA list of additional score names that should be extracted and stored in each PeptideHit.
filenamesWill be populated with the unique raw file names extracted from the input data.
decoy_prefixThe prefix used to identify decoy protein accessions. Proteins with accessions starting with this prefix are marked as decoys. Otherwise, it assumes that the pin file already contains the correctly annotated decoy status.
thresholdA double value representing the threshold for the spectrum_q value. Only spectra with spectrum_q below this threshold are processed. Implemented to allow prefiltering of Sage results.
SageAnnotationA boolean value used to determine if the pin file is coming from Sage or not
Returns
A std::vector of PeptideIdentification objects containing the peptide identifications.
Exceptions
<tt>Exception::ParseError</tt>if any line in the input file does not have the expected number of columns. TODO: implement something similar to PepXMLFile().setPreferredFixedModifications(getModifications_(fixed_modifications_names));

◆ preparePin_()

static TextFile preparePin_ ( const std::vector< PeptideIdentification > &  peptide_ids,
const StringList feature_set,
const std::string &  enz,
int  min_charge,
int  max_charge 
)
staticprotected

◆ store()

static void store ( const String pin_file,
const std::vector< PeptideIdentification > &  peptide_ids,
const StringList feature_set,
const std::string &  enz,
int  min_charge,
int  max_charge 
)
static