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-2013.
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: Florian Zeller $
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/CONCEPT/Types.h>
50 
51 #include <ostream>
52 #include <cmath>
53 #include <vector>
54 
55 namespace OpenMS
56 {
57 
58  class OPENMS_DLLAPI CentroidPeak
59  {
60 public:
61 
62 //static int sfCentroidWindowWidth;
63 
64  CentroidPeak();
65  CentroidPeak(double, double);
66  CentroidPeak(double, double, double);
67  CentroidPeak(const CentroidPeak &);
68  // Copy constructor
69  CentroidPeak(const CentroidPeak *);
70 
71  CentroidPeak & operator=(const CentroidPeak &);
72 
73  bool operator<(const CentroidPeak &);
74 
75  virtual ~CentroidPeak();
76 
77  // getters and setters
78  double getMass();
79  double getIntensity();
80  int getIsotopIdx();
81  double getSignalToNoise();
82  double getFittedIntensity();
83  double getOrgIntensity();
84  std::string getExtraPeakInfo();
85  double getRetentionTime();
86 
87  void setMass(double pMass);
88  void setIntensity(double pIntensity);
89  void setIsotopIdx(double pIsotopIdx);
90  void setSignalToNoise(double in);
91  void setFittedIntensity(double pFittedIntensity);
92  void setOrgIntensity(double pOrgIntensity);
93  void setExtraPeakInfo(std::string in);
94  void setRetentionTime(double in);
95 
96  void show_info();
97  void subtractIntensity(double);
98 
99 protected:
100 
102  double mass_;
103  double intensity_;
106  double tr_;
108  std::string extraPeakInfo_;
109  };
110 
111  // Class for deconvoluted isotopic patterns
112  class DeconvPeak :
113  public CentroidPeak
114  {
115 public:
116 
117  DeconvPeak();
118  DeconvPeak(double, double, int, int, double, double);
119  DeconvPeak(const DeconvPeak &);
120  DeconvPeak(const DeconvPeak *);
121 
122  DeconvPeak & operator=(const DeconvPeak &);
123 
124  virtual ~DeconvPeak();
125 
126  // shows the info of the peak:
127  void show_info();
128 
129  // getters and setters
130  int getCharge();
131  int getNrIsotopes();
132  double getC13MassError();
133  double getScore();
134  std::vector<CentroidPeak> getIsotopicPeaks();
135 
136  void setCharge(int pCharge);
137  void setNrIsotopes(int pNrIsotopes);
138  void setC13MassError(double pC13MassError);
139  void setScore(double pScore);
140  void setIsotopicPeaks(std::vector<CentroidPeak> pIsotopicPeaks);
141 
142 protected:
143 
144  int charge_;
147  double score_;
148  std::vector<CentroidPeak> isotopicPeaks_;
149  };
150 
151  // stream operators
152  std::ostream & operator<<(std::ostream &, CentroidPeak &);
153  std::ostream & operator<<(std::ostream &, DeconvPeak &);
154 
155  // inline implementation of getters and setters
156 
157  inline double CentroidPeak::getMass()
158  {
159  return mass_;
160  }
161 
163  {
164  return intensity_;
165  }
166 
168  {
169  return isotopIdx_;
170  }
171 
173  {
174  return signalToNoise_;
175  }
176 
178  {
179  return fittedIntensity_;
180  }
181 
183  {
184  return orgIntensity_;
185  }
186 
187  inline std::string CentroidPeak::getExtraPeakInfo()
188  {
189  return extraPeakInfo_;
190  }
191 
193  {
194  return tr_;
195  }
196 
197  inline void CentroidPeak::setMass(double pMass)
198  {
199  mass_ = pMass;
200  }
201 
202  inline void CentroidPeak::setIntensity(double pIntensity)
203  {
204  intensity_ = pIntensity;
205  }
206 
207  inline void CentroidPeak::setIsotopIdx(double pIsotopIdx)
208  {
209  isotopIdx_ = (int) pIsotopIdx;
210  }
211 
212  inline void CentroidPeak::setSignalToNoise(double in)
213  {
214  signalToNoise_ = in;
215  }
216 
217  inline void CentroidPeak::setFittedIntensity(double pFittedIntensity)
218  {
219  fittedIntensity_ = pFittedIntensity;
220  }
221 
222  inline void CentroidPeak::setOrgIntensity(double pOrgIntensity)
223  {
224  orgIntensity_ = pOrgIntensity;
225  }
226 
227  inline void CentroidPeak::setExtraPeakInfo(std::string in)
228  {
229  extraPeakInfo_ = in;
230  }
231 
232  inline void CentroidPeak::setRetentionTime(double in)
233  {
234  tr_ = in;
235  }
236 
237  //
238 
240  {
241  return charge_;
242  }
243 
245  {
246  return nrIsotopes_;
247  }
248 
250  {
251  return c13MassError_;
252  }
253 
254  inline double DeconvPeak::getScore()
255  {
256  return score_;
257  }
258 
259  inline std::vector<CentroidPeak> DeconvPeak::getIsotopicPeaks()
260  {
261  return isotopicPeaks_;
262  }
263 
264  inline void DeconvPeak::setCharge(int pCharge)
265  {
266  charge_ = pCharge;
267  }
268 
269  inline void DeconvPeak::setC13MassError(double pC13MassError)
270  {
271  c13MassError_ = pC13MassError;
272  }
273 
274  inline void DeconvPeak::setNrIsotopes(int pNrIsotopes)
275  {
276  nrIsotopes_ = pNrIsotopes;
277  }
278 
279  inline void DeconvPeak::setScore(double pScore)
280  {
281  score_ = pScore;
282  }
283 
284  inline void DeconvPeak::setIsotopicPeaks(std::vector<CentroidPeak> pIsotopicPeaks)
285  {
286  isotopicPeaks_ = pIsotopicPeaks;
287  }
288 
289 } // ns
290 
291 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_CENTROIDPEAK_H
double mass_
Definition: CentroidPeak.h:102
double getSignalToNoise()
Definition: CentroidPeak.h:172
void setIsotopIdx(double pIsotopIdx)
Definition: CentroidPeak.h:207
double getRetentionTime()
Definition: CentroidPeak.h:192
int getIsotopIdx()
Definition: CentroidPeak.h:167
double getFittedIntensity()
Definition: CentroidPeak.h:177
void setIntensity(double pIntensity)
Definition: CentroidPeak.h:202
int getCharge()
Definition: CentroidPeak.h:239
int charge_
Definition: CentroidPeak.h:144
std::ostream & operator<<(std::ostream &os, const ItraqQuantifier::ItraqQuantifierStats &stats)
double getMass()
Definition: CentroidPeak.h:157
void setFittedIntensity(double pFittedIntensity)
Definition: CentroidPeak.h:217
double getC13MassError()
Definition: CentroidPeak.h:249
void setCharge(int pCharge)
Definition: CentroidPeak.h:264
void setC13MassError(double pC13MassError)
Definition: CentroidPeak.h:269
virtual ~DeconvPeak()
int getNrIsotopes()
Definition: CentroidPeak.h:244
std::string getExtraPeakInfo()
Definition: CentroidPeak.h:187
double fittedIntensity_
Definition: CentroidPeak.h:104
double getScore()
Definition: CentroidPeak.h:254
void setMass(double pMass)
Definition: CentroidPeak.h:197
int nrIsotopes_
Definition: CentroidPeak.h:145
void setExtraPeakInfo(std::string in)
Definition: CentroidPeak.h:227
DeconvPeak & operator=(const DeconvPeak &)
double tr_
Definition: CentroidPeak.h:106
double orgIntensity_
Definition: CentroidPeak.h:105
int isotopIdx_
Definition: CentroidPeak.h:101
std::vector< CentroidPeak > isotopicPeaks_
Definition: CentroidPeak.h:148
double c13MassError_
Definition: CentroidPeak.h:146
double intensity_
Definition: CentroidPeak.h:103
void setSignalToNoise(double in)
Definition: CentroidPeak.h:212
void setRetentionTime(double in)
Definition: CentroidPeak.h:232
double signalToNoise_
Definition: CentroidPeak.h:107
std::vector< CentroidPeak > getIsotopicPeaks()
Definition: CentroidPeak.h:259
std::string extraPeakInfo_
Definition: CentroidPeak.h:108
void setNrIsotopes(int pNrIsotopes)
Definition: CentroidPeak.h:274
void setScore(double pScore)
Definition: CentroidPeak.h:279
void setOrgIntensity(double pOrgIntensity)
Definition: CentroidPeak.h:222
Definition: CentroidPeak.h:58
double score_
Definition: CentroidPeak.h:147
double getIntensity()
Definition: CentroidPeak.h:162
void setIsotopicPeaks(std::vector< CentroidPeak > pIsotopicPeaks)
Definition: CentroidPeak.h:284
double getOrgIntensity()
Definition: CentroidPeak.h:182
Definition: CentroidPeak.h:112

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:11 using doxygen 1.8.5