OpenMS  2.6.0
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-2020.
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: 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 #pragma once
51 
52 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/SuperHirnConfig.h>
53 
54 #include <vector>
55 #include <map>
58 
59 namespace OpenMS
60 {
61 
62  typedef std::multimap<int, MSPeak> elution_peak;
63  typedef std::vector<elution_peak> MZ_series;
64  typedef std::vector<elution_peak>::iterator MZ_series_ITERATOR;
65  typedef std::multimap<int, MSPeak>::iterator SIGNAL_iterator;
66 
67  class SUPERHIRN_DLLAPI LCElutionPeak
68  {
69 
71  // declaration of the private members:
72 
73 private:
74 
75  // isotopic pattern:
79  double fIsotopMass;
80 
81 protected:
82 
83  double fMonoMass;
84  double fVolume;
85  int fCharge;
90  double fRT;
91  double fStartTR;
92  double fEndTR;
93  double fpeak_area;
97 
98  std::string elutionPeakExtraInfo;
99 
100  // the raw signals assigned to this peak
101  std::multimap<int, MSPeak> intens_signals;
102  //multimap<int, MSPeak> raw_intens_signals;
103  std::multimap<int, int> CHRG_MAP;
104 
106  // declaration of the public members:
107 
108 public:
109 
110  // parameters to debug a certain mass range
111  static double DEBUG_MASS_START;
112  static double DEBUG_MASS_END;
113 
114  // cut off, where everything small than this percentile of the
115  // apex is discarded
116  // static float intensity_apex_percentil_cutoff;
117 
118  // resolution of the retention time, for peak area computing:
119  // static float TR_RESOLUTION;
120 
121  // class destructor
122  ~LCElutionPeak();
123 
124  // class constructor
125  LCElutionPeak();
126  // class constructor
128  // class copy constructor
129  LCElutionPeak(const LCElutionPeak &);
130  // constructor for the object feature:
131  LCElutionPeak(const LCElutionPeak *);
132 
134  // Analyze the LC elution peak
135  void analyzeLCElutionPeak();
136 
138  // determine the intensity background baseline based on S/N
139  // value:
140  void setSNIntensityThreshold();
141 
143  // Compute a variety of parameters for the LC elution peak
144  void computeLCElutionPeakParameters();
145 
146  // removes background peaks and computes the total peak area:
147  // void compute_LC_peak_area();
148  // computes the area of between 2 peaks:
149  double compute_delta_area(double, double, double, double);
150  // define the apex into the elution profile::
151  // void define_apex();
152  // removes peaks which have lower intensity than x percentile
153  // of the apex:
154  void remove_background_peak();
155  // compute the charge state of the LC peak
156  void compute_CHRG();
157  // compute the score of the LC peak:
158  //void compute_SCORE_and_SN();
159  // define all required peak parameters from a single MS peak:
160  void defineLCElutionPeakParametersFromMSPeak();
162 
164  // print all monoisotopic peak cluster along the LC profile:
165  void createConsensIsotopPattern();
166 
167  // print the elution profile from a peak:
168  void print_profile(std::ofstream *);
169  // find the closest existing mz peak in the elution profile:
170  MSPeak * find_true_peak(float);
171  // print the elution profile from a peak:
172  void show_info();
173 
175  // overload operators:
176  LCElutionPeak & operator=(const LCElutionPeak &);
177  LCElutionPeak & operator<=(const LCElutionPeak &);
178  LCElutionPeak & operator>=(const LCElutionPeak &);
180  LCElutionPeak & operator>(const LCElutionPeak &);
181 
183  // print all monoisotopic peak cluster along the LC profile:
184  //void printIsotopClusters();
185  // print the consensus isotope pattern:
186  //void printConsensIsotopPattern();
187 
188  void setElutionPeakExtraInfo(std::string in);
189 
190  std::string getElutionPeakExtraInfo();
191 
193  // start here all the get / set
194  // function to access the
195  // variables of the class
196 
198  // access signal_intens map:
199  SIGNAL_iterator get_signal_list_start();
200 
201  SIGNAL_iterator get_signal_list_end();
202 
204  // access the raw signal intens map:
205  //SIGNAL_iterator get_raw_signal_list_start(){return raw_intens_signals.begin();};
206  //SIGNAL_iterator get_raw_signal_list_end(){return raw_intens_signals.end();};
207 
208  // update the retention time by the current tmp_scan_apex:
209  void set_apex_retention_time(double in);
210 
211  // to update the list of score and charge state:
212  void update_CHRGMAP(MSPeak * in);
213 
215  // get scan apex:
216  int get_scan_apex();
217 
218  double get_apex_intensity();
219 
220  double get_apex_retention_time();
221 
222  double get_apex_MZ();
223 
225  // get an intensity of a ms_peak
226  float get_intensity(int in);
227 
228  // get the original M/Z of a ms_peak
229  double get_MZ(int);
230 
232  // get the total peak area:
233  double get_total_peak_area();
234 
236  // get start / end scan:
237  int get_start_scan();
238 
239  int get_end_scan();
240 
241  void set_start_retention_time(double in);
242 
243  double get_start_retention_time();
244 
245  void set_end_retention_time(double in);
246 
247  double get_end_retention_time();
248 
250  // get number of peaks in the elution profile:
251  int get_nb_ms_peaks();
252 
254  // access the charge state of the LC elution peak:
255  int get_charge_state();
256 
258  // get signal to noise ratio:
259  double getSignalToNoise();
260 
261  double getSignalToNoiseBackground();
262 
263  };
264 
265 } // ns
266 
ConsensusIsotopePattern.h
MSPeak.h
OpenMS::LCElutionPeak::fScanNumberEnd
int fScanNumberEnd
Definition: LCElutionPeak.h:88
OpenMS::LCElutionPeak::f_observed_Mass
double f_observed_Mass
Definition: LCElutionPeak.h:78
OpenMS::MSPeak
Definition: MSPeak.h:65
OpenMS::LCElutionPeak::fMonoMass
double fMonoMass
Definition: LCElutionPeak.h:83
OpenMS::LCElutionPeak::fpeak_area
double fpeak_area
Definition: LCElutionPeak.h:93
OpenMS::LCElutionPeak
Definition: LCElutionPeak.h:67
OpenMS::LCElutionPeak::isotopePattern
ConsensusIsotopePattern * isotopePattern
Definition: LCElutionPeak.h:76
OpenMS::LCElutionPeak::fScanNumberApex
int fScanNumberApex
Definition: LCElutionPeak.h:87
OpenMS::elution_peak
std::multimap< int, MSPeak > elution_peak
Definition: LCElutionPeak.h:62
OpenMS::LCElutionPeak::DEBUG_MASS_END
static double DEBUG_MASS_END
Definition: LCElutionPeak.h:112
OpenMS::LCElutionPeak::CHRG_MAP
std::multimap< int, int > CHRG_MAP
Definition: LCElutionPeak.h:103
OpenMS::operator<
bool operator<(const QTCluster &q1, const QTCluster &q2)
OpenMS::LCElutionPeak::fEndTR
double fEndTR
Definition: LCElutionPeak.h:92
OpenMS::MZ_series
std::vector< elution_peak > MZ_series
Definition: LCElutionPeak.h:63
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::LCElutionPeak::APEX
MSPeak * APEX
Definition: LCElutionPeak.h:96
OpenMS::SIGNAL_iterator
std::multimap< int, MSPeak >::iterator SIGNAL_iterator
Definition: LCElutionPeak.h:65
OpenMS::LCElutionPeak::fScanNumberStart
int fScanNumberStart
Definition: LCElutionPeak.h:86
OpenMS::LCElutionPeak::fStartTR
double fStartTR
Definition: LCElutionPeak.h:91
OpenMS::LCElutionPeak::fRT
double fRT
Definition: LCElutionPeak.h:90
OpenMS::LCElutionPeak::elutionPeakExtraInfo
std::string elutionPeakExtraInfo
Definition: LCElutionPeak.h:98
OpenMS::LCElutionPeak::DEBUG_MASS_START
static double DEBUG_MASS_START
Definition: LCElutionPeak.h:111
OpenMS::LCElutionPeak::fSNIntensityThreshold
double fSNIntensityThreshold
Definition: LCElutionPeak.h:95
OpenMS::MZ_series_ITERATOR
std::vector< elution_peak >::iterator MZ_series_ITERATOR
Definition: LCElutionPeak.h:64
OpenMS::LCElutionPeak::fIsotopMass
double fIsotopMass
Definition: LCElutionPeak.h:79
OpenMS::LCElutionPeak::fVolume
double fVolume
Definition: LCElutionPeak.h:84
OpenMS::LCElutionPeak::fSignalToNoise
double fSignalToNoise
Definition: LCElutionPeak.h:94
OpenMS::LCElutionPeak::fNrIsotopes
int fNrIsotopes
Definition: LCElutionPeak.h:77
OpenMS::LCElutionPeak::fapex_intensity
double fapex_intensity
Definition: LCElutionPeak.h:89
OpenMS::LCElutionPeak::intens_signals
std::multimap< int, MSPeak > intens_signals
Definition: LCElutionPeak.h:101
OpenMS::LCElutionPeak::fCharge
int fCharge
Definition: LCElutionPeak.h:85
OpenMS::ConsensusIsotopePattern
Definition: ConsensusIsotopePattern.h:56