Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
LCElutionPeak.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: Lukas Mueller, Markus Mueller $
33 // --------------------------------------------------------------------------
34 //
36 //
37 // PEAK DETECTION OF FOURIER TRANSFORME MS INSTRUMENT DATA
38 //
39 // written by Markus Mueller, markus.mueller@imsb.biol.ethz.ch
40 // and Lukas Mueller, Lukas.Mueller@imsb.biol.ethz.ch
41 // October 2005
42 //
43 // Ported to OpenMS by Florian Zeller, florian.zeller@bsse.ethz.ch
44 // December 2010
45 //
46 // Group of Prof. Ruedi Aebersold, IMSB, ETH Hoenggerberg, Zurich
47 //
48 //
49 
50 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCELUTIONPEAK_H
51 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCELUTIONPEAK_H
52 
53 #include <vector>
54 #include <map>
56 
57 namespace OpenMS
58 {
59 
60  typedef std::multimap<int, MSPeak> elution_peak;
61  typedef std::vector<elution_peak> MZ_series;
62  typedef std::vector<elution_peak>::iterator MZ_series_ITERATOR;
63  typedef std::multimap<int, MSPeak>::iterator SIGNAL_iterator;
64 
65  class OPENMS_DLLAPI LCElutionPeak
66  {
67 
69  // declaration of the private members:
70 
71 private:
72 
73  // isotopic pattern:
77  double fIsotopMass;
78 
79 protected:
80 
81  double fMonoMass;
82  double fVolume;
83  int fCharge;
88  double fRT;
89  double fStartTR;
90  double fEndTR;
91  double fpeak_area;
95 
96  std::string elutionPeakExtraInfo;
97 
98  // the raw signals assigned to this peak
99  std::multimap<int, MSPeak> intens_signals;
100  //multimap<int, MSPeak> raw_intens_signals;
101  std::multimap<int, int> CHRG_MAP;
102 
104  // declaration of the public members:
105 
106 public:
107 
108  // parameters to debug a ceratain mass range
109  static double DEBUG_MASS_START;
110  static double DEBUG_MASS_END;
111 
112  // cut off, where everything small than this precentile of the
113  // apex is discarded
114  // static float intensity_apex_percentil_cutoff;
115 
116  // resolution of the retention time, for peak area copmuting:
117  // static float TR_RESOLUTION;
118 
119  // class destructor
120  ~LCElutionPeak();
121 
122  // class constructor
123  LCElutionPeak();
124  // class constructor
126  // class copy constructor
127  LCElutionPeak(const LCElutionPeak &);
128  // constructor for the object feature:
129  LCElutionPeak(const LCElutionPeak *);
130 
132  // Analyze the LC elution peak
134  {
135 
136  if (get_nb_ms_peaks() > 1)
137  {
138 
139  CHRG_MAP.clear();
140 
141  // determine the intensity background baseline based on S/N
142  // value:
143  setSNIntensityThreshold();
144 
145  // Compute a varietiy of parameters for the LC elution peak
146  computeLCElutionPeakParameters();
147 
148  // define parameters such as chrg, score
149  compute_CHRG();
150 
151  // create the consensus pattern:
152  createConsensIsotopPattern();
153  }
154  else
155  {
156  defineLCElutionPeakParametersFromMSPeak();
157  }
158  }
159 
161  // determine the intensity background baseline based on S/N
162  // value:
163  void setSNIntensityThreshold();
164 
166  // Compute a varietiy of parameters for the LC elution peak
167  void computeLCElutionPeakParameters();
168 
169  // removes background peaks and computes the total peak area:
170  // void compute_LC_peak_area();
171  // computes the area of between 2 peaks:
172  double compute_delta_area(double, double, double, double);
173  // define the apex into the elution profile::
174  // void define_apex();
175  // removes peaks which have lower intensity than x percentile
176  // of the apex:
177  void remove_background_peak();
178  // compute the charge state of the LC peak
179  void compute_CHRG();
180  // compute the score of the LC peak:
181  //void compute_SCORE_and_SN();
182  // define all required peak parameters from a single MS peak:
183  void defineLCElutionPeakParametersFromMSPeak();
185 
187  // print all monositopic peak cluster along the LC profile:
188  void createConsensIsotopPattern();
189 
190  // print the elution profile from a peak:
191  void print_profile(std::ofstream *);
192  // find the closest existing mz peak in the elution profile:
193  MSPeak * find_true_peak(float);
194  // print the elution profile from a peak:
195  void show_info();
196 
198  // overload operators:
199  LCElutionPeak & operator=(const LCElutionPeak &);
200  LCElutionPeak & operator<=(const LCElutionPeak &);
201  LCElutionPeak & operator>=(const LCElutionPeak &);
202  LCElutionPeak & operator<(const LCElutionPeak &);
203  LCElutionPeak & operator>(const LCElutionPeak &);
204 
206  // print all monositopic peak cluster along the LC profile:
207  //void printIsotopClusters();
208  // print the consensus isotope pattern:
209  //void printConsensIsotopPattern();
210 
211  void setElutionPeakExtraInfo(std::string in)
212  {
213  elutionPeakExtraInfo = in;
214  }
215 
217  {
218  return elutionPeakExtraInfo;
219  }
220 
222  // start here all the get / set
223  // function to access the
224  // variables of the class
225 
227  // access signal_intens map:
229  {
230  return intens_signals.begin();
231  }
232 
234  {
235  return intens_signals.end();
236  }
237 
239  // access the raw signal intens map:
240  //SIGNAL_iterator get_raw_signal_list_start(){return raw_intens_signals.begin();};
241  //SIGNAL_iterator get_raw_signal_list_end(){return raw_intens_signals.end();};
242 
243  // update the retention time by the current tmp_scan_apex:
244  void set_apex_retention_time(double IN)
245  {
246  fRT = IN;
247  }
248 
249  // to update the list of score and charge state:
251  {
252  std::multimap<int, int>::iterator T = CHRG_MAP.find(IN->get_charge_state());
253  if (T == CHRG_MAP.end())
254  {
255  CHRG_MAP.insert(std::make_pair(IN->get_charge_state(), 1));
256  }
257  else
258  {
259  (*T).second++;
260  }
261  }
262 
264  // get scan apex:
266  {
267  return fScanNumberApex;
268  }
269 
271  {
272  return fapex_intensity;
273  }
274 
276  {
277  return fRT;
278  }
279 
280  double get_apex_MZ()
281  {
282  return get_MZ(get_scan_apex());
283  }
284 
286  // get an intensity of a ms_peak
287  float get_intensity(int IN)
288  {
289  return (*(intens_signals.find(IN))).second.get_intensity();
290  }
291 
292  // get the original M/Z of a ms_peak
293  double get_MZ(int);
294 
296  // get the total peak area:
298  {
299  return fpeak_area;
300  }
301 
303  // get start / end scan:
305  {
306  return fScanNumberStart;
307  }
308 
310  {
311  return fScanNumberEnd;
312  }
313 
314  void set_start_retention_time(double IN)
315  {
316  fStartTR = IN;
317  }
318 
320  {
321  return fStartTR;
322  }
323 
324  void set_end_retention_time(double IN)
325  {
326  fEndTR = IN;
327  }
328 
330  {
331  return fEndTR;
332  }
333 
335  // get number of peaks in the elution profile:
337  {
338  return (int) intens_signals.size();
339  }
340 
342  // access teh charge state of the LC elutino peak:
344  {
345  return fCharge;
346  }
347 
349  // get signal to noise ratio:
351  {
352  return fSignalToNoise;
353  }
354 
356  {
357  return fSNIntensityThreshold;
358  }
359 
360  };
361 
362 } // ns
363 
364 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCELUTIONPEAK_H
static double DEBUG_MASS_END
Definition: LCElutionPeak.h:110
void update_CHRGMAP(MSPeak *IN)
Definition: LCElutionPeak.h:250
void set_end_retention_time(double IN)
Definition: LCElutionPeak.h:324
SIGNAL_iterator get_signal_list_end()
Definition: LCElutionPeak.h:233
double getSignalToNoise()
Definition: LCElutionPeak.h:350
int fScanNumberApex
Definition: LCElutionPeak.h:85
double get_end_retention_time()
Definition: LCElutionPeak.h:329
double fpeak_area
Definition: LCElutionPeak.h:91
double getSignalToNoiseBackground()
Definition: LCElutionPeak.h:355
int fCharge
Definition: LCElutionPeak.h:83
int fScanNumberStart
Definition: LCElutionPeak.h:84
double fapex_intensity
Definition: LCElutionPeak.h:87
void set_start_retention_time(double IN)
Definition: LCElutionPeak.h:314
float get_intensity(int IN)
Definition: LCElutionPeak.h:287
void setElutionPeakExtraInfo(std::string in)
Definition: LCElutionPeak.h:211
int get_start_scan()
Definition: LCElutionPeak.h:304
Definition: ConsensusIsotopePattern.h:56
double fSNIntensityThreshold
Definition: LCElutionPeak.h:93
int get_charge_state()
Definition: LCElutionPeak.h:343
unsigned int get_charge_state()
Definition: MSPeak.h:221
std::multimap< int, int > CHRG_MAP
Definition: LCElutionPeak.h:101
double get_apex_MZ()
Definition: LCElutionPeak.h:280
std::string elutionPeakExtraInfo
Definition: LCElutionPeak.h:96
void set_apex_retention_time(double IN)
Definition: LCElutionPeak.h:244
double fRT
Definition: LCElutionPeak.h:88
std::multimap< int, MSPeak > intens_signals
Definition: LCElutionPeak.h:99
double get_start_retention_time()
Definition: LCElutionPeak.h:319
double fEndTR
Definition: LCElutionPeak.h:90
double get_apex_retention_time()
Definition: LCElutionPeak.h:275
double get_apex_intensity()
Definition: LCElutionPeak.h:270
Definition: MSPeak.h:64
SIGNAL_iterator get_signal_list_start()
Definition: LCElutionPeak.h:228
static double DEBUG_MASS_START
Definition: LCElutionPeak.h:109
double get_total_peak_area()
Definition: LCElutionPeak.h:297
std::vector< elution_peak > MZ_series
Definition: LCElutionPeak.h:61
double f_observed_Mass
Definition: LCElutionPeak.h:76
double fMonoMass
Definition: LCElutionPeak.h:81
std::string getElutionPeakExtraInfo()
Definition: LCElutionPeak.h:216
MSPeak * APEX
Definition: LCElutionPeak.h:94
double fSignalToNoise
Definition: LCElutionPeak.h:92
ConsensusIsotopePattern * isotopePattern
Definition: LCElutionPeak.h:74
int fNrIsotopes
Definition: LCElutionPeak.h:75
int get_scan_apex()
Definition: LCElutionPeak.h:265
int fScanNumberEnd
Definition: LCElutionPeak.h:86
double fVolume
Definition: LCElutionPeak.h:82
int get_nb_ms_peaks()
Definition: LCElutionPeak.h:336
Definition: LCElutionPeak.h:65
void analyzeLCElutionPeak()
Definition: LCElutionPeak.h:133
double fIsotopMass
Definition: LCElutionPeak.h:77
double fStartTR
Definition: LCElutionPeak.h:89
std::vector< elution_peak >::iterator MZ_series_ITERATOR
Definition: LCElutionPeak.h:62
int get_end_scan()
Definition: LCElutionPeak.h:309
std::multimap< int, MSPeak >::iterator SIGNAL_iterator
Definition: LCElutionPeak.h:63
std::multimap< int, MSPeak > elution_peak
Definition: LCElutionPeak.h:60

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