52  qRegisterMetaType<pappso::MassSpectrum>(
"pappso::MassSpectrum");
 
   54  qRegisterMetaType<pappso::MassSpectrum *>(
"pappso::MassSpectrum *");
 
   67  std::vector<std::pair<pappso_double, pappso_double>> &data_point_vector)
 
 
  117  assign(other.begin(), other.end());
 
 
  125  vector<DataPoint>::operator=(std::move(other));
 
 
  133  return std::make_shared<MassSpectrum>(*
this);
 
 
  140  return std::make_shared<const MassSpectrum>(*
this);
 
 
  226  if(size() != other.size())
 
  228      qDebug() << __FILE__ << 
"@" << __LINE__ << __FUNCTION__ << 
"()" 
  229               << 
"The other mass spectrum size is not equal to *this size" 
  230               << 
"*this size:" << size() << 
"trace size:" << other.size();
 
  237  auto trace_it = other.begin();
 
  239  for(
auto &&data_point : *
this)
 
  241      qDebug() << 
"first:" << data_point.x << 
"," << data_point.y
 
  242               << 
" second:" << trace_it->x << 
"," << trace_it->y;
 
  246          qDebug() << 
"x:" << data_point.x << 
" != " << trace_it->x;
 
  252          qDebug() << 
"y:" << data_point.y << 
" != " << trace_it->y;
 
 
  268  std::vector<DataPoint>::const_iterator it    = begin();
 
  269  std::vector<DataPoint>::const_iterator itEnd = end();
 
  271  std::vector<DataPoint>::const_reverse_iterator itRev    = rbegin();
 
  272  std::vector<DataPoint>::const_reverse_iterator itRevEnd = rend();
 
  277  while((it != itEnd) && (it->x <= itRev->x) && (itRev != itRevEnd))
 
  285      else if(sumX > upper)
 
  291          massSpectrum.push_back(*it);
 
  292          massSpectrum.push_back(*itRev);
 
  294          std::vector<DataPoint>::const_reverse_iterator itRevIn = itRev;
 
  298          sumX = it->x + itRevIn->x;
 
  299          while((sumX > lower) && (it->x <= itRevIn->x) &&
 
  300                (itRevIn != itRevEnd))
 
  302              sumX = it->x + itRevIn->x;
 
  304              massSpectrum.push_back(*itRevIn);
 
  312  std::sort(massSpectrum.begin(),
 
  318  std::vector<DataPoint>::iterator itEndFix =
 
  319    std::unique(massSpectrum.begin(),
 
  323                  return (a.x == b.x) && (a.y == b.y);
 
  326  massSpectrum.resize(std::distance(massSpectrum.begin(), itEndFix));
 
 
  337  for(std::size_t i = 0; i < size(); i++)
 
  339      qDebug() << 
"(" << this->operator[](i).x << 
"," << this->operator[](i).y
 
 
  348  quint32 vector_size = massSpectrum.size();
 
  349  outstream << vector_size;
 
  350  for(
auto &&peak : massSpectrum)
 
 
  366  if(!instream.atEnd())
 
  368      instream >> vector_size;
 
  369      qDebug() << __FILE__ << 
" " << __FUNCTION__ << 
" " << __LINE__
 
  370               << 
" vector_size=" << vector_size;
 
  372      for(quint32 i = 0; i < vector_size; i++)
 
  375          if(instream.status() != QDataStream::Ok)
 
  378                QString(
"error in QDataStream unserialize operator>> of " 
  379                        "massSpectrum :\nread datastream failed status=%1 " 
  382                  .arg(instream.status())
 
  387          massSpectrum.push_back(peak);
 
  389      if(instream.status() != QDataStream::Ok)
 
  393              "error in QDataStream unserialize operator>> of massSpectrum " 
  394              ":\nread datastream failed status=%1")
 
  395              .arg(instream.status()));
 
 
  406  return filter.filter(*
this);
 
 
generic interface to apply a filter on a MassSpectrum This is the same as FilterInterface,...
 
Class to represent a mass spectrum.
 
void sortMz()
Sort the DataPoint instances of this spectrum.
 
void debugPrintValues() const
 
MassSpectrumCstSPtr makeMassSpectrumCstSPtr() const
 
bool equals(const MassSpectrum &other, PrecisionPtr precision) const
Tells if this MassSpectrum is equal to massSpectrum.
 
MassSpectrumSPtr makeMassSpectrumSPtr() const
 
pappso_double tic() const
Compute the total ion current of this mass spectrum.
 
const DataPoint & minIntensityDataPoint() const
Find the DataPoint instance having the smallest intensity (y) value.
 
virtual MassSpectrum & massSpectrumFilter(const MassSpectrumFilterInterface &filter) final
apply a filter on this MassSpectrum
 
MassSpectrum filterSum(const MzRange &mass_range) const
 
virtual MassSpectrum & operator=(const MassSpectrum &other)
 
pappso_double totalIonCurrent() const
Compute the total ion current of this mass spectrum.
 
const DataPoint & maxIntensityDataPoint() const
Find the DataPoint instance having the greatest intensity (y) value.
 
pappso_double lower() const
 
pappso_double upper() const
 
bool contains(pappso_double) const
 
static PrecisionPtr getPpmInstance(pappso_double value)
get a ppm precision pointer
 
pappso_double sumY() const
 
const DataPoint & maxYDataPoint() const
 
virtual Trace & filter(const FilterInterface &filter) final
apply a filter on this trace
 
void sortX(Enums::SortOrder sort_order=Enums::SortOrder::ascending)
 
const DataPoint & minYDataPoint() const
 
int massSpectrumPtrMetaTypeId
 
int massSpectrumMetaTypeId
 
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
 
QDataStream & operator<<(QDataStream &outstream, const MassSpectrum &massSpectrum)
 
QDataStream & operator>>(QDataStream &instream, MassSpectrum &massSpectrum)
 
double pappso_double
A type definition for doubles.
 
std::shared_ptr< const MassSpectrum > MassSpectrumCstSPtr
 
const PrecisionBase * PrecisionPtr
 
std::shared_ptr< MassSpectrum > MassSpectrumSPtr