A simple container of DataPoint instances.
More...
#include <trace.h>
A simple container of DataPoint instances.
Definition at line 131 of file trace.h.
◆ Trace() [1/7]
◆ Trace() [2/7]
Definition at line 371 of file trace.cpp.
374 reserve(dataPoints.size());
376 for(
auto &dataPoint : dataPoints)
378 push_back(DataPoint(dataPoint));
381 std::sort(begin(), end(), [](
const DataPoint &a,
const DataPoint &b) {
References pappso::a, and pappso::b.
◆ Trace() [3/7]
pappso::Trace::Trace |
( |
const std::vector< DataPoint > & |
dataPoints | ) |
|
Definition at line 387 of file trace.cpp.
388 : std::vector<DataPoint>(dataPoints)
◆ Trace() [4/7]
pappso::Trace::Trace |
( |
const std::vector< DataPoint > && |
dataPoints | ) |
|
Definition at line 393 of file trace.cpp.
394 : std::vector<DataPoint>(std::move(dataPoints))
◆ Trace() [5/7]
pappso::Trace::Trace |
( |
const MapTrace & |
map_trace | ) |
|
|
explicit |
Definition at line 400 of file trace.cpp.
402 for(
auto &&item : map_trace)
403 push_back(DataPoint(item.first, item.second));
◆ Trace() [6/7]
pappso::Trace::Trace |
( |
const Trace & |
other | ) |
|
Definition at line 406 of file trace.cpp.
406 : std::vector<DataPoint>(other)
◆ Trace() [7/7]
pappso::Trace::Trace |
( |
const Trace && |
other | ) |
|
Definition at line 411 of file trace.cpp.
411 : std::vector<DataPoint>(std::move(other))
◆ ~Trace()
pappso::Trace::~Trace |
( |
| ) |
|
|
virtual |
◆ containsX()
Definition at line 614 of file trace.cpp.
616 auto iterator = std::find_if(
617 begin(), end(), [value, precision_p](
const DataPoint &data_point) {
622 if(data_point.x >= (value - delta) && data_point.x <= (value + delta))
629 return (data_point.x == value);
633 if(iterator != end())
References pappso::PrecisionBase::delta(), and pappso::DataPoint::x.
◆ dataPointCstIteratorxWithX()
std::vector< DataPoint >::const_iterator pappso::Trace::dataPointCstIteratorxWithX |
( |
pappso_double |
value | ) |
const |
|
protected |
◆ dataPointIndexWithX()
std::size_t pappso::Trace::dataPointIndexWithX |
( |
pappso_double |
value | ) |
const |
|
protected |
Return a reference to the DataPoint instance that has its y member equal to value
.
Definition at line 601 of file trace.cpp.
603 std::vector<DataPoint>::const_iterator iterator =
606 if(iterator != end())
607 return std::distance(begin(), iterator);
609 return std::numeric_limits<std::size_t>::max();
References dataPointCstIteratorxWithX().
◆ dataPointIteratorxWithX()
Definition at line 577 of file trace.cpp.
580 std::find_if(begin(), end(), [value](
const DataPoint &dataPoint) {
581 return (dataPoint.x == value);
References pappso::DataPoint::x.
◆ filter()
◆ initialize() [1/3]
Definition at line 448 of file trace.cpp.
456 for(
auto &&item : map)
458 push_back(DataPoint(item.first, item.second));
◆ initialize() [2/3]
Definition at line 425 of file trace.cpp.
429 if(xVector.size() != yVector.size())
430 throw ExceptionNotPossible(
431 "trace.cpp -- ERROR xVector and yVector must have the same size.");
436 resize(xVector.size());
438 for(std::size_t iter = 0; iter < xVector.size(); ++iter)
440 push_back(DataPoint(xVector.at(iter), yVector.at(iter)));
◆ initialize() [3/3]
size_t pappso::Trace::initialize |
( |
const Trace & |
other | ) |
|
◆ makeTraceCstSPtr()
Definition at line 499 of file trace.cpp.
501 return std::make_shared<const Trace>(*
this);
◆ makeTraceSPtr()
TraceSPtr pappso::Trace::makeTraceSPtr |
( |
| ) |
const |
Definition at line 492 of file trace.cpp.
494 return std::make_shared<Trace>(*
this);
◆ maxY() [1/2]
◆ maxY() [2/2]
pappso_double pappso::Trace::maxY |
( |
double |
mzStart, |
|
|
double |
mzEnd |
|
) |
| const |
◆ maxYDataPoint()
const DataPoint & pappso::Trace::maxYDataPoint |
( |
| ) |
const |
Definition at line 666 of file trace.cpp.
668 auto dataPoint = std::max_element(
669 begin(), end(), [](
const DataPoint &a,
const DataPoint &b) {
673 if(dataPoint == end())
675 throw ExceptionOutOfRange(
676 QObject::tr(
"unable to get max peak intensity on spectrum size %1")
References pappso::a, and pappso::b.
Referenced by pappso::flooredLocalMaxima(), and maxY().
◆ minY()
◆ minYDataPoint()
const DataPoint & pappso::Trace::minYDataPoint |
( |
| ) |
const |
Definition at line 647 of file trace.cpp.
649 auto dataPoint = std::min_element(
650 begin(), end(), [](
const DataPoint &a,
const DataPoint &b) {
654 if(dataPoint == end())
656 throw ExceptionOutOfRange(
657 QObject::tr(
"unable to get min peak intensity on spectrum size %1")
References pappso::a, and pappso::b.
Referenced by minY(), and pappso::MassSpectrum::tic().
◆ operator=() [1/2]
Trace & pappso::Trace::operator= |
( |
const Trace & |
x | ) |
|
|
virtual |
Definition at line 475 of file trace.cpp.
477 assign(other.begin(), other.end());
◆ operator=() [2/2]
Definition at line 484 of file trace.cpp.
486 vector<DataPoint>::operator=(std::move(other));
◆ sortX()
void pappso::Trace::sortX |
( |
| ) |
|
Definition at line 748 of file trace.cpp.
750 std::sort(begin(), end(), [](
const DataPoint &a,
const DataPoint &b) {
References pappso::a, and pappso::b.
Referenced by pappso::MsRunRetentionTime< T >::align(), pappso::FilterTriangle::filter(), pappso::FilterRemoveC13::filter(), pappso::FilterComplementIonEnhancer::filter(), pappso::FilterGreatestYperWindow::filter(), pappso::MsRunRetentionTime< T >::getCommonDeltaRt(), pappso::IonIsotopeRatioScore::IonIsotopeRatioScore(), pappso::MassSpectrum::maxIntensityDataPoint(), and pappso::Xic::sortByRetentionTime().
◆ sumY() [1/2]
◆ sumY() [2/2]
pappso_double pappso::Trace::sumY |
( |
double |
mzStart, |
|
|
double |
mzEnd |
|
) |
| const |
◆ toMap()
Definition at line 530 of file trace.cpp.
532 std::map<pappso_double, pappso_double> map;
534 std::pair<std::map<pappso_double, pappso_double>::iterator,
bool> ret;
536 for(
auto &&dataPoint : *
this)
539 std::pair<pappso_double, pappso_double>(dataPoint.x, dataPoint.y));
541 if(ret.second ==
false)
543 qDebug() << __FILE__ <<
"@" << __LINE__ << __FUNCTION__ <<
"()"
544 <<
"It is odd that the Trace contains multiple same keys.";
547 ret.first->second += dataPoint.y;
◆ toString()
QString pappso::Trace::toString |
( |
| ) |
const |
Definition at line 797 of file trace.cpp.
802 for(
auto &&dataPoint : *
this)
804 text.append(QString(
"%1 %2\n")
805 .arg(dataPoint.x, 0,
'f', 10)
806 .arg(dataPoint.y, 0,
'f', 10));
◆ unique()
void pappso::Trace::unique |
( |
| ) |
|
◆ xToVector()
◆ xValues()
◆ yToVector()
◆ yValues()
◆ MassSpectrumCombinerInterface
friend class MassSpectrumCombinerInterface |
|
friend |
◆ TraceCombiner
◆ TraceMinusCombiner
◆ TracePlusCombiner
The documentation for this class was generated from the following files: