OpenMS
IdentificationDataConverter Class Reference

#include <OpenMS/METADATA/ID/IdentificationDataConverter.h>

Classes

struct  PepIDCompare
 Functor for ordering peptide IDs by RT and m/z (if available) More...
 
struct  StepOptCompare
 Functor for ordering StepOpt (by date of the steps, if available): More...
 

Static Public Member Functions

static void importIDs (IdentificationData &id_data, const std::vector< ProteinIdentification > &proteins, const std::vector< PeptideIdentification > &peptides)
 Import from legacy peptide/protein identifications. More...
 
static void exportIDs (const IdentificationData &id_data, std::vector< ProteinIdentification > &proteins, std::vector< PeptideIdentification > &peptides, bool export_ids_wo_scores=false)
 Export to legacy peptide/protein identifications. More...
 
static MzTab exportMzTab (const IdentificationData &id_data)
 Export to mzTab format. More...
 
static void importSequences (IdentificationData &id_data, const std::vector< FASTAFile::FASTAEntry > &fasta, IdentificationData::MoleculeType type=IdentificationData::MoleculeType::PROTEIN, const String &decoy_pattern="")
 Import FASTA sequences as parent sequences. More...
 
static void exportParentMatches (const IdentificationData::ParentMatches &parent_matches, PeptideHit &hit)
 Convert parent matches to peptide evidences. More...
 
static void importFeatureIDs (FeatureMap &features, bool clear_original=true)
 Convert IDs from legacy peptide/protein identifications in a feature map. More...
 
static void exportFeatureIDs (FeatureMap &features, bool clear_original=true)
 Convert IDs in a feature map to legacy peptide/protein identifications. More...
 
static void importConsensusIDs (ConsensusMap &consensus, bool clear_original=true)
 Convert IDs from legacy peptide/protein identifications in a consensus map. More...
 
static void exportConsensusIDs (ConsensusMap &consensus, bool clear_original=true)
 Convert IDs in a consensus map to legacy peptide/protein identifications. More...
 

Protected Types

using StepOpt = std::optional< IdentificationData::ProcessingStepRef >
 

Static Protected Member Functions

template<typename MzTabSectionRow >
static void exportParentSequenceToMzTab_ (const IdentificationData::ParentSequence &parent, std::vector< MzTabSectionRow > &output, std::map< IdentificationData::ScoreTypeRef, Size > &score_map)
 Export a parent sequence (protein or nucleic acid) to mzTab. More...
 
template<typename MzTabSectionRow , typename IdentSeq >
static void exportPeptideOrOligoToMzTab_ (const IdentSeq &identified, std::vector< MzTabSectionRow > &output, std::map< IdentificationData::ScoreTypeRef, Size > &score_map)
 Export an identified sequence (peptide or oligonucleotide, but not small molecule/compound) to mzTab. More...
 
template<typename MzTabSectionRow >
static void exportObservationMatchToMzTab_ (const String &sequence, const IdentificationData::ObservationMatch &match, double calc_mass, std::vector< MzTabSectionRow > &output, std::map< IdentificationData::ScoreTypeRef, Size > &score_map, std::map< IdentificationData::InputFileRef, Size > &file_map)
 Export an input match (peptide- or oligonucleotide-spectrum match) to mzTab. More...
 
static void exportStepsAndScoresToMzTab_ (const IdentificationData::AppliedProcessingSteps &steps_and_scores, MzTabParameterList &steps_out, std::map< Size, MzTabDouble > &scores_out, std::map< IdentificationData::ScoreTypeRef, Size > &score_map)
 Helper function to add processing steps (search engines) and their scores to MzTab. More...
 
static void addMzTabSEScores_ (const std::map< IdentificationData::ScoreTypeRef, Size > &scores, std::map< Size, MzTabParameter > &output)
 Helper function to add search engine score entries to MzTab's meta data section. More...
 
static void addMzTabMoleculeParentContext_ (const IdentificationData::ParentMatch &match, MzTabOligonucleotideSectionRow &row)
 Helper function for exportPeptideOrOligoToMzTab_() - oligonucleotide variant. More...
 
static void addMzTabMoleculeParentContext_ (const IdentificationData::ParentMatch &match, MzTabPeptideSectionRow &row)
 Helper function for exportPeptideOrOligoToMzTab_() - peptide variant. More...
 
static IdentificationData::SearchParamRef importDBSearchParameters_ (const ProteinIdentification::SearchParameters &pisp, IdentificationData &id_data)
 Helper function to import DB search parameters from legacy format. More...
 
static ProteinIdentification::SearchParameters exportDBSearchParameters_ (IdentificationData::SearchParamRef ref)
 Helper function to export DB search parameters to legacy format. More...
 
static void exportMSRunInformation_ (IdentificationData::ProcessingStepRef step_ref, ProteinIdentification &protein)
 Helper function to export (primary) MS run information to legacy format. More...
 
static void handleFeatureImport_ (Feature &feature, const IntList &indexes, std::vector< PeptideIdentification > &peptides, Size &id_counter, bool clear_original)
 
static void handleFeatureExport_ (Feature &feature, const IntList &indexes, IdentificationData &id_data, Size &id_counter)
 

Member Typedef Documentation

◆ StepOpt

using StepOpt = std::optional<IdentificationData::ProcessingStepRef>
protected

Member Function Documentation

◆ addMzTabMoleculeParentContext_() [1/2]

static void addMzTabMoleculeParentContext_ ( const IdentificationData::ParentMatch match,
MzTabOligonucleotideSectionRow row 
)
staticprotected

Helper function for exportPeptideOrOligoToMzTab_() - oligonucleotide variant.

◆ addMzTabMoleculeParentContext_() [2/2]

