59 return std::make_shared<const MsRunSlice>(*
this);
99 catch(std::exception &error)
101 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
116 catch(std::exception &error)
118 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
132 catch(std::exception &error)
134 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
148 outstream << (quint32)ipos;
149 outstream << spectrum;
158 quint32 vector_size = 0;
159 quint32 slice_number = 0;
160 quint32 spectrum_position = 0;
163 if(!instream.atEnd())
165 instream >> slice_number;
166 instream >> vector_size;
167 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__
168 <<
" vector_size=" << vector_size;
172 while(!instream.atEnd())
174 instream >> spectrum_position;
178 instream >> spectrum;
182 throw PappsoException(QString(
"error in QDataStream unserialize operator>> of "
183 "MsRunSlice %2 on %3:\n%1")
185 .arg(spectrum_position)
190 if(instream.status() != QDataStream::Ok)
192 throw PappsoException(QString(
"error in QDataStream unserialize operator>> of "
193 "MsRunSlice :\nread datastream failed status=%1")
194 .arg(instream.status()));
199 if(slice.
size() != vector_size)
201 throw PappsoException(QString(
"error in QDataStream unserialize operator>> of MsRunSlice "
202 "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
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