![]() |
OpenMS
|
Represents the set of candidates (SpectrumMatches) identified for a single precursor spectrum. More...
#include <OpenMS/METADATA/PeptideIdentification.h>
Public Types | |
typedef PeptideHit | HitType |
Hit type definition. More... | |
Constructors, destructor, operators | |
String | id_ |
Identifier by which ProteinIdentification and PeptideIdentification are matched. More... | |
std::vector< PeptideHit > | hits_ |
A list containing the peptide hits. More... | |
String | score_type_ |
The score type (Mascot, Sequest, e-value, p-value) More... | |
bool | higher_score_better_ |
The score orientation. More... | |
double | mz_ |
double | rt_ |
PeptideIdentification () | |
default constructor More... | |
virtual | ~PeptideIdentification () noexcept |
destructor More... | |
PeptideIdentification (const PeptideIdentification &)=default | |
copy constructor More... | |
PeptideIdentification (PeptideIdentification &&) noexcept=default | |
Move constructor. More... | |
PeptideIdentification & | operator= (const PeptideIdentification &)=default |
Assignment operator. More... | |
PeptideIdentification & | operator= (PeptideIdentification &&)=default |
Move assignment operator. More... | |
bool | operator== (const PeptideIdentification &rhs) const |
Equality operator. More... | |
bool | operator!= (const PeptideIdentification &rhs) const |
Inequality operator. More... | |
double | getRT () const |
returns the RT of the MS2 spectrum where the identification occurred More... | |
void | setRT (double rt) |
sets the RT of the MS2 spectrum where the identification occurred More... | |
bool | hasRT () const |
shortcut for isnan(getRT()) More... | |
double | getMZ () const |
returns the MZ of the MS2 spectrum More... | |
void | setMZ (double mz) |
sets the MZ of the MS2 spectrum More... | |
bool | hasMZ () const |
shortcut for isnan(getRT()) More... | |
const std::vector< PeptideHit > & | getHits () const |
returns the peptide hits as const More... | |
std::vector< PeptideHit > & | getHits () |
returns the peptide hits More... | |
void | insertHit (const PeptideHit &hit) |
Appends a peptide hit. More... | |
void | insertHit (PeptideHit &&hit) |
Appends a peptide hit. More... | |
void | setHits (const std::vector< PeptideHit > &hits) |
Sets the peptide hits. More... | |
void | setHits (std::vector< PeptideHit > &&hits) |
double | getSignificanceThreshold () const |
returns the peptide significance threshold value (stored as a meta value) More... | |
void | setSignificanceThreshold (double value) |
setting of the peptide significance threshold value (stored as a meta value) More... | |
const String & | getScoreType () const |
returns the peptide score type More... | |
void | setScoreType (const String &type) |
sets the peptide score type More... | |
bool | isHigherScoreBetter () const |
returns the peptide score orientation More... | |
void | setHigherScoreBetter (bool value) |
sets the peptide score orientation More... | |
const String & | getIdentifier () const |
Returns the identifier which links this PI to its corresponding ProteinIdentification. More... | |
void | setIdentifier (const String &id) |
sets the identifier which links this PI to its corresponding ProteinIdentification More... | |
String | getBaseName () const |
returns the base name which links to underlying peak map More... | |
void | setBaseName (const String &base_name) |
sets the base name which links to underlying peak map More... | |
const String | getExperimentLabel () const |
returns the experiment label for this identification More... | |
void | setExperimentLabel (const String &type) |
sets the experiment label for this identification More... | |
String | getSpectrumReference () const |
void | setSpectrumReference (const String &ref) |
void | assignRanks () |
Sorts the hits by score and assigns ranks according to the scores. More... | |
void | sort () |
Sorts the hits by score. More... | |
void | sortByRank () |
Sorts the hits by rank. More... | |
bool | empty () const |
Returns if this PeptideIdentification result is empty. More... | |
static std::function< bool(const PeptideHit &, const PeptideHit &)> | getScoreComparator (bool higher_score_better) |
static std::vector< PeptideHit > | getReferencingHits (const std::vector< PeptideHit > &, const std::set< String > &accession) |
returns all peptide hits which reference to a given protein accession (i.e. filter by protein accession) More... | |
static std::multimap< String, std::pair< Size, Size > > | buildUIDsFromAllPepIDs (const ConsensusMap &cmap) |
Builds MultiMap over all PI's via their UID (as obtained from buildUIDFromPepID()), which is mapped to a index of PI therein, i.e. cm[p.first].getPeptideIdentifications()[p.second];. More... | |
static String | buildUIDFromPepID (const PeptideIdentification &pep_id, const std::map< String, StringList > &identifier_to_msrunpath) |
Builds UID from PeptideIdentification The UID can be formed in two ways. Either it is composed of the map_index and the spectrum-reference or of the ms_run_path and the spectrum_references, if the path is unique. The parts of the UID are separated by '|'. More... | |
Additional Inherited Members | |
![]() | |
MetaInfoInterface () | |
Constructor. More... | |
MetaInfoInterface (const MetaInfoInterface &rhs) | |
Copy constructor. More... | |
MetaInfoInterface (MetaInfoInterface &&) noexcept | |
Move constructor. More... | |
~MetaInfoInterface () | |
Destructor. More... | |
MetaInfoInterface & | operator= (const MetaInfoInterface &rhs) |
Assignment operator. More... | |
MetaInfoInterface & | operator= (MetaInfoInterface &&) noexcept |
Move assignment operator. More... | |
void | swap (MetaInfoInterface &rhs) |
Swap contents. More... | |
bool | operator== (const MetaInfoInterface &rhs) const |
Equality operator. More... | |
bool | operator!= (const MetaInfoInterface &rhs) const |
Equality operator. More... | |
const DataValue & | getMetaValue (const String &name) const |
Returns the value corresponding to a string, or DataValue::EMPTY if not found. More... | |
DataValue | getMetaValue (const String &name, const DataValue &default_value) const |
Returns the value corresponding to a string, or a default value (e.g.: DataValue::EMPTY) if not found More... | |
const DataValue & | getMetaValue (UInt index) const |
Returns the value corresponding to the index, or DataValue::EMPTY if not found. More... | |
DataValue | getMetaValue (UInt index, const DataValue &default_value) const |
Returns the value corresponding to the index, or a default value (e.g.: DataValue::EMPTY) if not found More... | |
bool | metaValueExists (const String &name) const |
Returns whether an entry with the given name exists. More... | |
bool | metaValueExists (UInt index) const |
Returns whether an entry with the given index exists. More... | |
void | setMetaValue (const String &name, const DataValue &value) |
Sets the DataValue corresponding to a name. More... | |
void | setMetaValue (UInt index, const DataValue &value) |
Sets the DataValue corresponding to an index. More... | |
void | removeMetaValue (const String &name) |
Removes the DataValue corresponding to name if it exists. More... | |
void | removeMetaValue (UInt index) |
Removes the DataValue corresponding to index if it exists. More... | |
void | addMetaValues (const MetaInfoInterface &from) |
function to copy all meta values from one object to this one More... | |
void | getKeys (std::vector< String > &keys) const |
Fills the given vector with a list of all keys for which a value is set. More... | |
void | getKeys (std::vector< UInt > &keys) const |
Fills the given vector with a list of all keys for which a value is set. More... | |
bool | isMetaEmpty () const |
Returns if the MetaInfo is empty. More... | |
void | clearMetaInfo () |
Removes all meta values. More... | |
![]() | |
static MetaInfoRegistry & | metaRegistry () |
Returns a reference to the MetaInfoRegistry. More... | |
![]() | |
void | createIfNotExists_ () |
Creates the MetaInfo object if it does not exist. More... | |
![]() | |
MetaInfo * | meta_ |
Pointer to the MetaInfo object (0 by default) More... | |
Represents the set of candidates (SpectrumMatches) identified for a single precursor spectrum.
Typically encapsulates the results of searching one specific MS/MS spectrum against a sequence database or spectral library. It primarily holds a list of PeptideHit objects, each representing a potential match to the spectrum.
Crucially, a PeptideIdentification is typically associated with a parent ProteinIdentification object. This parent object contains global information about the entire identification run, such as the search parameters, database used, and the overall set of identified proteins. The link between a PeptideIdentification and its parent ProteinIdentification is established via a shared identifier string (see getIdentifier() and setIdentifier()). Multiple PeptideIdentification instances (one per spectrum analyzed) can belong to the same ProteinIdentification run.
Each PeptideIdentification stores the precursor ion's retention time (RT) and mass-to-charge ratio (m/z) corresponding to the spectrum that was identified. This information (retrieved via getRT() and getMZ()) is essential for mapping these identifications back to experimental data, such as peaks in an MSExperiment, features in a FeatureMap, or consensus features in a ConsensusMap. The IDMapper class is often used for this purpose.
The class also stores information about the scoring system used (getScoreType(), isHigherScoreBetter()) and an optional significance threshold (getSignificanceThreshold()) for the peptide hits. The significance threshold is stored as a meta value with the key Constants::UserParam::SIGNIFICANCE_THRESHOLD.
PeptideIdentification inherits from MetaInfoInterface, allowing arbitrary metadata (key-value pairs) to be attached.
<>
typedef PeptideHit HitType |
Hit type definition.
default constructor
|
virtualnoexcept |
destructor
|
default |
copy constructor
|
defaultnoexcept |
Move constructor.
void assignRanks | ( | ) |
Sorts the hits by score and assigns ranks according to the scores.
|
static |
Builds UID from PeptideIdentification The UID can be formed in two ways. Either it is composed of the map_index and the spectrum-reference or of the ms_run_path and the spectrum_references, if the path is unique. The parts of the UID are separated by '|'.
Exception::MissingInformation | if Spectrum reference missing at PeptideIdentification |
Exception::MissingInformation | if Multiple files in a run, but no map_index in PeptideIdentification found |
pep_id | PeptideIdentification for which the UID is computed |
identifier_to_msrunpath | Mapping required to build UID. Can be obtained from ProteinIdentification::Mapping::identifier_to_msrunpath which can be created from the corresponding ProtID's |
|
static |
Builds MultiMap over all PI's via their UID (as obtained from buildUIDFromPepID()), which is mapped to a index of PI therein, i.e. cm[p.first].getPeptideIdentifications()[p.second];.
cmap | All PI's of the CMap are enumerated and their UID -> pair mapping is computed |
bool empty | ( | ) | const |
Returns if this PeptideIdentification result is empty.
String getBaseName | ( | ) | const |
returns the base name which links to underlying peak map
const String getExperimentLabel | ( | ) | const |
returns the experiment label for this identification
std::vector<PeptideHit>& getHits | ( | ) |
returns the peptide hits
const std::vector<PeptideHit>& getHits | ( | ) | const |
returns the peptide hits as const
Referenced by IDFilter::annotateBestPerPeptideWithData(), IDMapper::mapPrecursorsToIdentifications(), OPXLHelper::PeptideIDScoreComparator::operator()(), and FeatureFinderIdentificationAlgorithm::PeptideCompare::operator()().
const String& getIdentifier | ( | ) | const |
Returns the identifier which links this PI to its corresponding ProteinIdentification.
Referenced by ProteinIdentification::Mapping::getPrimaryMSRunPath().
double getMZ | ( | ) | const |
returns the MZ of the MS2 spectrum
Referenced by DimMZ::map(), IDMapper::mapPrecursorsToIdentifications(), and IdentificationDataConverter::PepIDCompare::operator()().
|
static |
returns all peptide hits which reference to a given protein accession (i.e. filter by protein accession)
double getRT | ( | ) | const |
returns the RT of the MS2 spectrum where the identification occurred
Referenced by DimRT::map(), IDMapper::mapPrecursorsToIdentifications(), IdentificationDataConverter::PepIDCompare::operator()(), and FeatureFinderIdentificationAlgorithm::PeptideCompare::operator()().
|
static |
const String& getScoreType | ( | ) | const |
returns the peptide score type
double getSignificanceThreshold | ( | ) | const |
returns the peptide significance threshold value (stored as a meta value)
String getSpectrumReference | ( | ) | const |
returns the spectrum reference for this identification. Currently it should almost always be the full native vendor ID.
bool hasMZ | ( | ) | const |
shortcut for isnan(getRT())
Referenced by IdentificationDataConverter::PepIDCompare::operator()().
bool hasRT | ( | ) | const |
shortcut for isnan(getRT())
Referenced by IdentificationDataConverter::PepIDCompare::operator()().
void insertHit | ( | const PeptideHit & | hit | ) |
Appends a peptide hit.
void insertHit | ( | PeptideHit && | hit | ) |
Appends a peptide hit.
bool isHigherScoreBetter | ( | ) | const |
returns the peptide score orientation
Referenced by IDFilter::annotateBestPerPeptideWithData().
bool operator!= | ( | const PeptideIdentification & | rhs | ) | const |
Inequality operator.
|
default |
Assignment operator.
|
default |
Move assignment operator.
bool operator== | ( | const PeptideIdentification & | rhs | ) | const |
Equality operator.
void setBaseName | ( | const String & | base_name | ) |
sets the base name which links to underlying peak map
void setExperimentLabel | ( | const String & | type | ) |
sets the experiment label for this identification
void setHigherScoreBetter | ( | bool | value | ) |
sets the peptide score orientation
void setHits | ( | const std::vector< PeptideHit > & | hits | ) |
Sets the peptide hits.
void setHits | ( | std::vector< PeptideHit > && | hits | ) |
void setIdentifier | ( | const String & | id | ) |
sets the identifier which links this PI to its corresponding ProteinIdentification
void setMZ | ( | double | mz | ) |
sets the MZ of the MS2 spectrum
void setRT | ( | double | rt | ) |
sets the RT of the MS2 spectrum where the identification occurred
void setScoreType | ( | const String & | type | ) |
sets the peptide score type
void setSignificanceThreshold | ( | double | value | ) |
setting of the peptide significance threshold value (stored as a meta value)
void setSpectrumReference | ( | const String & | ref | ) |
sets the spectrum reference for this identification. Currently it should almost always be the full native vendor ID.
void sort | ( | ) |
Sorts the hits by score.
Sorting takes the score orientation (higher_score_better_
) into account, i.e. after sorting, the best-scoring hit is the first.
Referenced by IDFilter::annotateBestPerPeptideWithData().
void sortByRank | ( | ) |
Sorts the hits by rank.
Sorting hits by rank attribute, i.e. after sorting, the hits will be in ascending order of rank.
|
protected |
The score orientation.
|
protected |
A list containing the peptide hits.
|
protected |
Identifier by which ProteinIdentification and PeptideIdentification are matched.
|
protected |
|
protected |
|
protected |
The score type (Mascot, Sequest, e-value, p-value)