32#include "../../trace/datapoint.h"
33#include "../../pappsoexception.h"
34#include "../../exception/exceptionoutofrange.h"
57 return std::make_shared<const MsRunSlice>(*
this);
97 catch(std::exception &error)
99 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
101 QObject::tr(
"unable to access spectrum %1 (size=%2) %3")
115 catch(std::exception &error)
117 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
119 QObject::tr(
"unable to get spectrum %1 (size=%2) %3")
132 catch(std::exception &error)
134 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
136 QObject::tr(
"unable to get spectrum %1 (size=%2) %3")
149 outstream << (quint32)ipos;
150 outstream << spectrum;
159 quint32 vector_size = 0;
160 quint32 slice_number = 0;
161 quint32 spectrum_position = 0;
164 if(!instream.atEnd())
166 instream >> slice_number;
167 instream >> vector_size;
168 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__
169 <<
" vector_size=" << vector_size;
173 while(!instream.atEnd())
175 instream >> spectrum_position;
179 instream >> spectrum;
184 QString(
"error in QDataStream unserialize operator>> of "
185 "MsRunSlice %2 on %3:\n%1")
187 .arg(spectrum_position)
192 if(instream.status() != QDataStream::Ok)
195 QString(
"error in QDataStream unserialize operator>> of "
196 "MsRunSlice :\nread datastream failed status=%1")
197 .arg(instream.status()));
202 if(slice.
size() != vector_size)
205 QString(
"error in QDataStream unserialize operator>> of MsRunSlice "
206 "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