OpenMS
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
AnnotatedMSRun Class Reference

Class for storing MS run data with peptide and protein identifications. More...

#include <OpenMS/METADATA/AnnotatedMSRun.h>

Collaboration diagram for AnnotatedMSRun:
[legend]

Classes

struct  PairIterator
 Iterator for pairs of spectra and peptide identifications. More...
 

Public Types

using SpectrumIdRef = std::pair< MSSpectrum &, PeptideIdentification & >
 
using ConstSpectrumIdRef = std::pair< const MSSpectrum &, const PeptideIdentification & >
 
using SpectrumType = MSExperiment::SpectrumType
 
using ChromatogramType = MSExperiment::ChromatogramType
 
typedef AnnotatedMSRun::PairIterator< std::vector< MSSpectrum >::iterator, std::vector< PeptideIdentification >::iterator > Iterator
 
typedef AnnotatedMSRun::PairIterator< std::vector< MSSpectrum >::const_iterator, std::vector< PeptideIdentification >::const_iterator > ConstIterator
 

Public Member Functions

 AnnotatedMSRun ()=default
 Default constructor. More...
 
 AnnotatedMSRun (MSExperiment &&experiment)
 Move constructor for efficiently loading a MSExperiment without a deep copy. More...
 
 AnnotatedMSRun (AnnotatedMSRun &&)=default
 Move constructor. More...
 
 AnnotatedMSRun (const AnnotatedMSRun &)=default
 Copy constructor. More...
 
AnnotatedMSRunoperator= (const AnnotatedMSRun &)=default
 
AnnotatedMSRunoperator= (AnnotatedMSRun &&)=default
 
 ~AnnotatedMSRun ()=default
 Destructor. More...
 
std::vector< ProteinIdentification > & getProteinIdentifications ()
 Get the protein identification. More...
 
const std::vector< ProteinIdentification > & getProteinIdentifications () const
 Get the protein identification (const version) More...
 
std::vector< PeptideIdentification > & getPeptideIdentifications ()
 Get all peptide identifications for all spectra. More...
 
const std::vector< PeptideIdentification > & getPeptideIdentifications () const
 Get all peptide identifications for all spectra (const version) More...
 
void setPeptideIdentifications (std::vector< PeptideIdentification > &&ids)
 Set all peptide identifications for all spectra. More...
 
void setPeptideIdentifications (const std::vector< PeptideIdentification > &ids)
 Set all peptide identifications for all spectra. More...
 
MSExperimentgetMSExperiment ()
 Get the MSExperiment. More...
 
const MSExperimentgetMSExperiment () const
 Get the MSExperiment (const version) More...
 
void setMSExperiment (MSExperiment &&experiment)
 Set the MSExperiment. More...
 
void setMSExperiment (const MSExperiment &experiment)
 Set the MSExperiment. More...
 
auto cbegin () const
 Get a const iterator to the beginning of the data. More...
 
auto begin ()
 Get an iterator to the beginning of the data. More...
 
auto begin () const
 Get a const iterator to the beginning of the data. More...
 
auto end ()
 Get an iterator to the end of the data. More...
 
auto end () const
 Get a const iterator to the end of the data. More...
 
auto cend () const
 Get a const iterator to the end of the data. More...
 
SpectrumIdRef operator[] (size_t idx)
 Access a spectrum and its associated peptide identification. More...
 
ConstSpectrumIdRef operator[] (size_t idx) const
 Access a spectrum and its associated peptide identification (const version) More...
 

Private Member Functions

void checkPeptideIdSize_ (const char *function_name) const
 

Private Attributes

std::vector< PeptideIdentificationpeptide_ids_
 
std::vector< ProteinIdentificationprotein_ids_
 
MSExperiment data
 

Detailed Description

Class for storing MS run data with peptide and protein identifications.

This class stores an MSExperiment (containing spectra) along with peptide and protein identifications. Each spectrum in the MSExperiment is associated with a single PeptideIdentification object.

The class provides methods to access and modify these identifications, as well as iterators to traverse the spectra and their associated identifications together.

Member Typedef Documentation

◆ ChromatogramType

◆ ConstIterator

typedef AnnotatedMSRun::PairIterator<std::vector<MSSpectrum>::const_iterator, std::vector<PeptideIdentification>::const_iterator> ConstIterator

◆ ConstSpectrumIdRef

using ConstSpectrumIdRef = std::pair<const MSSpectrum&, const PeptideIdentification&>

◆ Iterator

typedef AnnotatedMSRun::PairIterator<std::vector<MSSpectrum>::iterator, std::vector<PeptideIdentification>::iterator> Iterator

◆ SpectrumIdRef

◆ SpectrumType

Constructor & Destructor Documentation

◆ AnnotatedMSRun() [1/4]

