11 #include <OpenMS/OpenMSConfig.h>
15 #include <boost/range/combine.hpp>
21 class PeptideIdentification;
98 protein_ids_ = std::move(ids);
155 checkPeptideIdSize_(OPENMS_PRETTY_FUNCTION);
156 return PairIterator(data.getSpectra().cbegin(), peptide_ids_.cbegin());
165 checkPeptideIdSize_(OPENMS_PRETTY_FUNCTION);
166 return PairIterator(data.getSpectra().begin(), peptide_ids_.begin());
175 checkPeptideIdSize_(OPENMS_PRETTY_FUNCTION);
176 return PairIterator(data.getSpectra().cbegin(), peptide_ids_.cbegin());
185 return PairIterator(data.getSpectra().end(), peptide_ids_.end());
194 return PairIterator(data.getSpectra().end(), peptide_ids_.end());
203 return PairIterator(data.getSpectra().cend(), peptide_ids_.cend());
213 if (idx >= peptide_ids_.size())
216 OPENMS_PRETTY_FUNCTION,
217 idx, peptide_ids_.size());
219 if (idx >= data.getSpectra().size())
222 OPENMS_PRETTY_FUNCTION,
223 idx, data.getSpectra().size());
225 return {data.getSpectra()[idx], peptide_ids_[idx]};
235 if (idx >= peptide_ids_.size())
238 OPENMS_PRETTY_FUNCTION,
239 idx, peptide_ids_.size());
241 if (idx >= data.getSpectra().size())
244 OPENMS_PRETTY_FUNCTION,
245 idx, data.getSpectra().size());
247 return {data.getSpectra()[idx], peptide_ids_[idx]};
256 template<
typename T1,
typename T2>
298 return std::make_pair(std::ref(*m_ptr1), std::ref(*m_ptr2));
Class for storing MS run data with peptide and protein identifications.
Definition: AnnotatedMSRun.h:36
std::vector< ProteinIdentification > protein_ids_
Definition: AnnotatedMSRun.h:337
~AnnotatedMSRun()=default
Destructor.
void setProteinIdentifications(const std::vector< ProteinIdentification > &ids)
set the protein identifications
Definition: AnnotatedMSRun.h:87
AnnotatedMSRun(MSExperiment &&experiment)
Move constructor for efficiently loading a MSExperiment without a deep copy.
Definition: AnnotatedMSRun.h:51
AnnotatedMSRun::PairIterator< std::vector< MSSpectrum >::const_iterator, PeptideIdentificationList::const_iterator > ConstIterator
Definition: AnnotatedMSRun.h:329
SpectrumIdRef operator[](size_t idx)
Access a spectrum and its associated peptide identification.
Definition: AnnotatedMSRun.h:211
MSExperiment & getMSExperiment()
Get the MSExperiment.
PeptideIdentificationList & getPeptideIdentifications()
Get all peptide identifications for all spectra.
void setProteinIdentifications(std::vector< ProteinIdentification > &&ids)
Set the protein identifications (move version)
Definition: AnnotatedMSRun.h:96
AnnotatedMSRun()=default
Default constructor.
std::vector< ProteinIdentification > & getProteinIdentifications()
Get the protein identification.
Definition: AnnotatedMSRun.h:69
AnnotatedMSRun & operator=(const AnnotatedMSRun &)=default
AnnotatedMSRun(const AnnotatedMSRun &)=default
Copy constructor.
auto end()
Get an iterator to the end of the data.
Definition: AnnotatedMSRun.h:183
void checkPeptideIdSize_(const char *function_name) const
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:328
MSExperiment data
Definition: AnnotatedMSRun.h:338
void setMSExperiment(MSExperiment &&experiment)
Set the MSExperiment.
auto cbegin() const
Get a const iterator to the beginning of the data.
Definition: AnnotatedMSRun.h:153
const std::vector< ProteinIdentification > & getProteinIdentifications() const
Get the protein identification (const version)
Definition: AnnotatedMSRun.h:78
AnnotatedMSRun(AnnotatedMSRun &&)=default
Move constructor.
PeptideIdentificationList peptide_ids_
Definition: AnnotatedMSRun.h:336
ConstSpectrumIdRef operator[](size_t idx) const
Access a spectrum and its associated peptide identification (const version)
Definition: AnnotatedMSRun.h:233
const MSExperiment & getMSExperiment() const
Get the MSExperiment (const version)
auto begin() const
Get a const iterator to the beginning of the data.
Definition: AnnotatedMSRun.h:173
auto begin()
Get an iterator to the beginning of the data.
Definition: AnnotatedMSRun.h:163
auto end() const
Get a const iterator to the end of the data.
Definition: AnnotatedMSRun.h:192
std::pair< MSSpectrum &, PeptideIdentification & > SpectrumIdRef
Definition: AnnotatedMSRun.h:38
void setPeptideIdentifications(const PeptideIdentificationList &ids)
Set all peptide identifications for all spectra.
AnnotatedMSRun & operator=(AnnotatedMSRun &&)=default
auto cend() const
Get a const iterator to the end of the data.
Definition: AnnotatedMSRun.h:201
std::pair< const MSSpectrum &, const PeptideIdentification & > ConstSpectrumIdRef
Definition: AnnotatedMSRun.h:39
const PeptideIdentificationList & getPeptideIdentifications() const
Get all peptide identifications for all spectra (const version)
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
MSChromatogram ChromatogramType
Chromatogram type.
Definition: MSExperiment.h:76
MSSpectrum SpectrumType
Spectrum Type.
Definition: MSExperiment.h:74
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
Iterator for pairs of spectra and peptide identifications.
Definition: AnnotatedMSRun.h:258
friend bool operator!=(const PairIterator &a, const PairIterator &b)
Inequality operator.
Definition: AnnotatedMSRun.h:318
PairIterator & operator++()
Pre-increment operator.
Definition: AnnotatedMSRun.h:274
PairIterator operator++(int)
Post-increment operator.
Definition: AnnotatedMSRun.h:285
std::forward_iterator_tag iterator_category
Definition: AnnotatedMSRun.h:259
auto operator*()
Dereference operator.
Definition: AnnotatedMSRun.h:296
friend bool operator==(const PairIterator &a, const PairIterator &b)
Equality operator.
Definition: AnnotatedMSRun.h:307
PairIterator(T1 ptr1, T2 ptr2)
Constructor.
Definition: AnnotatedMSRun.h:267
T1 m_ptr1
Definition: AnnotatedMSRun.h:324
std::ptrdiff_t difference_type
Definition: AnnotatedMSRun.h:260
T2 m_ptr2
Definition: AnnotatedMSRun.h:325