A simple container of DataPoint instances.
More...
#include <trace.h>
A simple container of DataPoint instances.
Definition at line 126 of file trace.h.
◆ Trace() [1/7]
◆ Trace() [2/7]
Definition at line 360 of file trace.cpp.
363 reserve(dataPoints.size());
365 for(
auto &dataPoint : dataPoints)
367 push_back(DataPoint(dataPoint));
370 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 376 of file trace.cpp.
377 : std::vector<DataPoint>(dataPoints)
◆ Trace() [4/7]
pappso::Trace::Trace |
( |
const std::vector< DataPoint > && |
dataPoints | ) |
|
Definition at line 382 of file trace.cpp.
383 : std::vector<DataPoint>(std::move(dataPoints))
◆ Trace() [5/7]
pappso::Trace::Trace |
( |
const MapTrace & |
map_trace | ) |
|
|
explicit |
Definition at line 389 of file trace.cpp.
391 for(
auto &&item : map_trace)
392 push_back(DataPoint(item.first, item.second));
◆ Trace() [6/7]
pappso::Trace::Trace |
( |
const Trace & |
other | ) |
|
Definition at line 395 of file trace.cpp.
395 : std::vector<DataPoint>(other)
◆ Trace() [7/7]
pappso::Trace::Trace |
( |
const Trace && |
other | ) |
|
Definition at line 400 of file trace.cpp.
400 : std::vector<DataPoint>(std::move(other))
◆ ~Trace()
pappso::Trace::~Trace |
( |
| ) |
|
|
virtual |
◆ containsX()
Definition at line 603 of file trace.cpp.
605 auto iterator = std::find_if(
606 begin(), end(), [value, precision_p](
const DataPoint &data_point) {
611 if(data_point.x >= (value - delta) && data_point.x <= (value + delta))
618 return (data_point.x == value);
622 if(iterator != end())
References 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 590 of file trace.cpp.
592 std::vector<DataPoint>::const_iterator iterator =
595 if(iterator != end())
596 return std::distance(begin(), iterator);
598 return std::numeric_limits<std::size_t>::max();
References dataPointCstIteratorxWithX().
◆ dataPointIteratorxWithX()
Definition at line 566 of file trace.cpp.
569 std::find_if(begin(), end(), [value](
const DataPoint &dataPoint) {
570 return (dataPoint.x == value);
References pappso::DataPoint::x.
◆ filter()
◆ initialize() [1/3]
Definition at line 437 of file trace.cpp.
445 for(
auto &&item : map)
447 push_back(DataPoint(item.first, item.second));
◆ initialize() [2/3]
Definition at line 414 of file trace.cpp.
418 if(xVector.size() != yVector.size())
419 throw ExceptionNotPossible(
420 "trace.cpp -- ERROR xVector and yVector must have the same size.");
425 resize(xVector.size());
427 for(std::size_t iter = 0; iter < xVector.size(); ++iter)
429 push_back(DataPoint(xVector.at(iter), yVector.at(iter)));
◆ initialize() [3/3]
size_t pappso::Trace::initialize |
( |
const Trace & |
other | ) |
|
◆ makeTraceCstSPtr()
Definition at line 488 of file trace.cpp.
490 return std::make_shared<const Trace>(*
this);
◆ makeTraceSPtr()
TraceSPtr pappso::Trace::makeTraceSPtr |
( |
| ) |
const |
Definition at line 481 of file trace.cpp.
483 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 655 of file trace.cpp.
657 auto dataPoint = std::max_element(
658 begin(), end(), [](
const DataPoint &a,
const DataPoint &b) {
662 if(dataPoint == end())
664 throw ExceptionOutOfRange(
665 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 636 of file trace.cpp.
638 auto dataPoint = std::min_element(
639 begin(), end(), [](
const DataPoint &a,
const DataPoint &b) {
643 if(dataPoint == end())
645 throw ExceptionOutOfRange(
646 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 464 of file trace.cpp.
466 assign(other.begin(), other.end());
◆ operator=() [2/2]
Definition at line 473 of file trace.cpp.
475 vector<DataPoint>::operator=(std::move(other));
◆ sortX()
void pappso::Trace::sortX |
( |
| ) |
|
◆ sumY() [1/2]
◆ sumY() [2/2]
pappso_double pappso::Trace::sumY |
( |
double |
mzStart, |
|
|
double |
mzEnd |
|
) |
| const |
◆ toMap()
Definition at line 519 of file trace.cpp.
521 std::map<pappso_double, pappso_double> map;
523 std::pair<std::map<pappso_double, pappso_double>::iterator,
bool> ret;
525 for(
auto &&dataPoint : *
this)
528 std::pair<pappso_double, pappso_double>(dataPoint.x, dataPoint.y));
530 if(ret.second ==
false)
532 qDebug() << __FILE__ <<
"@" << __LINE__ << __FUNCTION__ <<
"()"
533 <<
"It is odd that the Trace contains multiple same keys.";
536 ret.first->second += dataPoint.y;
◆ toString()
QString pappso::Trace::toString |
( |
| ) |
const |
Definition at line 786 of file trace.cpp.
791 for(
auto &&dataPoint : *
this)
793 text.append(QString(
"%1 %2\n")
794 .arg(dataPoint.x, 0,
'f', 10)
795 .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: