11 #include <OpenMS/OpenMSConfig.h>
13 #include <boost/range/combine.hpp>
19 class PeptideIdentification;
135 checkPeptideIdSize_(OPENMS_PRETTY_FUNCTION);
136 return PairIterator(data.getSpectra().cbegin(), peptide_ids_.cbegin());
145 checkPeptideIdSize_(OPENMS_PRETTY_FUNCTION);
146 return PairIterator(data.getSpectra().begin(), peptide_ids_.begin());
155 checkPeptideIdSize_(OPENMS_PRETTY_FUNCTION);
156 return PairIterator(data.getSpectra().cbegin(), peptide_ids_.cbegin());
165 return PairIterator(data.getSpectra().end(), peptide_ids_.end());
174 return PairIterator(data.getSpectra().end(), peptide_ids_.end());
183 return PairIterator(data.getSpectra().cend(), peptide_ids_.cend());
193 if (idx >= peptide_ids_.size())
196 OPENMS_PRETTY_FUNCTION,
197 idx, peptide_ids_.size());
199 if (idx >= data.getSpectra().size())
202 OPENMS_PRETTY_FUNCTION,
203 idx, data.getSpectra().size());
205 return {data.getSpectra()[idx], peptide_ids_[idx]};
215 if (idx >= peptide_ids_.size())
218 OPENMS_PRETTY_FUNCTION,
219 idx, peptide_ids_.size());
221 if (idx >= data.getSpectra().size())
224 OPENMS_PRETTY_FUNCTION,
225 idx, data.getSpectra().size());
227 return {data.getSpectra()[idx], peptide_ids_[idx]};
236 template<
typename T1,
typename T2>
278 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:34
AnnotatedMSRun::PairIterator< std::vector< MSSpectrum >::iterator, std::vector< PeptideIdentification >::iterator > Iterator
Definition: AnnotatedMSRun.h:308
std::vector< ProteinIdentification > protein_ids_
Definition: AnnotatedMSRun.h:317
~AnnotatedMSRun()=default
Destructor.
AnnotatedMSRun(MSExperiment &&experiment)
Move constructor for efficiently loading a MSExperiment without a deep copy.
Definition: AnnotatedMSRun.h:49
SpectrumIdRef operator[](size_t idx)
Access a spectrum and its associated peptide identification.
Definition: AnnotatedMSRun.h:191
MSExperiment & getMSExperiment()
Get the MSExperiment.
std::vector< PeptideIdentification > peptide_ids_
Definition: AnnotatedMSRun.h:316
AnnotatedMSRun()=default
Default constructor.
std::vector< ProteinIdentification > & getProteinIdentifications()
Get the protein identification.
Definition: AnnotatedMSRun.h:67
AnnotatedMSRun & operator=(const AnnotatedMSRun &)=default
AnnotatedMSRun(const AnnotatedMSRun &)=default
Copy constructor.
std::vector< PeptideIdentification > & getPeptideIdentifications()
Get all peptide identifications for all spectra.
auto end()
Get an iterator to the end of the data.
Definition: AnnotatedMSRun.h:163
void checkPeptideIdSize_(const char *function_name) const
void setMSExperiment(const MSExperiment &experiment)
Set the MSExperiment.
void setPeptideIdentifications(std::vector< PeptideIdentification > &&ids)
Set all peptide identifications for all spectra.
MSExperiment data
Definition: AnnotatedMSRun.h:318
const std::vector< PeptideIdentification > & getPeptideIdentifications() const
Get all peptide identifications for all spectra (const version)
void setMSExperiment(MSExperiment &&experiment)
Set the MSExperiment.
auto cbegin() const
Get a const iterator to the beginning of the data.
Definition: AnnotatedMSRun.h:133
const std::vector< ProteinIdentification > & getProteinIdentifications() const
Get the protein identification (const version)
Definition: AnnotatedMSRun.h:76
AnnotatedMSRun::PairIterator< std::vector< MSSpectrum >::const_iterator, std::vector< PeptideIdentification >::const_iterator > ConstIterator
Definition: AnnotatedMSRun.h:309
AnnotatedMSRun(AnnotatedMSRun &&)=default
Move constructor.
ConstSpectrumIdRef operator[](size_t idx) const
Access a spectrum and its associated peptide identification (const version)
Definition: AnnotatedMSRun.h:213
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:153
auto begin()
Get an iterator to the beginning of the data.
Definition: AnnotatedMSRun.h:143
void setPeptideIdentifications(const std::vector< PeptideIdentification > &ids)
Set all peptide identifications for all spectra.
auto end() const
Get a const iterator to the end of the data.
Definition: AnnotatedMSRun.h:172
std::pair< MSSpectrum &, PeptideIdentification & > SpectrumIdRef
Definition: AnnotatedMSRun.h:36
AnnotatedMSRun & operator=(AnnotatedMSRun &&)=default
auto cend() const
Get a const iterator to the end of the data.
Definition: AnnotatedMSRun.h:181
std::pair< const MSSpectrum &, const PeptideIdentification & > ConstSpectrumIdRef
Definition: AnnotatedMSRun.h:37
Int overflow exception.
Definition: Exception.h:211
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
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Iterator for pairs of spectra and peptide identifications.
Definition: AnnotatedMSRun.h:238
friend bool operator!=(const PairIterator &a, const PairIterator &b)
Inequality operator.
Definition: AnnotatedMSRun.h:298
PairIterator & operator++()
Pre-increment operator.
Definition: AnnotatedMSRun.h:254
PairIterator operator++(int)
Post-increment operator.
Definition: AnnotatedMSRun.h:265
std::forward_iterator_tag iterator_category
Definition: AnnotatedMSRun.h:239
auto operator*()
Dereference operator.
Definition: AnnotatedMSRun.h:276
friend bool operator==(const PairIterator &a, const PairIterator &b)
Equality operator.
Definition: AnnotatedMSRun.h:287
PairIterator(T1 ptr1, T2 ptr2)
Constructor.
Definition: AnnotatedMSRun.h:247
T1 m_ptr1
Definition: AnnotatedMSRun.h:304
std::ptrdiff_t difference_type
Definition: AnnotatedMSRun.h:240
T2 m_ptr2
Definition: AnnotatedMSRun.h:305