static void addMzTabMoleculeParentContext_ ( const IdentificationData::ParentMatch match,
MzTabPeptideSectionRow row 
)
staticprotected

Helper function for exportPeptideOrOligoToMzTab_() - peptide variant.

◆ addMzTabSEScores_()

static void addMzTabSEScores_ ( const std::map< IdentificationData::ScoreTypeRef, Size > &  scores,
std::map< Size, MzTabParameter > &  output 
)
staticprotected

Helper function to add search engine score entries to MzTab's meta data section.

◆ exportConsensusIDs()

static void exportConsensusIDs ( ConsensusMap consensus,
bool  clear_original = true 
)
static

Convert IDs in a consensus map to legacy peptide/protein identifications.

Parameters
consensusConsensus map containing IDs in new format
clear_originalClear original IDs after conversion?

◆ exportDBSearchParameters_()

static ProteinIdentification::SearchParameters exportDBSearchParameters_ ( IdentificationData::SearchParamRef  ref)
staticprotected

Helper function to export DB search parameters to legacy format.

◆ exportFeatureIDs()

static void exportFeatureIDs ( FeatureMap features,
bool  clear_original = true 
)
static

Convert IDs in a feature map to legacy peptide/protein identifications.

Parameters
featuresFeature map containing IDs in new format
clear_originalClear original IDs after conversion?

◆ exportIDs()

static void exportIDs ( const IdentificationData id_data,
std::vector< ProteinIdentification > &  proteins,
std::vector< PeptideIdentification > &  peptides,
bool  export_ids_wo_scores = false 
)
static

Export to legacy peptide/protein identifications.

Results are added to existing data (if any) in proteins and peptides.

Referenced by NucleicAcidSearchEngine::main_().

◆ exportMSRunInformation_()

static void exportMSRunInformation_ ( IdentificationData::ProcessingStepRef  step_ref,
ProteinIdentification protein 
)
staticprotected

Helper function to export (primary) MS run information to legacy format.

◆ exportMzTab()

static MzTab exportMzTab ( const IdentificationData id_data)
static

Export to mzTab format.

Referenced by NucleicAcidSearchEngine::main_().

◆ exportObservationMatchToMzTab_()

static void exportObservationMatchToMzTab_ ( const String sequence,
const IdentificationData::ObservationMatch match,
double  calc_mass,
std::vector< MzTabSectionRow > &  output,
std::map< IdentificationData::ScoreTypeRef, Size > &  score_map,
std::map< IdentificationData::InputFileRef, Size > &  file_map 
)
inlinestaticprotected

◆ exportParentMatches()

static void exportParentMatches ( const IdentificationData::ParentMatches parent_matches,
PeptideHit hit 
)
static

Convert parent matches to peptide evidences.

◆ exportParentSequenceToMzTab_()

static void exportParentSequenceToMzTab_ ( const IdentificationData::ParentSequence parent,
std::vector< MzTabSectionRow > &  output,
std::map< IdentificationData::ScoreTypeRef, Size > &  score_map 
)
inlinestaticprotected

◆ exportPeptideOrOligoToMzTab_()

static void exportPeptideOrOligoToMzTab_ ( const IdentSeq &  identified,
std::vector< MzTabSectionRow > &  output,
std::map< IdentificationData::ScoreTypeRef, Size > &  score_map 
)
inlinestaticprotected

Export an identified sequence (peptide or oligonucleotide, but not small molecule/compound) to mzTab.

◆ exportStepsAndScoresToMzTab_()

static void exportStepsAndScoresToMzTab_ ( const IdentificationData::AppliedProcessingSteps steps_and_scores,
MzTabParameterList steps_out,
std::map< Size, MzTabDouble > &  scores_out,
std::map< IdentificationData::ScoreTypeRef, Size > &  score_map 
)
staticprotected

Helper function to add processing steps (search engines) and their scores to MzTab.

◆ handleFeatureExport_()

static void handleFeatureExport_ ( Feature feature,
const IntList indexes,
IdentificationData id_data,
Size id_counter 
)
staticprotected

◆ handleFeatureImport_()

static void handleFeatureImport_ ( Feature feature,
const IntList indexes,
std::vector< PeptideIdentification > &  peptides,
Size id_counter,
bool  clear_original 
)
staticprotected

◆ importConsensusIDs()

static void importConsensusIDs ( ConsensusMap consensus,
bool  clear_original = true 
)
static

Convert IDs from legacy peptide/protein identifications in a consensus map.

Parameters
consensusConsensus map containing IDs in legacy format
clear_originalClear original IDs after conversion?

◆ importDBSearchParameters_()

static IdentificationData::SearchParamRef importDBSearchParameters_ ( const ProteinIdentification::SearchParameters pisp,
IdentificationData id_data 
)
staticprotected

Helper function to import DB search parameters from legacy format.

◆ importFeatureIDs()

static void importFeatureIDs ( FeatureMap features,
bool  clear_original = true 
)
static

Convert IDs from legacy peptide/protein identifications in a feature map.

Parameters
featuresFeature map containing IDs in legacy format
clear_originalClear original IDs after conversion?

◆ importIDs()

static void importIDs ( IdentificationData id_data,
const std::vector< ProteinIdentification > &  proteins,
const std::vector< PeptideIdentification > &  peptides 
)
static

Import from legacy peptide/protein identifications.

◆ importSequences()

static void importSequences ( IdentificationData id_data,
const std::vector< FASTAFile::FASTAEntry > &  fasta,
IdentificationData::MoleculeType  type = IdentificationData::MoleculeType::PROTEIN,
const String decoy_pattern = "" 
)
static

Import FASTA sequences as parent sequences.

Referenced by NucleicAcidSearchEngine::main_().