libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::TraceDetectionMoulon Class Reference

#include <tracedetectionmoulon.h>

Inheritance diagram for pappso::TraceDetectionMoulon:
pappso::TraceDetectionInterface

Public Member Functions

 TraceDetectionMoulon (unsigned int smoothing_half_window_length, pappso_double tic_start, pappso_double tic_stop)
 
 TraceDetectionMoulon (const TraceDetectionMoulon &other)
 
virtual ~TraceDetectionMoulon ()
 
void setFilterMorphoMean (const FilterMorphoMean &smooth)
 
void setTicStart (double tic_start)
 
void setTicStop (double tic_stop)
 
unsigned int getSmoothingHalfEdgeWindows () const
 
pappso_double getTicStart () const
 
pappso_double getTicStop () const
 
void detect (const Trace &xic, TraceDetectionSinkInterface &sink, bool remove_peak_base) const override
 detect peaks on a trace
 

Private Attributes

FilterMorphoMean m_xicFilterSmoothing
 
pappso_double m_ticStart
 
pappso_double m_ticStop
 

Detailed Description

Definition at line 34 of file tracedetectionmoulon.h.

Constructor & Destructor Documentation

◆ TraceDetectionMoulon() [1/2]

pappso::TraceDetectionMoulon::TraceDetectionMoulon ( unsigned int smoothing_half_window_length,
pappso_double tic_start,
pappso_double tic_stop )

Definition at line 28 of file tracedetectionmoulon.cpp.

31 : m_xicFilterSmoothing(smoothing_half_window_length)
32{
33 m_ticStart = tic_start;
34 m_ticStop = tic_stop;
35}

References m_ticStart, m_ticStop, and m_xicFilterSmoothing.

Referenced by TraceDetectionMoulon().

◆ TraceDetectionMoulon() [2/2]

pappso::TraceDetectionMoulon::TraceDetectionMoulon ( const TraceDetectionMoulon & other)

Definition at line 37 of file tracedetectionmoulon.cpp.

38 : m_xicFilterSmoothing(other.m_xicFilterSmoothing)
39{
40 m_ticStart = other.m_ticStart;
41 m_ticStop = other.m_ticStop;
42}

References TraceDetectionMoulon(), m_ticStart, m_ticStop, and m_xicFilterSmoothing.

◆ ~TraceDetectionMoulon()

pappso::TraceDetectionMoulon::~TraceDetectionMoulon ( )
virtual

Definition at line 44 of file tracedetectionmoulon.cpp.

45{
46}

Member Function Documentation

◆ detect()

void pappso::TraceDetectionMoulon::detect ( const Trace & trace,
TraceDetectionSinkInterface & sink,
bool remove_peak_base ) const
overridevirtual

detect peaks on a trace

Parameters
tracethe trace to detect peaks on
sinkthe object to store peaks or stream it
remove_peak_baseif true, removes the area under the base of the peak

Implements pappso::TraceDetectionInterface.

Definition at line 85 of file tracedetectionmoulon.cpp.

88{
89
90 Trace xic_smoothed(xic);
91
92 m_xicFilterSmoothing.filter(xic_smoothed);
93
94 // detect peaks :
95 bool banked(false);
96 unsigned int nb_tic_start(0);
97
98 std::vector<DataPoint>::const_iterator it_smoothed;
99 std::vector<DataPoint>::const_iterator it, it_begin;
100
101 // TracePeak *p_current_peak = nullptr;
102
103 for(it_smoothed = xic_smoothed.begin(), it = xic.begin(); it_smoothed != xic_smoothed.end();
104 ++it_smoothed, ++it)
105 {
106
107 if((nb_tic_start == 0) && (it_begin != xic.end()) && (banked == false))
108 {
109 // delete(p_current_peak);
110 // p_current_peak = nullptr;
111 it_begin = xic.end();
112 }
113
114 if(it_smoothed->y >= m_ticStart)
115 {
116 nb_tic_start++;
117 if(it_begin == xic.end())
118 {
119 // p_current_peak = new TracePeak;
120 // p_current_peak->setLeftBoundary(*it_smoothed);
121 it_begin = it;
122 banked = false;
123 }
124 if((nb_tic_start == 2) && (banked == false))
125 {
126 banked = true;
127 }
128 }
129 else
130 {
131 nb_tic_start = 0;
132 }
133 if(it_smoothed->y <= m_ticStop)
134 {
135 if(it_begin != xic.end())
136 {
137
138 if(banked)
139 {
140 TracePeak peak(it_begin, it + 1, remove_peak_base);
141 sink.setTracePeak(peak);
142 }
143 banked = false;
144 }
145 }
146 }
147}

References m_ticStart, m_ticStop, m_xicFilterSmoothing, and pappso::TraceDetectionSinkInterface::setTracePeak().

◆ getSmoothingHalfEdgeWindows()

unsigned int pappso::TraceDetectionMoulon::getSmoothingHalfEdgeWindows ( ) const

Definition at line 67 of file tracedetectionmoulon.cpp.

68{
69 return m_xicFilterSmoothing.getHalfWindowSize();
70}

References m_xicFilterSmoothing.

◆ getTicStart()

pappso_double pappso::TraceDetectionMoulon::getTicStart ( ) const

Definition at line 73 of file tracedetectionmoulon.cpp.

74{
75 return m_ticStart;
76}

References m_ticStart.

◆ getTicStop()

pappso_double pappso::TraceDetectionMoulon::getTicStop ( ) const

Definition at line 79 of file tracedetectionmoulon.cpp.

80{
81 return m_ticStop;
82}

References m_ticStop.

◆ setFilterMorphoMean()

void pappso::TraceDetectionMoulon::setFilterMorphoMean ( const FilterMorphoMean & smooth)

Definition at line 50 of file tracedetectionmoulon.cpp.

51{
52 m_xicFilterSmoothing = smooth;
53}

References m_xicFilterSmoothing.

◆ setTicStart()

void pappso::TraceDetectionMoulon::setTicStart ( double tic_start)

Definition at line 56 of file tracedetectionmoulon.cpp.

57{
58 m_ticStart = tic_start;
59}

References m_ticStart.

◆ setTicStop()

void pappso::TraceDetectionMoulon::setTicStop ( double tic_stop)

Definition at line 61 of file tracedetectionmoulon.cpp.

62{
63 m_ticStop = tic_stop;
64}

References m_ticStop.

Member Data Documentation

◆ m_ticStart

pappso_double pappso::TraceDetectionMoulon::m_ticStart
private

◆ m_ticStop

pappso_double pappso::TraceDetectionMoulon::m_ticStop
private

◆ m_xicFilterSmoothing

FilterMorphoMean pappso::TraceDetectionMoulon::m_xicFilterSmoothing
private

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