Loading...
Searching...
No Matches
pappso::TraceMinusCombiner Class Reference

`#include <traceminuscombiner.h>`

Inheritance diagram for pappso::TraceMinusCombiner:

## Public Member Functions

| TraceMinusCombiner ()
| TraceMinusCombiner (int decimal_places)
| TraceMinusCombiner (const TraceMinusCombiner &other)
| TraceMinusCombiner (TraceMinusCombinerCstSPtr other)
virtual | ~TraceMinusCombiner ()
virtual MapTrace & | combine (MapTrace &map_trace, const Trace &trace) const override
MapTrace & | combine (MapTrace &map_trace_out, const MapTrace &map_trace_in) const override
Public Member Functions inherited from pappso::TraceCombiner
| TraceCombiner ()
| TraceCombiner (int decimal_places)
| TraceCombiner (const TraceCombiner &other)
| TraceCombiner (TraceCombinerCstSPtr other)
virtual | ~TraceCombiner ()
Public Member Functions inherited from pappso::MassDataCombinerInterface
| MassDataCombinerInterface (int decimal_places=-1)
virtual | ~MassDataCombinerInterface ()
void | setDecimalPlaces (int value)
int | getDecimalPlaces () const
virtual MapTrace & | combine (MapTrace &map_trace, Iterator begin, Iterator end)

## Friends

class | MassSpectrumMinusCombiner

## Additional Inherited Members

Public Types inherited from pappso::MassDataCombinerInterface
using | Iterator = std::vector< const Trace * >::const_iterator
Protected Attributes inherited from pappso::MassDataCombinerInterface
int | m_decimalPlaces = -1
| Number of decimals to use for the keys (x values)

## Detailed Description

Definition at line 26 of file traceminuscombiner.h.

## Constructor & Destructor Documentation

## TraceMinusCombiner() [1/4]

pappso::TraceMinusCombiner::TraceMinusCombiner | ( |  | ) |

Definition at line 22 of file traceminuscombiner.cpp.

{
}

## TraceMinusCombiner() [2/4]

pappso::TraceMinusCombiner::TraceMinusCombiner | ( | int | decimal_places | ) |

Definition at line 27 of file traceminuscombiner.cpp.

: TraceCombiner(decimal_places)
{
}
pappso::TraceCombiner::TraceCombiner
TraceCombiner()
Definition tracecombiner.cpp:21

## TraceMinusCombiner() [3/4]

pappso::TraceMinusCombiner::TraceMinusCombiner | ( | const TraceMinusCombiner & | other | ) |

Definition at line 33 of file traceminuscombiner.cpp.

: TraceCombiner(other)
{
}

## TraceMinusCombiner() [4/4]

pappso::TraceMinusCombiner::TraceMinusCombiner | ( | TraceMinusCombinerCstSPtr | other | ) |

Definition at line 39 of file traceminuscombiner.cpp.

: TraceCombiner(other)
{
}

## ~TraceMinusCombiner()

pappso::TraceMinusCombiner::~TraceMinusCombiner | ( |  | ) |

virtual

Definition at line 45 of file traceminuscombiner.cpp.

{
}

## Member Function Documentation

## combine() [1/2]

MapTrace & pappso::TraceMinusCombiner::combine | ( | MapTrace & | map_trace,
|  | const Trace & | trace
| ) |  | const

override virtual

Implements pappso::MassDataCombinerInterface.

Definition at line 51 of file traceminuscombiner.cpp.

{
// qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << " ()"
//<< "map trace size:" << map_trace.size()
//<< "trace size:" << trace.size();
if(!trace.size())
return map_trace;
for(auto &current_data_point : trace)
{
// If the data point is 0-intensity, then do nothing!
if(!current_data_point.y)
continue;
// qDebug() << "Iterating in new trace data point:"
//<< current_data_point.toString(15);
double x = Utils::roundToDecimals(current_data_point.x, m_decimalPlaces);
std::map<double, double>::iterator map_iterator;
std::pair<std::map<pappso_double, pappso_double>::iterator, bool> result;
// qDebug() << "Willing to insert new data point:" << x << ","
//<< -current_data_point.y;
result = map_trace.insert(
std::pair<pappso_double, pappso_double>(x, -current_data_point.y));
if(result.second)
{
// qDebug() << "Inserted new data point:" << x << ","
//<< -current_data_point.y;
// The new element was inserted, we have nothing to do.
}
else
{
// qDebug() << "Going to decrement from" << result.first->second
//<< "a value of " << current_data_point.y;
// The key already existed! The item was not inserted. We need to
// update the value.
result.first->second -= current_data_point.y;
// qDebug() << "New result: " << result.first->second;
}
}
// qDebug() << "Prior to returning map_trace, its size is:" <<
// map_trace.size();
return map_trace;
}
pappso::MassDataCombinerInterface::m_decimalPlaces
int m_decimalPlaces
Number of decimals to use for the keys (x values)
Definition massdatacombinerinterface.h:44
pappso::Utils::roundToDecimals
static pappso_double roundToDecimals(pappso_double value, int decimal_places)
Definition utils.cpp:120
pappso::PeptideIonCter::x
@ x

References pappso::MassDataCombinerInterface::m_decimalPlaces, pappso::Utils::roundToDecimals(), and pappso::x.

Referenced by combine().

## combine() [2/2]

MapTrace & pappso::TraceMinusCombiner::combine | ( | MapTrace & | map_trace_out,
|  | const MapTrace & | map_trace_in
| ) |  | const

override virtual

Implements pappso::MassDataCombinerInterface.

Definition at line 110 of file traceminuscombiner.cpp.

{
// qDebug() << __FILE__ << "@" << __LINE__ << __FUNCTION__ << " ()"
//<< "map trace size:" << map_trace_out.size()
//<< "trace size:" << trace.size();
if(!map_trace_in.size())
return map_trace_out;
return combine(map_trace_out, map_trace_in.toTrace());
}
pappso::TraceMinusCombiner::combine
virtual MapTrace & combine(MapTrace &map_trace, const Trace &trace) const override
Definition traceminuscombiner.cpp:51

References combine(), and pappso::MapTrace::toTrace().

## Friends And Related Symbol Documentation

## MassSpectrumMinusCombiner

friend class MassSpectrumMinusCombiner

friend

Definition at line 29 of file traceminuscombiner.h.

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

- pappsomspp/processing/combiners/traceminuscombiner.h
- pappsomspp/processing/combiners/traceminuscombiner.cpp