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

`#include <massspectrumcombiner.h>`

Inheritance diagram for pappso::MassSpectrumCombiner:

## Public Member Functions

| MassSpectrumCombiner ()
| Construct an uninitialized instance.
| MassSpectrumCombiner (int decimal_places)
| MassSpectrumCombiner (std::vector< pappso_double > bins, int decimalPlaces=-1)
| MassSpectrumCombiner (MassSpectrumCombinerCstSPtr other)
| MassSpectrumCombiner (const MassSpectrumCombiner &other)
| MassSpectrumCombiner (const MassSpectrumCombiner &&other)
virtual | ~MassSpectrumCombiner ()
| Destruct the instance.
void | setBins (std::vector< pappso_double > bins)
const std::vector< pappso_double > & | getBins () const
std::size_t | binCount () const
QString | binsAsString () const
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)
virtual MapTrace & | combine (MapTrace &map_trace, const Trace &trace) const =0
virtual MapTrace & | combine (MapTrace &map_trace_out, const MapTrace &map_trace_in) const =0

## Protected Member Functions

std::vector< pappso_double >::iterator | findBin (pappso_double mz)
| Find the bin that will contain `mz`.

## Protected Attributes

std::vector< pappso_double > | m_bins
Protected Attributes inherited from pappso::MassDataCombinerInterface
int | m_decimalPlaces = -1
| Number of decimals to use for the keys (x values)

## Additional Inherited Members

Public Types inherited from pappso::MassDataCombinerInterface
using | Iterator = std::vector< const Trace * >::const_iterator

## Detailed Description

Definition at line 28 of file massspectrumcombiner.h.

## Constructor & Destructor Documentation

## MassSpectrumCombiner() [1/6]

pappso::MassSpectrumCombiner::MassSpectrumCombiner | ( |  | ) |

Construct an uninitialized instance.

Definition at line 28 of file massspectrumcombiner.cpp.

{
}

## MassSpectrumCombiner() [2/6]

pappso::MassSpectrumCombiner::MassSpectrumCombiner | ( | int | decimal_places | ) |

Definition at line 33 of file massspectrumcombiner.cpp.

: MassDataCombinerInterface(decimal_places)
{
}
pappso::MassDataCombinerInterface::MassDataCombinerInterface
MassDataCombinerInterface(int decimal_places=-1)
Definition massdatacombinerinterface.cpp:19

## MassSpectrumCombiner() [3/6]

pappso::MassSpectrumCombiner::MassSpectrumCombiner | ( | std::vector< pappso_double > | bins,
|  | int | decimalPlaces = `-1`
| ) |  |

Definition at line 39 of file massspectrumcombiner.cpp.

: MassDataCombinerInterface(decimalPlaces)
{
m_bins.assign(bins.begin(), bins.end());
}
pappso::MassSpectrumCombiner::m_bins
std::vector< pappso_double > m_bins
Definition massspectrumcombiner.h:48

References m_bins.

## MassSpectrumCombiner() [4/6]

pappso::MassSpectrumCombiner::MassSpectrumCombiner | ( | MassSpectrumCombinerCstSPtr | other | ) |

Definition at line 67 of file massspectrumcombiner.cpp.

: MassDataCombinerInterface(other->m_decimalPlaces)
{
m_bins.assign(other->m_bins.begin(), other->m_bins.end());
}

References m_bins.

## MassSpectrumCombiner() [5/6]

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

Definition at line 47 of file massspectrumcombiner.cpp.

: MassDataCombinerInterface(other.m_decimalPlaces)
{
m_bins.assign(other.m_bins.begin(), other.m_bins.end());
// QString debug_string = QString(
//"Number of bins: %1\n"
//"First bins: %2 %3 %4 -- Last bins: %5 %6 %7\n")
//.arg(m_bins.size())
//.arg(m_bins[0], 0, 'f', 6)
//.arg(m_bins[1], 0, 'f', 6)
//.arg(m_bins[2], 0, 'f', 6)
//.arg(m_bins[m_bins.size() - 3], 0, 'f', 6)
//.arg(m_bins[m_bins.size() - 2], 0, 'f', 6)
//.arg(m_bins[m_bins.size() - 1], 0, 'f', 6);
// qDebug().noquote() << debug_string;
}

References m_bins.

## MassSpectrumCombiner() [6/6]

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

## ~MassSpectrumCombiner()

pappso::MassSpectrumCombiner::~MassSpectrumCombiner | ( |  | ) |

virtual

Destruct the instance.

Definition at line 75 of file massspectrumcombiner.cpp.

{
m_bins.clear();
}

References m_bins.

## Member Function Documentation

## binCount()

std::size_t pappso::MassSpectrumCombiner::binCount | ( |  | ) | const

Definition at line 109 of file massspectrumcombiner.cpp.

{
return m_bins.size();
}

References m_bins.

## binsAsString()

QString pappso::MassSpectrumCombiner::binsAsString | ( |  | ) | const

Definition at line 126 of file massspectrumcombiner.cpp.

{
QString text;
for(auto &bin : m_bins)
text += QString("%1\n").arg(bin, 0, 'f', 6);
text += "\n";
return text;
}

References m_bins.

## findBin()

std::vector< pappso_double >::iterator pappso::MassSpectrumCombiner::findBin | ( | pappso_double | mz | ) |

protected

Find the bin that will contain `mz`.

Definition at line 117 of file massspectrumcombiner.cpp.

{
return std::find_if(m_bins.begin(), m_bins.end(), [mz](pappso_double bin) {
return (mz <= bin);
});
}
pappso::PrecisionUnit::mz
@ mz
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition types.h:50

References m_bins, and pappso::mz.

## getBins()

const std::vector< pappso_double > & pappso::MassSpectrumCombiner::getBins | ( |  | ) | const

Definition at line 102 of file massspectrumcombiner.cpp.

{
return m_bins;
}

References m_bins.

## setBins()

void pappso::MassSpectrumCombiner::setBins | ( | std::vector< pappso_double > | bins | ) |

Definition at line 82 of file massspectrumcombiner.cpp.

{
m_bins.assign(bins.begin(), bins.end());
// QString debug_string = QString(
//"Number of bins: %1\n"
//"First bins: %2 %3 %4 -- Last bins: %5 %6 %7\n")
//.arg(m_bins.size())
//.arg(m_bins[0], 0, 'f', 6)
//.arg(m_bins[1], 0, 'f', 6)
//.arg(m_bins[2], 0, 'f', 6)
//.arg(m_bins[m_bins.size() - 3], 0, 'f', 6)
//.arg(m_bins[m_bins.size() - 2], 0, 'f', 6)
//.arg(m_bins[m_bins.size() - 1], 0, 'f', 6);
// qDebug().noquote() << debug_string;
}

References m_bins.

## Member Data Documentation

## m_bins

std::vector<pappso_double> pappso::MassSpectrumCombiner::m_bins

protected

Definition at line 48 of file massspectrumcombiner.h.

Referenced by MassSpectrumCombiner(), MassSpectrumCombiner(), MassSpectrumCombiner(), ~MassSpectrumCombiner(), binCount(), binsAsString(), pappso::MassSpectrumMinusCombiner::combine(), pappso::MassSpectrumPlusCombiner::combine(), findBin(), getBins(), pappso::MassSpectrumMinusCombiner::operator=(), pappso::MassSpectrumPlusCombiner::operator=(), and setBins().

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

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