libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
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
 
void debugPrintValues () const
 
void sortByRetentionTime ()
 sort peaks by retention time
 
const DataPointatRetentionTime (pappso_double rt) const
 get the DataPoint at the given retention time
 
virtual Traceoperator= (const Trace &x)
 
virtual Traceoperator= (Trace &&x)
 
- Public Member Functions inherited from pappso::Trace
 Trace ()
 
 Trace (const QString &text)
 
 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 QString &x_text, const QString &y_text)
 
size_t initialize (const QString &space_sep_text)
 
size_t initialize (const Trace &other)
 
size_t initialize (const std::map< pappso_double, pappso_double > &map)
 
TraceSPtr makeTraceSPtr () const
 
TraceCstSPtr makeTraceCstSPtr () const
 
size_t append (const DataPoint &data_point)
 appends a datapoint and return new size
 
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 DataPointminXDataPoint () const
 
const DataPointmaxXDataPoint () const
 
const DataPointminYDataPoint () const
 
const DataPointmaxYDataPoint () const
 
pappso_double minX () const
 
pappso_double maxX () 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 sort (SortType sort_type, SortOrder sort_order=SortOrder::ascending)
 
void sortX (SortOrder sort_order=SortOrder::ascending)
 
void sortY (SortOrder sort_order=SortOrder::ascending)
 
void unique ()
 
std::size_t removeZeroYDataPoints ()
 
virtual Tracefilter (const FilterInterface &filter) final
 apply a filter on this trace
 
QString toString () const
 
QByteArray xAsBase64Encoded () const
 
QByteArray yAsBase64Encoded () const
 
std::vector< DataPoint >::const_iterator dataPointCstIteratorWithX (pappso_double value) const
 find datapoint with exactly x value
 

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}
@ rt
Retention time.

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}

◆ operator=() [1/2]

Trace & pappso::Trace::operator= ( const Trace x)
virtual

Reimplemented from pappso::Trace.

Definition at line 179 of file trace.cpp.

658{
659 assign(other.begin(), other.end());
660
661 return *this;
662}

◆ operator=() [2/2]

Trace & pappso::Trace::operator= ( Trace &&  x)
virtual

Reimplemented from pappso::Trace.

Definition at line 180 of file trace.cpp.

667{
668 vector<DataPoint>::operator=(std::move(other));
669 return *this;
670}

◆ sortByRetentionTime()

void pappso::Xic::sortByRetentionTime ( )

sort peaks by retention time

Definition at line 113 of file xic.cpp.

114{
115 sortX();
116}
void sortX(SortOrder sort_order=SortOrder::ascending)
Definition trace.cpp:1086

References pappso::Trace::sortX().


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