AnnotatedMSRun ( )
default

Default constructor.

◆ AnnotatedMSRun() [2/4]

AnnotatedMSRun ( MSExperiment &&  experiment)
inlineexplicit

Move constructor for efficiently loading a MSExperiment without a deep copy.

Parameters
experimentThe MSExperiment to move into this object

◆ AnnotatedMSRun() [3/4]

AnnotatedMSRun ( AnnotatedMSRun &&  )
default

Move constructor.

◆ AnnotatedMSRun() [4/4]

AnnotatedMSRun ( const AnnotatedMSRun )
default

Copy constructor.

◆ ~AnnotatedMSRun()

~AnnotatedMSRun ( )
default

Destructor.

Member Function Documentation

◆ begin() [1/2]

auto begin ( )
inline

Get an iterator to the beginning of the data.

Returns
An iterator to the beginning

◆ begin() [2/2]

auto begin ( ) const
inline

Get a const iterator to the beginning of the data.

Returns
A const iterator to the beginning

◆ cbegin()

auto cbegin ( ) const
inline

Get a const iterator to the beginning of the data.

Returns
A const iterator to the beginning

◆ cend()

auto cend ( ) const
inline

Get a const iterator to the end of the data.

Returns
A const iterator to the end

◆ checkPeptideIdSize_()

void checkPeptideIdSize_ ( const char *  function_name) const
private

◆ end() [1/2]

auto end ( )
inline

Get an iterator to the end of the data.

Returns
An iterator to the end

◆ end() [2/2]

auto end ( ) const
inline

Get a const iterator to the end of the data.

Returns
A const iterator to the end

◆ getMSExperiment() [1/2]

MSExperiment& getMSExperiment ( )

Get the MSExperiment.

Returns
A reference to the MSExperiment

Referenced by TOPPViewBase::metadataFileDialog().

◆ getMSExperiment() [2/2]

const MSExperiment& getMSExperiment ( ) const

Get the MSExperiment (const version)

Returns
A const reference to the MSExperiment

◆ getPeptideIdentifications() [1/2]

std::vector<PeptideIdentification>& getPeptideIdentifications ( )

Get all peptide identifications for all spectra.

Returns
A reference to the vector of peptide identifications

Referenced by IDFilter::keepHitsMatchingProteins().

◆ getPeptideIdentifications() [2/2]

const std::vector<PeptideIdentification>& getPeptideIdentifications ( ) const

Get all peptide identifications for all spectra (const version)

Returns
A const reference to the vector of peptide identifications

◆ getProteinIdentifications() [1/2]

std::vector<ProteinIdentification>& getProteinIdentifications ( )
inline

Get the protein identification.

Returns
A reference to the protein identification

Referenced by IDFilter::keepHitsMatchingProteins().

◆ getProteinIdentifications() [2/2]

const std::vector<ProteinIdentification>& getProteinIdentifications ( ) const
inline

Get the protein identification (const version)

Returns
A const reference to the protein identification

◆ operator=() [1/2]

AnnotatedMSRun& operator= ( AnnotatedMSRun &&  )
default

◆ operator=() [2/2]

AnnotatedMSRun& operator= ( const AnnotatedMSRun )
default

◆ operator[]() [1/2]

SpectrumIdRef operator[] ( size_t  idx)
inline

Access a spectrum and its associated peptide identification.

Parameters
idxThe index of the spectrum
Returns
A pair of references to the spectrum and its peptide identification

◆ operator[]() [2/2]

ConstSpectrumIdRef operator[] ( size_t  idx) const
inline

Access a spectrum and its associated peptide identification (const version)

Parameters
idxThe index of the spectrum
Returns
A pair of const references to the spectrum and its peptide identification

◆ setMSExperiment() [1/2]

void setMSExperiment ( const MSExperiment experiment)

Set the MSExperiment.

Parameters
experimentThe MSExperiment to set

◆ setMSExperiment() [2/2]

void setMSExperiment ( MSExperiment &&  experiment)

Set the MSExperiment.

Parameters
experimentThe MSExperiment to set

◆ setPeptideIdentifications() [1/2]

void setPeptideIdentifications ( const std::vector< PeptideIdentification > &  ids)

Set all peptide identifications for all spectra.

Parameters
idsVector of peptide identifications

◆ setPeptideIdentifications() [2/2]

void setPeptideIdentifications ( std::vector< PeptideIdentification > &&  ids)

Set all peptide identifications for all spectra.

Parameters
idsVector of peptide identifications

Member Data Documentation

◆ data

MSExperiment data
private

◆ peptide_ids_

std::vector<PeptideIdentification> peptide_ids_
private

◆ protein_ids_

std::vector<ProteinIdentification> protein_ids_
private