libpappsomspp
Library for mass spectrometry
pappso::Xic Class Reference

#include <xic.h>

Inheritance diagram for pappso::Xic:
pappso::Trace

Public Member Functions

 Xic ()
 
 Xic (const Trace &other)
 
virtual ~Xic ()
 
XicCstSPtr makeXicCstSPtr () const
 
XicSPtr makeXicSPtr () const
 
unsigned int getMsPointDistance (pappso_double rt, pappso_double rt_other) const
 get the number of MS measurement between 2 retention times on this xic More...
 
void debugPrintValues () const
 
void sortByRetentionTime ()
 sort peaks by retention time More...
 
const DataPointatRetentionTime (pappso_double rt) const
 get the DataPoint at the given retention time More...
 
- Public Member Functions inherited from pappso::Trace
 Trace ()
 
 Trace (const std::vector< pappso_double > &xVector, const std::vector< pappso_double > &yVector)
 
 Trace (const std::vector< std::pair< pappso_double, pappso_double >> &dataPoints)
 
 Trace (const std::vector< DataPoint > &dataPoints)
 
 Trace (const std::vector< DataPoint > &&dataPoints)
 
 Trace (const MapTrace &map_trace)
 
 Trace (const Trace &other)
 
 Trace (const Trace &&other)
 
virtual ~Trace ()
 
size_t initialize (const std::vector< pappso_double > &xVector, const std::vector< pappso_double > &yVector)
 
size_t initialize (const Trace &other)
 
size_t initialize (const std::map< pappso_double, pappso_double > &map)
 
virtual Traceoperator= (const Trace &x)
 
virtual Traceoperator= (Trace &&x)
 
TraceSPtr makeTraceSPtr () const
 
TraceCstSPtr makeTraceCstSPtr () const
 
size_t append (const DataPoint &data_point)
 appends a datapoint and return new size More...
 
std::vector< pappso_doublexValues () const
 
std::vector< pappso_doubleyValues () const
 
std::map< pappso_double, pappso_doubletoMap () const
 
DataPoint containsX (pappso_double value, PrecisionPtr precision_p=nullptr) const
 
const DataPointminYDataPoint () const
 
const DataPointmaxYDataPoint () const
 
pappso_double minY () const
 
pappso_double maxY () const
 
pappso_double maxY (double mzStart, double mzEnd) const
 
pappso_double sumY () const
 
pappso_double sumY (double mzStart, double mzEnd) const
 
void sortX ()
 
void sortY ()
 
void unique ()
 
virtual Tracefilter (const FilterInterface &filter) final
 apply a filter on this trace More...
 
QString toString () const
 
std::vector< DataPoint >::const_iterator dataPointCstIteratorWithX (pappso_double value) const
 find datapoint with exactly x value More...
 

Additional Inherited Members

- Protected Member Functions inherited from pappso::Trace
std::size_t dataPointIndexWithX (pappso_double value) const
 
std::vector< DataPoint >::iterator dataPointIteratorWithX (pappso_double value)
 

Detailed Description

Definition at line 43 of file xic.h.

Constructor & Destructor Documentation

◆ Xic() [1/2]

pappso::Xic::Xic ( )

Definition at line 37 of file xic.cpp.

38 {
39  qDebug() << "Xic::Xic begin";
40  qDebug() << "Xic::Xic end";
41 }

◆ Xic() [2/2]

pappso::Xic::Xic ( const Trace other)

Definition at line 43 of file xic.cpp.

43  : Trace(other)
44 {
45 }

◆ ~Xic()

pappso::Xic::~Xic ( )
virtual

Definition at line 47 of file xic.cpp.

48 {
49 }

Member Function Documentation

◆ atRetentionTime()

const DataPoint & pappso::Xic::atRetentionTime ( pappso_double  rt) const

get the DataPoint at the given retention time

Definition at line 74 of file xic.cpp.

75 {
76  for(auto &&peak : *this)
77  {
78  if(peak.y == rt)
79  return peak;
80  }
81  throw ExceptionOutOfRange(
82  QObject::tr("no intensity for this retention time"));
83 }

References pappso::rt.

◆ debugPrintValues()

void pappso::Xic::debugPrintValues ( ) const

Definition at line 65 of file xic.cpp.

66 {
67  for(auto &&peak : *this)
68  {
69  qDebug() << "rt = " << peak.x << ", int = " << peak.y;
70  }
71 }

◆ getMsPointDistance()

unsigned int pappso::Xic::getMsPointDistance ( pappso_double  rt,
pappso_double  rt_other 
) const

get the number of MS measurement between 2 retention times on this xic

Definition at line 86 of file xic.cpp.

87 {
88  if(rt_first > rt_second)
89  {
90  std::swap(rt_first, rt_second);
91  }
92  unsigned int distance = 0;
93  auto it = this->begin();
94  auto itend = this->end();
95 
96  while((it->x < rt_first) && (it != itend))
97  {
98  it++;
99  }
100  while((rt_second > it->x) && (it != itend))
101  {
102  qDebug() << "Xic::getMsPointDistance " << rt_first << " it->rt " << it->x
103  << " rt_second " << rt_second << distance;
104  distance++;
105  it++;
106  }
107 
108 
109  return distance;
110 }

◆ makeXicCstSPtr()

XicCstSPtr pappso::Xic::makeXicCstSPtr ( ) const

Definition at line 53 of file xic.cpp.

54 {
55  return std::make_shared<const Xic>(*this);
56 }

◆ makeXicSPtr()

XicSPtr pappso::Xic::makeXicSPtr ( ) const

Definition at line 59 of file xic.cpp.

60 {
61  return std::make_shared<Xic>(*this);
62 }

◆ sortByRetentionTime()

void pappso::Xic::sortByRetentionTime ( )

sort peaks by retention time

Definition at line 113 of file xic.cpp.

114 {
115  sortX();
116 }
void sortX()
Definition: trace.cpp:956

References pappso::Trace::sortX().


The documentation for this class was generated from the following files: