OpenMS
MQExporterHelper Class Reference

Helper class for common functions and NON trivial values needed for exporting MaxQuant outputs. More...

#include <OpenMS/QC/MQExporterHelper.h>

Classes

struct  MQCommonOutputs
 

Static Public Member Functions

static OpenMS::String extractGeneName (const OpenMS::String &prot_description)
 Extract a gene name from a protein description by looking for the substring 'GN='. More...
 
static OpenMS::Size proteinGroupID_ (std::map< OpenMS::String, OpenMS::Size > &database, const OpenMS::String &protein_accession)
 Returns a unique ID (number) for each distinct protein accession, or creates a new ID by augmenting the given database. More...
 
static std::map< OpenMS::Size, OpenMS::SizemakeFeatureUIDtoConsensusMapIndex_ (const OpenMS::ConsensusMap &cmap)
 Creates map that has the information which FeatureUID is mapped to which ConsensusFeature in ConsensusMap. More...
 
static bool hasValidPepID_ (const OpenMS::Feature &f, const OpenMS::Size c_feature_number, const std::multimap< OpenMS::String, std::pair< OpenMS::Size, OpenMS::Size >> &UIDs, const OpenMS::ProteinIdentification::Mapping &mp_f)
 Checks if Feature has valid PeptideIdentifications. More...
 
static bool hasPeptideIdentifications_ (const OpenMS::ConsensusFeature &cf)
 Checks if ConsensusFeature has valid PeptideIdentifications. More...
 
static bool isValid (const std::string &filename_)
 Checks if file is writable (i.e. the path in the ctor was not empty and could be created) More...
 

Detailed Description

Helper class for common functions and NON trivial values needed for exporting MaxQuant outputs.

Member Function Documentation

◆ extractGeneName()

static OpenMS::String extractGeneName ( const OpenMS::String prot_description)
static

Extract a gene name from a protein description by looking for the substring 'GN='.

If no such substring exists, an empty string is returned.

◆ hasPeptideIdentifications_()

static bool hasPeptideIdentifications_ ( const OpenMS::ConsensusFeature cf)
static

Checks if ConsensusFeature has valid PeptideIdentifications.

If there are no PeptideIdentifications, the functions returns false to show that something went wrong.

Parameters
cfis used to extract PeptideIdentifications
Returns
Returns true if the ConsensusFeature has any PepIDs; otherwise false

◆ hasValidPepID_()

static bool hasValidPepID_ ( const OpenMS::Feature f,
const OpenMS::Size  c_feature_number,
const std::multimap< OpenMS::String, std::pair< OpenMS::Size, OpenMS::Size >> &  UIDs,
const OpenMS::ProteinIdentification::Mapping mp_f 
)
static

Checks if Feature has valid PeptideIdentifications.

If there are no PeptideIdentifications or the best hit of the Feature cannot be found in corresponding ConsensusFeature, the functions returns false to show that something went wrong.

Parameters
fFeature to extract PeptideIdentifications
c_feature_numberIndex of corresponding ConsensusFeature in ConsensusMap
UIDsUIDs of all PeptideIdentifications of the ConsensusMap
mp_fMapping between the FeatureMap and ProteinIdentifications for the UID
Returns
Returns true if the PeptideIdentifications exist and are valid

◆ isValid()

static bool isValid ( const std::string &  filename_)
static

Checks if file is writable (i.e. the path in the ctor was not empty and could be created)

Returns
Returns true if file is writable

◆ makeFeatureUIDtoConsensusMapIndex_()

static std::map<OpenMS::Size, OpenMS::Size> makeFeatureUIDtoConsensusMapIndex_ ( const OpenMS::ConsensusMap cmap)
static

Creates map that has the information which FeatureUID is mapped to which ConsensusFeature in ConsensusMap.

Exceptions
Exception::Preconditionif FeatureHandle exists twice in ConsensusMap
Parameters
cmapConsensusMap that includes ConsensusFeatures
Returns
Returns map, the index is a FeatureID, the value is the index of the ConsensusFeature in the vector of ConsensusMap

◆ proteinGroupID_()

static OpenMS::Size proteinGroupID_ ( std::map< OpenMS::String, OpenMS::Size > &  database,
const OpenMS::String protein_accession 
)
static

Returns a unique ID (number) for each distinct protein accession, or creates a new ID by augmenting the given database.

Obtains a unique, consecutive number for each distinct protein, which can be used as a protein ID in the MaxQuant output files (in lack of a proper proteingroup ID which maps to proteinGroups.txt)

Parameters
databaseA map from accession to ID (which can be augmented by this function)
protein_accessionThe protein accession which needs translation to an ID
Returns
The ID for the protein_accession