34 #include "../../trace/datapoint.h"
35 #include "../../pappsoexception.h"
36 #include "../../exception/exceptionoutofrange.h"
59 return std::make_shared<const MsRunSlice>(*
this);
99 catch(std::exception &error)
101 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
103 QObject::tr(
"unable to access spectrum %1 (size=%2) %3")
117 catch(std::exception &error)
119 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
121 QObject::tr(
"unable to get spectrum %1 (size=%2) %3")
134 catch(std::exception &error)
136 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
138 QObject::tr(
"unable to get spectrum %1 (size=%2) %3")
151 outstream << (quint32)ipos;
152 outstream << spectrum;
161 quint32 vector_size = 0;
162 quint32 slice_number = 0;
163 quint32 spectrum_position = 0;
166 if(!instream.atEnd())
168 instream >> slice_number;
169 instream >> vector_size;
170 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__
171 <<
" vector_size=" << vector_size;
175 while(!instream.atEnd())
177 instream >> spectrum_position;
181 instream >> spectrum;
186 QString(
"error in QDataStream unserialize operator>> of "
187 "MsRunSlice %2 on %3:\n%1")
189 .arg(spectrum_position)
194 if(instream.status() != QDataStream::Ok)
197 QString(
"error in QDataStream unserialize operator>> of "
198 "MsRunSlice :\nread datastream failed status=%1")
199 .arg(instream.status()));
204 if(slice.
size() != vector_size)
207 QString(
"error in QDataStream unserialize operator>> of MsRunSlice "
208 "slice.size() != vector_size :\n %1 %2:")
Class to represent a mass spectrum.
const MassSpectrum & getSpectrum(std::size_t i) const
unsigned int m_sliceNumber
MsRunSliceSPtr makeMsRunSliceSp() const
void setSpectrum(std::size_t i, const MassSpectrum &spectrum)
set the mass spectrum for a given index (retention time)
void setSliceNumber(unsigned int slice_number)
void appendToStream(QDataStream &stream, std::size_t ipos) const
unsigned int getSliceNumber() const
void setSize(std::size_t size)
set number of spectrum (mz/intensity) stored in this slice
std::vector< MassSpectrum > m_spectrumList
virtual const QString & qwhat() const
one mz slice (1 dalton) of an MsRun
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
QDataStream & operator>>(QDataStream &instream, MassSpectrum &massSpectrum)
std::shared_ptr< const MsRunSlice > MsRunSliceSPtr