libpappsomspp
Library for mass spectrometry
massspectrumcombiner.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 #include <memory>
5 
6 #include <QDataStream>
7 
8 #include "../../exportinmportconfig.h"
9 #include "../../types.h"
10 #include "../../mzrange.h"
11 
12 #include "../../massspectrum/massspectrum.h"
13 #include "../../trace/datapoint.h"
14 #include "../../trace/maptrace.h"
15 #include "../filters/filterresample.h"
17 
18 
19 namespace pappso
20 {
21 
22 
23 class MassSpectrumCombiner;
24 
25 typedef std::shared_ptr<const MassSpectrumCombiner> MassSpectrumCombinerCstSPtr;
26 typedef std::shared_ptr<MassSpectrumCombiner> MassSpectrumCombinerSPtr;
27 
28 
30 {
31 
32 
33  public:
35  MassSpectrumCombiner(std::vector<pappso_double> bins, int decimalPlaces = -1);
36  MassSpectrumCombiner(int decimal_places);
40 
41  virtual ~MassSpectrumCombiner();
42 
43  std::vector<pappso_double>::const_iterator begin() const;
44  std::vector<pappso_double>::const_iterator end() const;
45  std::vector<pappso_double>::iterator begin();
46  std::vector<pappso_double>::iterator end();
47 
48  void setBins(std::vector<pappso_double> bins);
49  const std::vector<pappso_double> &getBins() const;
50  std::size_t binCount() const;
51 
52  virtual MapTrace &combine(MapTrace &map_trace, const Trace &trace) const;
53 
54  virtual MapTrace &combine(MapTrace &map_trace_out,
55  const MapTrace &map_trace_in) const;
56 
57  protected:
58  std::vector<pappso_double> m_bins;
59 
60  std::vector<pappso_double>::iterator findBin(pappso_double mz);
61 
62  private:
63  // This function combines trace into map_trace but does not handle the
64  // situation where any filtering step was asked for. This function is called
65  // by public combine function after filtering work has occurred already. This
66  // function is the functional lowest common denominator for all the public
67  // combine functions.
69  const Trace &trace) const = 0;
70 };
71 
72 
73 } // namespace pappso
std::vector< pappso_double > m_bins
virtual MapTrace & combineNoFilteringStep(MapTrace &map_trace, const Trace &trace) const =0
MassSpectrumCombiner(const MassSpectrumCombiner &&other)
A simple container of DataPoint instances.
Definition: trace.h:132
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
std::shared_ptr< MassSpectrumCombiner > MassSpectrumCombinerSPtr
double pappso_double
A type definition for doubles.
Definition: types.h:48
std::shared_ptr< const MassSpectrumCombiner > MassSpectrumCombinerCstSPtr