libpappsomspp
Library for mass spectrometry
tracepeak.cpp
Go to the documentation of this file.
1 
2 /*******************************************************************************
3  * Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
4  *
5  * This file is part of the PAPPSOms++ library.
6  *
7  * PAPPSOms++ is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * PAPPSOms++ is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * Contributors:
21  * Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
22  *implementation
23  ******************************************************************************/
24 
25 #include <cmath>
26 #include "tracepeak.h"
27 #include "../../trace/trace.h"
28 
29 namespace pappso
30 {
32 {
33 }
34 TracePeak::TracePeak(std::vector<DataPoint>::const_iterator it_begin,
35  std::vector<DataPoint>::const_iterator it_end)
36 {
37 
38  m_left = *it_begin;
39  m_right = *(it_end - 1);
40  m_max = *maxYDataPoint(it_begin, it_end);
41  m_area = areaTrace(it_begin, it_end);
42 }
43 
45 {
46  m_area = other.m_area;
47  m_left = other.m_left;
48  m_right = other.m_right;
49  m_max = other.m_max;
50 }
51 
53 {
54 }
55 
56 
59 {
60  return std::make_shared<const TracePeak>(*this);
61 }
62 
63 DataPoint &
65 {
66  return m_max;
67 };
68 void
70 {
71  m_max = max;
72 };
73 DataPoint &
75 {
76  return m_left;
77 };
78 void
80 {
81  m_left = left;
82 };
83 
84 DataPoint &
86 {
87  return m_right;
88 };
89 const DataPoint &
91 {
92  return m_right;
93 };
94 void
96 {
97  m_right = right;
98 };
101 {
102  return m_area;
103 };
104 void
106 {
107  m_area = area;
108 };
109 
110 bool
112 {
113  if((rt >= m_left.x) && (rt <= m_right.x))
114  {
115  return (true);
116  }
117  return (false);
118 }
119 
120 } // namespace pappso
pappso::TracePeak::getMaxXicElement
DataPoint & getMaxXicElement()
Definition: tracepeak.cpp:64
pappso::TracePeakCstSPtr
std::shared_ptr< const TracePeak > TracePeakCstSPtr
Definition: tracepeak.h:34
pappso::TracePeak::makeTracePeakCstSPtr
TracePeakCstSPtr makeTracePeakCstSPtr() const
Definition: tracepeak.cpp:58
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:48
pappso::TracePeak::setLeftBoundary
void setLeftBoundary(const DataPoint &left)
Definition: tracepeak.cpp:79
pappso::TracePeak::~TracePeak
~TracePeak()
Definition: tracepeak.cpp:52
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
pappso::DataPoint
Definition: datapoint.h:21
pappso::TracePeak::m_area
pappso_double m_area
Definition: tracepeak.h:42
pappso::areaTrace
double areaTrace(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
calculate the area of a trace
Definition: trace.cpp:240
pappso::TracePeak::getRightBoundary
DataPoint & getRightBoundary()
Definition: tracepeak.cpp:85
pappso::TracePeak::setRightBoundary
void setRightBoundary(const DataPoint &right)
Definition: tracepeak.cpp:95
pappso::TracePeak::setArea
void setArea(pappso_double area)
Definition: tracepeak.cpp:105
pappso::maxYDataPoint
std::vector< DataPoint >::const_iterator maxYDataPoint(std::vector< DataPoint >::const_iterator begin, std::vector< DataPoint >::const_iterator end)
Definition: trace.cpp:138
pappso::DataPoint::x
pappso_double x
Definition: datapoint.h:22
pappso::TracePeak::TracePeak
TracePeak()
Definition: tracepeak.cpp:31
pappso::TracePeak
Definition: tracepeak.h:40
pappso::TracePeak::setMaxXicElement
void setMaxXicElement(const DataPoint &max)
Definition: tracepeak.cpp:69
pappso::TracePeak::m_right
DataPoint m_right
Definition: tracepeak.h:45
pappso::TracePeak::getLeftBoundary
DataPoint & getLeftBoundary()
Definition: tracepeak.cpp:74
pappso::XicExtractMethod::sum
@ sum
sum of intensities
tracepeak.h
pappso::TracePeak::m_left
DataPoint m_left
Definition: tracepeak.h:44
pappso::TracePeak::getArea
pappso_double getArea() const
Definition: tracepeak.cpp:100
pappso::TracePeak::containsRt
bool containsRt(pappso::pappso_double rt) const
Definition: tracepeak.cpp:111
pappso::TracePeak::m_max
DataPoint m_max
Definition: tracepeak.h:43