OpenMS
PeptideIdentificationList Class Reference

Container for peptide identifications from multiple spectra. More...

#include <OpenMS/METADATA/PeptideIdentificationList.h>

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

Public Member Functions

Additional constructors for std::vector compatibility
 PeptideIdentificationList (const std::vector< PeptideIdentification > &vec)
 Constructor from std::vector. More...
 
 PeptideIdentificationList (std::vector< PeptideIdentification > &&vec)
 Move constructor from std::vector. More...
 
 PeptideIdentificationList (std::initializer_list< PeptideIdentification > init)
 Constructor from initializer list. More...
 
Assignment operators for std::vector compatibility
PeptideIdentificationListoperator= (const std::vector< PeptideIdentification > &vec)
 Assignment from std::vector. More...
 
PeptideIdentificationListoperator= (std::vector< PeptideIdentification > &&vec)
 Move assignment from std::vector. More...
 
PeptideIdentificationListoperator= (std::initializer_list< PeptideIdentification > init)
 Assignment from initializer list. More...
 
- Public Member Functions inherited from ExposedVector< PeptideIdentification >
 ExposedVector ()=default
 
 ExposedVector (const size_t n)
 
 ExposedVector (const size_t n, const PeptideIdentification &val)
 
 ExposedVector (Iter begin, Iter end)
 
 ExposedVector (const ExposedVector &rhs)=default
 Copy C'tor. More...
 
 ExposedVector (ExposedVector &&rhs) noexcept=default
 Move C'tor. More...
 
ExposedVectoroperator= (const ExposedVector &rhs)=default
 Assignment. More...
 
ExposedVectoroperator= (ExposedVector &&rhs) noexcept=default
 Move Assignment. More...
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
size_t size () const noexcept
 
void resize (const size_t new_size)
 
void reserve (const size_t new_size)
 
bool empty () const noexcept
 
PeptideIdentificationoperator[] (size_t i) noexcept
 
const PeptideIdentificationoperator[] (size_t i) const noexcept
 
PeptideIdentificationat (size_t i)
 
const PeptideIdentificationat (size_t i) const
 
PeptideIdentificationback () noexcept
 
const PeptideIdentificationback () const noexcept
 
void push_back (const PeptideIdentification &f)
 
void push_back (PeptideIdentification &&f)
 
decltype(auto) emplace_back (Args &&... args)
 
void pop_back () noexcept
 
iterator erase (const_iterator where) noexcept
 
iterator erase (const_iterator from, const_iterator to) noexcept
 
iterator insert (const_iterator where, T from, T to)
 
iterator insert (const_iterator pos, const PeptideIdentification &value)
 Insert single element. More...
 
iterator insert (const_iterator pos, PeptideIdentification &&value)
 Insert single element (move) More...
 
iterator insert (const_iterator pos, size_type count, const PeptideIdentification &value)
 Insert n copies of value. More...
 
iterator insert (const_iterator pos, std::initializer_list< PeptideIdentification > init)
 Insert from initializer list. More...
 
void clear () noexcept
 Clear all elements. More...
 
reverse_iterator rbegin () noexcept
 Get reverse iterator to beginning. More...
 
const_reverse_iterator rbegin () const noexcept
 Get const reverse iterator to beginning. More...
 
reverse_iterator rend () noexcept
 Get reverse iterator to end. More...
 
const_reverse_iterator rend () const noexcept
 Get const reverse iterator to end. More...
 
const_reverse_iterator crbegin () const noexcept
 Get const reverse iterator to beginning. More...
 
const_reverse_iterator crend () const noexcept
 Get const reverse iterator to end. More...
 
void swap (ExposedVector &other) noexcept
 Swap contents with another ExposedVector. More...
 
void assign (InputIt first, InputIt last)
 Assign values from iterators. More...
 
void assign (size_type count, const PeptideIdentification &value)
 Assign n copies of value. More...
 
void assign (std::initializer_list< PeptideIdentification > init)
 Assign from initializer list. More...
 
PeptideIdentificationfront () noexcept
 Get first element. More...
 
const PeptideIdentificationfront () const noexcept
 Get first element (const) More...
 
size_type max_size () const noexcept
 Get maximum possible size. More...
 
size_type capacity () const noexcept
 Get current capacity. More...
 
void shrink_to_fit ()
 Shrink capacity to fit size. More...
 
