OpenMS
QuantmsIO Class Reference

File adapter for writing PSM (Peptide Spectrum Match) data to parquet files. More...

#include <OpenMS/FORMAT/QuantmsIO.h>

Inheritance diagram for QuantmsIO:
[legend]
Collaboration diagram for QuantmsIO:
[legend]

Public Member Functions

 QuantmsIO ()=default
 Default constructor. More...
 
 ~QuantmsIO ()
 Destructor. More...
 
void store (const String &filename, const std::vector< ProteinIdentification > &protein_identifications, const PeptideIdentificationList &peptide_identifications)
 Store peptide and protein identifications in parquet format. More...
 
void store (const String &filename, const std::vector< ProteinIdentification > &protein_identifications, const PeptideIdentificationList &peptide_identifications, bool export_all_psms)
 Store peptide and protein identifications in parquet format with all PSMs. More...
 
void store (const String &filename, const std::vector< ProteinIdentification > &protein_identifications, const PeptideIdentificationList &peptide_identifications, bool export_all_psms, const std::set< String > &meta_value_keys)
 Store peptide and protein identifications in parquet format with enhanced options. More...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
virtual ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void setLogger (ProgressLoggerImpl *logger)
 Sets the logger to be used for progress logging. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress (UInt64 bytes_processed=0) const
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Additional Inherited Members

- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

File adapter for writing PSM (Peptide Spectrum Match) data to parquet files.

This class converts OpenMS ProteinIdentification and PeptideIdentification objects to parquet format following the quantms.io PSM specification.

The parquet output contains columns following the quantms.io PSM specification:

  • sequence: unmodified peptide sequence
  • peptidoform: peptide sequence with modifications
  • modifications: peptide modifications (null for now)
  • precursor_charge: precursor charge
  • posterior_error_probability: PEP score from metavalues (nullable)
  • is_decoy: decoy flag (0=target, 1=decoy) based on target_decoy metavalue
  • calculated_mz: theoretical m/z from sequence
  • observed_mz: experimental precursor m/z
  • additional_scores: additional scores (null for now)
  • protein_accessions: protein accessions (null for now)
  • predicted_rt: predicted retention time (null for now)
  • reference_file_name: reference file name
  • cv_params: CV parameters (null for now)
  • scan: scan identifier
  • rt: retention time in seconds (nullable)
  • ion_mobility: ion mobility value (nullable, null for now)
  • number_peaks: number of peaks (nullable, null for now)
  • mz_array: m/z values array (null for now)
  • intensity_array: intensity values array (null for now)
  • file_metadata: file-level metadata with quantmsio_version (1.0), creator (OpenMS), file_type (psm), creation_date (actual timestamp), uuid (generated), scan_format (scan), software_provider (OpenMS)

Only the first peptide hit per peptide identification is processed by default (no rank field). When export_all_psms is enabled, all peptide hits are processed with a rank field. PEP scores are automatically detected from metavalues using known PEP score names. Optional meta value columns can be added for specific keys.

Constructor & Destructor Documentation

◆ QuantmsIO()

QuantmsIO ( )
default

Default constructor.

◆ ~QuantmsIO()

~QuantmsIO ( )

Destructor.

Member Function Documentation

◆ store() [1/3]

void store ( const String filename,
const std::vector< ProteinIdentification > &  protein_identifications,
const PeptideIdentificationList peptide_identifications 
)

Store peptide and protein identifications in parquet format.

Parameters
filenameOutput filename (should end with .parquet)
protein_identificationsVector of protein identifications
peptide_identificationsVector of peptide identifications
Exceptions
Exception::UnableToCreateFileif file cannot be created

◆ store() [2/3]

void store ( const String filename,
const std::vector< ProteinIdentification > &  protein_identifications,
const PeptideIdentificationList peptide_identifications,
bool  export_all_psms 
)

Store peptide and protein identifications in parquet format with all PSMs.

Parameters
filenameOutput filename (should end with .parquet)
protein_identificationsVector of protein identifications
peptide_identificationsVector of peptide identifications
export_all_psmsIf true, export all PSMs per spectrum with rank column
Exceptions
Exception::UnableToCreateFileif file cannot be created

◆ store() [3/3]

void store ( const String filename,
const std::vector< ProteinIdentification > &  protein_identifications,
const PeptideIdentificationList peptide_identifications,
bool  export_all_psms,
const std::set< String > &  meta_value_keys 
)

Store peptide and protein identifications in parquet format with enhanced options.

Parameters
filenameOutput filename (should end with .parquet)
protein_identificationsVector of protein identifications
peptide_identificationsVector of peptide identifications
export_all_psmsIf true, export all PSMs per spectrum with rank column. If false, export only first PSM
meta_value_keysSet of meta value keys to export as additional columns
Exceptions
Exception::UnableToCreateFileif file cannot be created