libpappsomspp
Library for mass spectrometry
pappso::MassSpectrumCombiner Class Reference

#include <massspectrumcombiner.h>

Inheritance diagram for pappso::MassSpectrumCombiner:
pappso::MassDataCombinerInterface pappso::MassSpectrumMinusCombiner pappso::MassSpectrumPlusCombiner

Public Member Functions

 MassSpectrumCombiner ()
 Construct an uninitialized instance. More...
 
 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. More...
 
void setBins (std::vector< pappso_double > bins)
 
const std::vector< pappso_double > & getBins () const
 
std::size_t binCount () const
 
- Public Member Functions inherited from pappso::MassDataCombinerInterface
 MassDataCombinerInterface (int decimal_places=-1)
 
virtual ~MassDataCombinerInterface ()
 
void setDecimalPlaces (int value)
 
int getDecimalPlaces () const
 
virtual MapTracecombine (MapTrace &map_trace, Iterator begin, Iterator end)
 
virtual MapTracecombine (MapTrace &map_trace, const Trace &trace) const =0
 
virtual MapTracecombine (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. More...
 

Protected Attributes

std::vector< pappso_doublem_bins
 
- Protected Attributes inherited from pappso::MassDataCombinerInterface
int m_decimalPlaces = -1
 Number of decimals to use for the keys (x values) More...
 

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.

29 {
30 }

◆ MassSpectrumCombiner() [2/6]

pappso::MassSpectrumCombiner::MassSpectrumCombiner ( int  decimal_places)

Definition at line 33 of file massspectrumcombiner.cpp.

34  : MassDataCombinerInterface(decimal_places)
35 {
36 }

◆ MassSpectrumCombiner() [3/6]

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

Definition at line 39 of file massspectrumcombiner.cpp.

41  : MassDataCombinerInterface(decimalPlaces)
42 {
43  m_bins.assign(bins.begin(), bins.end());
44 }
std::vector< pappso_double > m_bins

References m_bins.

◆ MassSpectrumCombiner() [4/6]

pappso::MassSpectrumCombiner::MassSpectrumCombiner ( MassSpectrumCombinerCstSPtr  other)

Definition at line 54 of file massspectrumcombiner.cpp.

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

References m_bins.

◆ MassSpectrumCombiner() [5/6]

pappso::MassSpectrumCombiner::MassSpectrumCombiner ( const MassSpectrumCombiner other)

Definition at line 47 of file massspectrumcombiner.cpp.

48  : MassDataCombinerInterface(other.m_decimalPlaces)
49 {
50  m_bins.assign(other.m_bins.begin(), other.m_bins.end());
51 }

References m_bins.

◆ MassSpectrumCombiner() [6/6]

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

◆ ~MassSpectrumCombiner()

pappso::MassSpectrumCombiner::~MassSpectrumCombiner ( )
virtual

Destruct the instance.

Definition at line 62 of file massspectrumcombiner.cpp.

63 {
64  m_bins.clear();
65 }

References m_bins.

Member Function Documentation

◆ binCount()

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

Definition at line 87 of file massspectrumcombiner.cpp.

88 {
89  return m_bins.size();
90 }

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 95 of file massspectrumcombiner.cpp.

96 {
97  return std::find_if(m_bins.begin(), m_bins.end(), [mz](pappso_double bin) {
98  return (mz <= bin);
99  });
100 }
double pappso_double
A type definition for doubles.
Definition: types.h:48

References m_bins, and pappso::mz.

◆ getBins()

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

Definition at line 80 of file massspectrumcombiner.cpp.

81 {
82  return m_bins;
83 }

References m_bins.

◆ setBins()

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

Definition at line 69 of file massspectrumcombiner.cpp.

70 {
71  m_bins.assign(bins.begin(), bins.end());
72 
73  // qDebug() << "After bins assignment, local bins are of this size:"
74  //<< m_bins.size() << "Starting at:" << m_bins.front()
75  //<< "and ending at:" << m_bins.back();
76 }

References m_bins.

Member Data Documentation

◆ m_bins


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