11#include <OpenMS/OpenMSConfig.h>
17#include <boost/range/combine.hpp>
24 class PeptideIdentification;
71 return data == rhs.
data &&
79 return !(*
this == rhs);
115 protein_ids_ = std::move(ids);
172 checkPeptideIdSize_(OPENMS_PRETTY_FUNCTION);
173 return PairIterator(data.getSpectra().cbegin(), peptide_ids_.cbegin());
182 checkPeptideIdSize_(OPENMS_PRETTY_FUNCTION);
183 return PairIterator(data.getSpectra().begin(), peptide_ids_.begin());
192 checkPeptideIdSize_(OPENMS_PRETTY_FUNCTION);
193 return PairIterator(data.getSpectra().cbegin(), peptide_ids_.cbegin());
202 return PairIterator(data.getSpectra().end(), peptide_ids_.end());
211 return PairIterator(data.getSpectra().end(), peptide_ids_.end());
220 return PairIterator(data.getSpectra().cend(), peptide_ids_.cend());
230 if (idx >= peptide_ids_.size())
233 OPENMS_PRETTY_FUNCTION,
234 idx, peptide_ids_.size());
236 if (idx >= data.getSpectra().size())
239 OPENMS_PRETTY_FUNCTION,
240 idx, data.getSpectra().size());
242 return {data.getSpectra()[idx], peptide_ids_[idx]};
252 if (idx >= peptide_ids_.size())
255 OPENMS_PRETTY_FUNCTION,
256 idx, peptide_ids_.size());
258 if (idx >= data.getSpectra().size())
261 OPENMS_PRETTY_FUNCTION,
262 idx, data.getSpectra().size());
264 return {data.getSpectra()[idx], peptide_ids_[idx]};
273 template<
typename T1,
typename T2>
315 return std::make_pair(std::ref(*m_ptr1), std::ref(*m_ptr2));
387 for (
const auto& prot_id : run.getProteinIdentifications())
395 for (
const auto& pep_id : run.getPeptideIdentifications())
404 for (
const auto& spectrum : run.getMSExperiment().getSpectra())
Class for storing MS run data with peptide and protein identifications.
Definition AnnotatedMSRun.h:39
const PeptideIdentificationList & getPeptideIdentifications() const
Get all peptide identifications for all spectra (const version)
std::vector< ProteinIdentification > protein_ids_
Definition AnnotatedMSRun.h:354
MSExperiment & getMSExperiment()
Get the MSExperiment.
PeptideIdentificationList & getPeptideIdentifications()
Get all peptide identifications for all spectra.
~AnnotatedMSRun()=default
Destructor.
void setProteinIdentifications(const std::vector< ProteinIdentification > &ids)
set the protein identifications
Definition AnnotatedMSRun.h:104
AnnotatedMSRun(MSExperiment &&experiment)
Move constructor for efficiently loading a MSExperiment without a deep copy.
Definition AnnotatedMSRun.h:54
AnnotatedMSRun::PairIterator< std::vector< MSSpectrum >::const_iterator, PeptideIdentificationList::const_iterator > ConstIterator
Definition AnnotatedMSRun.h:346
SpectrumIdRef operator[](size_t idx)
Access a spectrum and its associated peptide identification.
Definition AnnotatedMSRun.h:228
bool operator!=(const AnnotatedMSRun &rhs) const
Inequality operator.
Definition AnnotatedMSRun.h:77
bool operator==(const AnnotatedMSRun &rhs) const
Equality operator.
Definition AnnotatedMSRun.h:69
void setProteinIdentifications(std::vector< ProteinIdentification > &&ids)
Set the protein identifications (move version)
Definition AnnotatedMSRun.h:113
AnnotatedMSRun()=default
Default constructor.
AnnotatedMSRun(const AnnotatedMSRun &)=default
Copy constructor.
auto end()
Get an iterator to the end of the data.
Definition AnnotatedMSRun.h:200
void checkPeptideIdSize_(const char *function_name) const
AnnotatedMSRun & operator=(AnnotatedMSRun &&)=default
void setPeptideIdentifications(PeptideIdentificationList &&ids)
Set all peptide identifications for all spectra (move version)
void setMSExperiment(const MSExperiment &experiment)
Set the MSExperiment.
AnnotatedMSRun::PairIterator< std::vector< MSSpectrum >::iterator, PeptideIdentificationList::iterator > Iterator
Definition AnnotatedMSRun.h:345
std::vector< ProteinIdentification > & getProteinIdentifications()
Get the protein identification.
Definition AnnotatedMSRun.h:86
MSExperiment data
Definition AnnotatedMSRun.h:355
void setMSExperiment(MSExperiment &&experiment)
Set the MSExperiment.
auto cbegin() const
Get a const iterator to the beginning of the data.
Definition AnnotatedMSRun.h:170
AnnotatedMSRun(AnnotatedMSRun &&)=default
Move constructor.
PeptideIdentificationList peptide_ids_
Definition AnnotatedMSRun.h:353
ConstSpectrumIdRef operator[](size_t idx) const
Access a spectrum and its associated peptide identification (const version)
Definition AnnotatedMSRun.h:250
auto begin() const
Get a const iterator to the beginning of the data.
Definition AnnotatedMSRun.h:190
auto begin()
Get an iterator to the beginning of the data.
Definition AnnotatedMSRun.h:180
auto end() const
Get a const iterator to the end of the data.
Definition AnnotatedMSRun.h:209
const MSExperiment & getMSExperiment() const
Get the MSExperiment (const version)
std::pair< MSSpectrum &, PeptideIdentification & > SpectrumIdRef
Definition AnnotatedMSRun.h:41
void setPeptideIdentifications(const PeptideIdentificationList &ids)
Set all peptide identifications for all spectra.
auto cend() const
Get a const iterator to the end of the data.
Definition AnnotatedMSRun.h:218
std::pair< const MSSpectrum &, const PeptideIdentification & > ConstSpectrumIdRef
Definition AnnotatedMSRun.h:42
AnnotatedMSRun & operator=(const AnnotatedMSRun &)=default
const std::vector< ProteinIdentification > & getProteinIdentifications() const
Get the protein identification (const version)
Definition AnnotatedMSRun.h:95
Int overflow exception.
Definition Exception.h:211
typename VecMember::iterator iterator
Definition ExposedVector.h:68
typename VecMember::const_iterator const_iterator
Definition ExposedVector.h:69
The representation of a chromatogram.
Definition MSChromatogram.h:30
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::size_t hash_int(T value) noexcept
Hash for an integer type.
Definition HashUtils.h:107
void hash_combine(std::size_t &seed, std::size_t value) noexcept
Combine a hash value with additional data using golden ratio mixing.
Definition HashUtils.h:87
std::size_t hash_float(T value) noexcept
Hash for a floating point type (float or double).
Definition HashUtils.h:142
std::size_t fnv1a_hash_string(const std::string &s) noexcept
FNV-1a hash for a string.
Definition HashUtils.h:70
Iterator for pairs of spectra and peptide identifications.
Definition AnnotatedMSRun.h:275
friend bool operator!=(const PairIterator &a, const PairIterator &b)
Inequality operator.
Definition AnnotatedMSRun.h:335
PairIterator operator++(int)
Post-increment operator.
Definition AnnotatedMSRun.h:302
std::forward_iterator_tag iterator_category
Definition AnnotatedMSRun.h:276
auto operator*()
Dereference operator.
Definition AnnotatedMSRun.h:313
friend bool operator==(const PairIterator &a, const PairIterator &b)
Equality operator.
Definition AnnotatedMSRun.h:324
PairIterator(T1 ptr1, T2 ptr2)
Constructor.
Definition AnnotatedMSRun.h:284
T1 m_ptr1
Definition AnnotatedMSRun.h:341
std::ptrdiff_t difference_type
Definition AnnotatedMSRun.h:277
T2 m_ptr2
Definition AnnotatedMSRun.h:342
PairIterator & operator++()
Pre-increment operator.
Definition AnnotatedMSRun.h:291
std::size_t operator()(const OpenMS::AnnotatedMSRun &run) const noexcept
Definition AnnotatedMSRun.h:372