iterator emplace (const_iterator pos, Args &&... args)
 Emplace element at position. More...
 
const VecMembergetData () const
 read-only access to the underlying data More...
 
VecMembergetData ()
 read access to the underlying data More...
 
bool operator== (const ExposedVector &other) const
 Equality comparison. More...
 
bool operator!= (const ExposedVector &other) const
 Inequality comparison. More...
 
bool operator< (const ExposedVector &other) const requires LessThanComparable< PeptideIdentification >
 
bool operator<= (const ExposedVector &other) const requires LessThanComparable< PeptideIdentification >
 
bool operator> (const ExposedVector &other) const requires LessThanComparable< PeptideIdentification >
 
bool operator>= (const ExposedVector &other) const requires LessThanComparable< PeptideIdentification >
 

Additional Inherited Members

- Public Types inherited from ExposedVector< PeptideIdentification >
using VecMember = std::vector< PeptideIdentification >
 
using value_type = typename VecMember::value_type
 
using iterator = typename VecMember::iterator
 
using const_iterator = typename VecMember::const_iterator
 
using reverse_iterator = typename VecMember::reverse_iterator
 
using const_reverse_iterator = typename VecMember::const_reverse_iterator
 
using size_type = typename VecMember::size_type
 
using pointer = typename VecMember::pointer
 
using reference = typename VecMember::reference
 
using const_reference = typename VecMember::const_reference
 
using difference_type = typename VecMember::difference_type
 
- Protected Attributes inherited from ExposedVector< PeptideIdentification >
VecMember data_
 the container which holds all the data More...
 

Detailed Description

Container for peptide identifications from multiple spectra.

This class represents a collection of PeptideIdentification objects, typically originating from multiple spectra within a single identification run or experiment.

PeptideIdentificationList is commonly used in scenarios where multiple spectra have been searched against a database, resulting in a list of identifications that need to be processed together. Examples include:

  • Storing all peptide identifications from an LC-MS/MS run
  • Collecting identifications for protein inference algorithms
  • Aggregating results from multiple search engines
  • Managing identifications in feature mapping workflows

Note: The class uses composition over inheritance (via ExposedVector) to avoid the well-known pitfalls of inheriting directly from STL containers

Usage example:

// Add identifications from search results
PeptideIdentification id1, id2;
id1.setRT(1234.5);
id1.setMZ(567.8);
peptide_ids.push_back(id1);
peptide_ids.push_back(id2);
// Process all identifications
for (auto& id : peptide_ids)
{
// Apply filtering, scoring, etc.
}
// Use with algorithms that operate on collections
IDFilter::keepNBestHits(peptide_ids, 1);
BasicProteinInferenceAlgorithm algo;
algo.run(peptide_ids, protein_ids);
static void keepNBestHits(std::vector< IdentificationType > &ids, Size n)
Filters peptide or protein identifications according to the score of the hits, keeping the n best hit...
Definition: IDFilter.h:931
PeptideIdentificationList(const std::vector< PeptideIdentification > &vec)
Constructor from std::vector.
Definition: PeptideIdentificationList.h:73

The container provides full vector-like functionality including element access, iteration, size management, and all standard algorithms.

See also
PeptideIdentification, ProteinIdentification, IDFilter, BasicProteinInferenceAlgorithm, ExposedVector

Constructor & Destructor Documentation

◆ PeptideIdentificationList() [1/3]

PeptideIdentificationList ( const std::vector< PeptideIdentification > &  vec)
inline

Constructor from std::vector.

◆ PeptideIdentificationList() [2/3]

PeptideIdentificationList ( std::vector< PeptideIdentification > &&  vec)
inline

Move constructor from std::vector.

◆ PeptideIdentificationList() [3/3]

PeptideIdentificationList ( std::initializer_list< PeptideIdentification init)
inline

Constructor from initializer list.

Member Function Documentation

◆ operator=() [1/3]

PeptideIdentificationList& operator= ( const std::vector< PeptideIdentification > &  vec)
inline

Assignment from std::vector.

◆ operator=() [2/3]

PeptideIdentificationList& operator= ( std::initializer_list< PeptideIdentification init)
inline

Assignment from initializer list.

◆ operator=() [3/3]

PeptideIdentificationList& operator= ( std::vector< PeptideIdentification > &&  vec)
inline

Move assignment from std::vector.