| OpenMS 2.5.0

Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
PeptideIdentification Class Reference
Metadata

Represents the peptide hits for a spectrum. More...

`#include <OpenMS/METADATA/PeptideIdentification.h>`

Inheritance diagram for PeptideIdentification:

## Public Types

typedef PeptideHit | HitType
| Hit type definition. More...

## Public Member Functions

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...
double | getSignificanceThreshold () const
| returns the peptide significance threshold value More...
void | setSignificanceThreshold (double value)
| setting of the peptide significance threshold 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 More...
void | setIdentifier (const String &id)
| sets the identifier More...
const 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...
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...
Constructors, destructor, operators
| 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...
Public Member Functions inherited from MetaInfoInterface
| 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...
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 DataValue &default_value=DataValue::EMPTY) const
| Returns the value corresponding to a string, or a default value (default: DataValue::EMPTY) if not found. More...
const DataValue & | getMetaValue (UInt index, const DataValue &default_value=DataValue::EMPTY) const
| Returns the value corresponding to an index, or a default value (default: 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 | 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 Public Member Functions

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 Public Member Functions inherited from MetaInfoInterface
static MetaInfoRegistry & | metaRegistry ()
| Returns a reference to the MetaInfoRegistry. More...

## Protected Attributes

String | id_
| Identifier by which ProteinIdentification and PeptideIdentification are matched. More...
std::vector< PeptideHit > | hits_
| A list containing the peptide hits. More...
double | significance_threshold_
| the peptide significance threshold More...
String | score_type_
| The score type (Mascot, Sequest, e-value, p-value) More...
bool | higher_score_better_
| The score orientation. More...
String | base_name_
double | mz_
double | rt_
Protected Attributes inherited from MetaInfoInterface
MetaInfo * | meta_
| Pointer to the MetaInfo object (0 by default) More...

## Additional Inherited Members

Protected Member Functions inherited from MetaInfoInterface
void | createIfNotExists_ ()
| Creates the MetaInfo object if it does not exist. More...

## Detailed Description

Represents the peptide hits for a spectrum.

This class is closely related to ProteinIdentification, which stores the protein hits and the general information about the identification run. More than one PeptideIdentification can belong to one ProteinIdentification. The general information about a PeptideIdentification has to be looked up in the corresponding ProteinIndentification, using the unique identifier that links the two.

When loading PeptideHit instances from a File, the retention time and mass-to-charge ratio of the precursor spectrum can be accessed using getRT() and getMZ(). This information can be used to map the peptide hits to an MSExperiment, a FeatureMap or a ConsensusMap using the IDMapper class.

## Member Typedef Documentation

## ◆ HitType

typedef PeptideHit HitType

Hit type definition.

## Constructor & Destructor Documentation

## ◆ PeptideIdentification() [1/3]

PeptideIdentification | ( |  | ) |

default constructor

## ◆ ~PeptideIdentification()

virtual ~PeptideIdentification | ( |  | ) |

virtual noexcept

destructor

## ◆ PeptideIdentification() [2/3]

PeptideIdentification | ( | const PeptideIdentification & |  | ) |

default

copy constructor

## ◆ PeptideIdentification() [3/3]

PeptideIdentification | ( | PeptideIdentification && |  | ) |

default noexcept

Move constructor.

## Member Function Documentation

## ◆ assignRanks()

void assignRanks | ( |  | ) |

Sorts the hits by score and assigns ranks according to the scores.

## ◆ empty()

bool empty | ( |  | ) | const

Returns if this PeptideIdentification result is empty.

## ◆ getBaseName()

const String& getBaseName | ( |  | ) | const

returns the base name which links to underlying peak map

## ◆ getExperimentLabel()

const String getExperimentLabel | ( |  | ) | const

returns the experiment label for this identification

## ◆ getHits() [1/2]

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()().

## ◆ getHits() [2/2]

std::vector<PeptideHit>& getHits | ( |  | ) |

returns the peptide hits

## ◆ getIdentifier()

const String& getIdentifier | ( |  | ) | const

returns the identifier

## ◆ getMZ()

double getMZ | ( |  | ) | const

returns the MZ of the MS2 spectrum

Referenced by IDMapper::mapPrecursorsToIdentifications().

## ◆ getReferencingHits()

static std::vector<PeptideHit> getReferencingHits | ( | const std::vector< PeptideHit > & | ,
|  | const std::set< String > & | accession
| ) |  |

static

returns all peptide hits which reference to a given protein accession (i.e. filter by protein accession)

## ◆ getRT()

double getRT | ( |  | ) | const

returns the RT of the MS2 spectrum where the identification occurred

Referenced by IDMapper::mapPrecursorsToIdentifications(), and FeatureFinderIdentificationAlgorithm::PeptideCompare::operator()().

## ◆ getScoreType()

const String& getScoreType | ( |  | ) | const

returns the peptide score type

## ◆ getSignificanceThreshold()

double getSignificanceThreshold | ( |  | ) | const

returns the peptide significance threshold value

## ◆ hasMZ()

bool hasMZ | ( |  | ) | const

shortcut for isnan(getRT())

## ◆ hasRT()

bool hasRT | ( |  | ) | const

shortcut for isnan(getRT())

## ◆ insertHit() [1/2]

void insertHit | ( | const PeptideHit & | hit | ) |

Appends a peptide hit.

## ◆ insertHit() [2/2]

void insertHit | ( | PeptideHit && | hit | ) |

Appends a peptide hit.

## ◆ isHigherScoreBetter()

bool isHigherScoreBetter | ( |  | ) | const

returns the peptide score orientation

Referenced by IDFilter::annotateBestPerPeptideWithData().

## ◆ operator!=()

bool operator!= | ( | const PeptideIdentification & | rhs | ) | const

Inequality operator.

## ◆ operator=() [1/2]

PeptideIdentification& operator= | ( | const PeptideIdentification & |  | ) |

default

Assignment operator.

## ◆ operator=() [2/2]

PeptideIdentification& operator= | ( | PeptideIdentification && |  | ) |

default

Move assignment operator.

## ◆ operator==()

bool operator== | ( | const PeptideIdentification & | rhs | ) | const

Equality operator.

## ◆ setBaseName()

void setBaseName | ( | const String & | base_name | ) |

sets the base name which links to underlying peak map

## ◆ setExperimentLabel()

void setExperimentLabel | ( | const String & | type | ) |

sets the experiment label for this identification

## ◆ setHigherScoreBetter()

void setHigherScoreBetter | ( | bool | value | ) |

sets the peptide score orientation

## ◆ setHits()

void setHits | ( | const std::vector< PeptideHit > & | hits | ) |

Sets the peptide hits.

## ◆ setIdentifier()

void setIdentifier | ( | const String & | id | ) |

sets the identifier

## ◆ setMZ()

void setMZ | ( | double | mz | ) |

sets the MZ of the MS2 spectrum

## ◆ setRT()

void setRT | ( | double | rt | ) |

sets the RT of the MS2 spectrum where the identification occurred

## ◆ setScoreType()

void setScoreType | ( | const String & | type | ) |

sets the peptide score type

## ◆ setSignificanceThreshold()

void setSignificanceThreshold | ( | double | value | ) |

setting of the peptide significance threshold value

## ◆ sort()

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().

## ◆ sortByRank()

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.

## Member Data Documentation

## ◆ base_name_

String base_name_

protected

## ◆ higher_score_better_

bool higher_score_better_

protected

The score orientation.

## ◆ hits_

std::vector<PeptideHit> hits_

protected

A list containing the peptide hits.

## ◆ id_

String id_

protected

Identifier by which ProteinIdentification and PeptideIdentification are matched.

## ◆ mz_

double mz_

protected

## ◆ rt_

double rt_

protected

## ◆ score_type_

String score_type_

protected

The score type (Mascot, Sequest, e-value, p-value)

## ◆ significance_threshold_

double significance_threshold_

protected

the peptide significance threshold