Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
CentroidPeak.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2017.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg $
32 // $Authors: Markus Mueller $
33 // --------------------------------------------------------------------------
34 //
35 /*
36  * CentroidPeak.h
37  * PeakDetection
38  *
39  * Created by Markus Mueller on 10/19/06.
40  *
41  * Ported to OpenMS by Florian Zeller, florian.zeller@bsse.ethz.ch
42  * December 2010
43  *
44  */
45 
46 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_CENTROIDPEAK_H
47 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_CENTROIDPEAK_H
48 
49 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/SuperHirnConfig.h>
50 
51 #include <OpenMS/CONCEPT/Types.h>
52 
53 #include <ostream>
54 #include <cmath>
55 #include <vector>
56 
57 namespace OpenMS
58 {
59 
60  class SUPERHIRN_DLLAPI CentroidPeak
61  {
62 public:
63 
64 //static int sfCentroidWindowWidth;
65 
66  CentroidPeak();
67  CentroidPeak(double, double);
68  CentroidPeak(double, double, double);
69  CentroidPeak(const CentroidPeak &);
70  // Copy constructor
71  CentroidPeak(const CentroidPeak *);
72 
73  CentroidPeak & operator=(const CentroidPeak &);
74 
75  bool operator<(const CentroidPeak &);
76 
77  virtual ~CentroidPeak();
78 
79  // getters and setters
80  double getMass();
81  double getIntensity();
82  int getIsotopIdx();
83  double getSignalToNoise();
84  double getFittedIntensity();
85  double getOrgIntensity();
86  std::string getExtraPeakInfo();
87  double getRetentionTime();
88 
89  void setMass(double pMass);
90  void setIntensity(double pIntensity);
91  void setIsotopIdx(double pIsotopIdx);
92  void setSignalToNoise(double in);
93  void setFittedIntensity(double pFittedIntensity);
94  void setOrgIntensity(double pOrgIntensity);
95  void setExtraPeakInfo(std::string in);
96  void setRetentionTime(double in);
97 
98  void show_info();
99  void subtractIntensity(double);
100 
101 protected:
102 
104  double mass_;
105  double intensity_;
108  double tr_;
110  std::string extraPeakInfo_;
111  };
112 
113  // Class for deconvoluted isotopic patterns
114  class DeconvPeak :
115  public CentroidPeak
116  {
117 public:
118 
119  DeconvPeak();
120  DeconvPeak(double, double, int, int, double, double);
121  DeconvPeak(const DeconvPeak &);
122  DeconvPeak(const DeconvPeak *);
123 
124  DeconvPeak & operator=(const DeconvPeak &);
125 
126  virtual ~DeconvPeak();
127 
128  // shows the info of the peak:
129  void show_info();
130 
131  // getters and setters
132  int getCharge();
133  int getNrIsotopes();
134  double getC13MassError();
135  double getScore();
136  std::vector<CentroidPeak> getIsotopicPeaks();
137 
138  void setCharge(int pCharge);
139  void setNrIsotopes(int pNrIsotopes);
140  void setC13MassError(double pC13MassError);
141  void setScore(double pScore);
142  void setIsotopicPeaks(std::vector<CentroidPeak> pIsotopicPeaks);
143 
144 protected:
145 
146  int charge_;
149  double score_;
150  std::vector<CentroidPeak> isotopicPeaks_;
151  };
152 
153  // stream operators
154  std::ostream & operator<<(std::ostream &, CentroidPeak &);
155  std::ostream & operator<<(std::ostream &, DeconvPeak &);
156 
157  // inline implementation of getters and setters
158 
159  inline double CentroidPeak::getMass()
160  {
161  return mass_;
162  }
163 
165  {
166  return intensity_;
167  }
168 
170  {
171  return isotopIdx_;
172  }
173 
175  {
176  return signalToNoise_;
177  }
178 
180  {
181  return fittedIntensity_;
182  }
183 
185  {
186  return orgIntensity_;
187  }
188 
189  inline std::string CentroidPeak::getExtraPeakInfo()
190  {
191  return extraPeakInfo_;
192  }
193 
195  {
196  return tr_;
197  }
198 
199  inline void CentroidPeak::setMass(double pMass)
200  {
201  mass_ = pMass;
202  }
203 
204  inline void CentroidPeak::setIntensity(double pIntensity)
205  {
206  intensity_ = pIntensity;
207  }
208 
209  inline void CentroidPeak::setIsotopIdx(double pIsotopIdx)
210  {
211  isotopIdx_ = (int) pIsotopIdx;
212  }
213 
214  inline void CentroidPeak::setSignalToNoise(double in)
215  {
216  signalToNoise_ = in;
217  }
218 
219  inline void CentroidPeak::setFittedIntensity(double pFittedIntensity)
220  {
221  fittedIntensity_ = pFittedIntensity;
222  }
223 
224  inline void CentroidPeak::setOrgIntensity(double pOrgIntensity)
225  {
226  orgIntensity_ = pOrgIntensity;
227  }
228 
229  inline void CentroidPeak::setExtraPeakInfo(std::string in)
230  {
231  extraPeakInfo_ = in;
232  }
233 
234  inline void CentroidPeak::setRetentionTime(double in)
235  {
236  tr_ = in;
237  }
238 
239  //
240 
242  {
243  return charge_;
244  }
245 
247  {
248  return nrIsotopes_;
249  }
250 
252  {
253  return c13MassError_;
254  }
255 
256  inline double DeconvPeak::getScore()
257  {
258  return score_;
259  }
260 
261  inline std::vector<CentroidPeak> DeconvPeak::getIsotopicPeaks()
262  {
263  return isotopicPeaks_;
264  }
265 
266  inline void DeconvPeak::setCharge(int pCharge)
267  {
268  charge_ = pCharge;
269  }
270 
271  inline void DeconvPeak::setC13MassError(double pC13MassError)
272  {
273  c13MassError_ = pC13MassError;
274  }
275 
276  inline void DeconvPeak::setNrIsotopes(int pNrIsotopes)
277  {
278  nrIsotopes_ = pNrIsotopes;
279  }
280 
281  inline void DeconvPeak::setScore(double pScore)
282  {
283  score_ = pScore;
284  }
285 
286  inline void DeconvPeak::setIsotopicPeaks(std::vector<CentroidPeak> pIsotopicPeaks)
287  {
288  isotopicPeaks_ = pIsotopicPeaks;
289  }
290 
291 } // ns
292 
293 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_CENTROIDPEAK_H
double mass_
Definition: CentroidPeak.h:104
double getSignalToNoise()
Definition: CentroidPeak.h:174
void setIsotopIdx(double pIsotopIdx)
Definition: CentroidPeak.h:209
double getRetentionTime()
Definition: CentroidPeak.h:194
int getIsotopIdx()
Definition: CentroidPeak.h:169
double getFittedIntensity()
Definition: CentroidPeak.h:179
void setIntensity(double pIntensity)
Definition: CentroidPeak.h:204
int getCharge()
Definition: CentroidPeak.h:241
int charge_
Definition: CentroidPeak.h:146
double getMass()
Definition: CentroidPeak.h:159
void setFittedIntensity(double pFittedIntensity)
Definition: CentroidPeak.h:219
double getC13MassError()
Definition: CentroidPeak.h:251
void setCharge(int pCharge)
Definition: CentroidPeak.h:266
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
void setC13MassError(double pC13MassError)
Definition: CentroidPeak.h:271
bool operator<(const MultiplexDeltaMasses &dm1, const MultiplexDeltaMasses &dm2)
int getNrIsotopes()
Definition: CentroidPeak.h:246
std::string getExtraPeakInfo()
Definition: CentroidPeak.h:189
double fittedIntensity_
Definition: CentroidPeak.h:106
double getScore()
Definition: CentroidPeak.h:256
void setMass(double pMass)
Definition: CentroidPeak.h:199
int nrIsotopes_
Definition: CentroidPeak.h:147
void setExtraPeakInfo(std::string in)
Definition: CentroidPeak.h:229
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
double tr_
Definition: CentroidPeak.h:108
double orgIntensity_
Definition: CentroidPeak.h:107
int isotopIdx_
Definition: CentroidPeak.h:103
std::vector< CentroidPeak > isotopicPeaks_
Definition: CentroidPeak.h:150
double c13MassError_
Definition: CentroidPeak.h:148
double intensity_
Definition: CentroidPeak.h:105
void setSignalToNoise(double in)
Definition: CentroidPeak.h:214
void setRetentionTime(double in)
Definition: CentroidPeak.h:234
double signalToNoise_
Definition: CentroidPeak.h:109
std::vector< CentroidPeak > getIsotopicPeaks()
Definition: CentroidPeak.h:261
std::string extraPeakInfo_
Definition: CentroidPeak.h:110
void setNrIsotopes(int pNrIsotopes)
Definition: CentroidPeak.h:276
void setScore(double pScore)
Definition: CentroidPeak.h:281
void setOrgIntensity(double pOrgIntensity)
Definition: CentroidPeak.h:224
Definition: CentroidPeak.h:60
double score_
Definition: CentroidPeak.h:149
double getIntensity()
Definition: CentroidPeak.h:164
void setIsotopicPeaks(std::vector< CentroidPeak > pIsotopicPeaks)
Definition: CentroidPeak.h:286
double getOrgIntensity()
Definition: CentroidPeak.h:184
Definition: CentroidPeak.h:114

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:21:59 using doxygen 1.8.13