Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
ProcessData.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 
51 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_PROCESSDATA_H
52 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_PROCESSDATA_H
53 
54 #include <map>
55 #include <vector>
56 #include <string>
57 #include <list>
58 
59 namespace OpenMS
60 {
61 
62 
63  class OPENMS_DLLAPI ProcessData
64  {
65 
66 
68  // declaration of the private members:
69 
70 public:
71  typedef std::multimap<int, MSPeak> elution_peak;
72  typedef std::vector<elution_peak> MZ_series;
73  typedef std::vector<elution_peak>::iterator MZ_series_ITERATOR;
74  typedef std::multimap<double, MZ_series> main_data_structure;
75  typedef main_data_structure::iterator main_iterator;
76 
77 
78 protected:
79 
81  // declaration of the public members:
82  // map that tracts all observed masses in keys
83 
84 
85  // clustering of ms peak along time axis:
86 // bool TIME_CLUSTERING_BY_RETENTION_TIME;
87 
88  // max_distance from next elution peak member in scan numbers:
90 
91  // cluster data structure:
93 
94  // and stores as contents vectors of type
96 
97  // tracks the number of observed mz cluster
98  // elements:
99  std::map<double, int> MZ_CLUSTER;
101 
102 
104  // data processing classes:
106 
107 
108 
109 public:
110 
111  /*
112  // minimal intensity level:
113  static float INTENSITY_THRESHOLD;
114 
115  // m/z tolerance value:
116  static double MZ_TOLERANCE;
117 
118  // max_distance from next elution peak member in min.:
119  static double max_inter_scan_retention_time_distance;
120 
121  // define minimal number of members in LC elution peaks cluster
122  static int min_nb_cluster_members;
123 
124  static std::map<int, float> scan_TR_index;
125 
126  // to track detected monoistopic mass for debugging:
127  static bool MonoIsoDebugging;
128  static double DebugMonoIsoMassMin;
129  static double DebugMonoIsoMassMax;
130  static double MS1_intensity_apex_percentil_cutoff;
131  static double MS1_TR_RESOLUTION;
132  // if data are in centroid form or not:
133  static bool CENTROID_DATA_MODUS;
134  */
135 
136  // class destructor
137  ~ProcessData();
138 
139  // class constructor
140  ProcessData();
141  // class copy constructor
142  ProcessData(const ProcessData &);
143 
144 
146  // inputs raw /centroided data into the object:
147  void add_scan_raw_data(int, float, CentroidData *);
148  // inputs raw data into the object:
149  void add_scan_raw_data(std::vector<MSPeak>);
150 
152  // overload operators:
153  ProcessData & operator=(const ProcessData &);
154  ProcessData & operator<=(const ProcessData &);
155  ProcessData & operator>=(const ProcessData &);
156  ProcessData & operator<(const ProcessData &);
157  ProcessData & operator>(const ProcessData &);
158 
159  // insert an already observed mz into the data structure, checks
160  // if it belongs to an existing LC elution peak or starts a new one:
161  void insert_observed_mz(main_iterator, MSPeak *);
162  // insert a newly observed mz into the data structure
163  void insert_new_observed_mz(MSPeak *);
164 
165 
166  // converts DeconvPeak list to ms_peak vector
167  void convert_ms_peaks(int, double, std::list<DeconvPeak> &, std::vector<MSPeak> &);
168 
169  // check if the ms peak is in the selected mz, z, int range
170  bool filterDeisotopicMSPeak(MSPeak *);
171 
173  // function which check if a data structure iterator is similar
174  // to a peak and should be considered
175  // returns 1 if ok
176  // returns 0 if not
177  // returns -1 if scan range exceeded
178  int compareIteratorToPeak(MSPeak *, main_iterator);
179  // checks if a mz value has already been seen,
180  // also look for very close ones and cluster them
181  main_iterator check_MZ_occurence(MSPeak *);
182 
183 
185  // process a series of MS peaks
186  // set the signal to noise level:
187  void processMSPeaks(std::multimap<int, MSPeak> *);
188 
189 
191  // get the full summed up intensity
192  double getPeakIntensitySum(double);
193 
194 
195  // check if a peak with this scan number belong to this elution cluster:
196  bool check_elution_peak_belong(MZ_series_ITERATOR, MSPeak *);
197  // returns the distance to this elution peak:
198  int getElutionPeakDistance(MZ_series_ITERATOR, int);
199 
200  // runs through the whole data structure and puts the elution_peaks into
201  // a proper LC_elution peak object
202  void extract_elution_peaks();
203 
204  // check if this elution peak is accepted as a really LC-elution peak:
205  bool check_elution_peak(MZ_series_ITERATOR);
206 
207  // convert the MZ_series elution peak element into a LC_elution_peak object
208  void convert_to_LC_elution_peak(MZ_series_ITERATOR, double);
209 
210  // find a retention time by the scan number:
211  double find_retention_time(double);
212 
213  // find closest match mz mass in the main structure
214  main_iterator find_closest_mz_match(double);
215 
216  // go back to the MS1 level and
217  // find the correct precursor mass by mz and z:
218  void adjustCorrectToMS1Precursor(double *, int, int, int);
219 
220 
222  // access methods to the object variables:
223 
224  // get an observed MZ mass, otherwise end of list iterator
225  main_iterator get_MZ(double);
226  // get an observed MZ mass, otherwise end of list iterator
227  main_iterator get_MZ_lower_bound(double);
228  // get end of MZ list:
229  main_iterator get_MZ_LIST_end();
230  // get start of MZ list:
231  main_iterator get_MZ_LIST_start();
232  // erase element in MZ list:
233  void erase_MZ_LIST_element(main_iterator);
234  int getNbMSTraces(){ return (int) pMZ_LIST.size(); }
235 
236 
238 
239 
240 
241  // access the MZ_CLUSTER:
242  // find element numbers:
243  std::map<double, int>::iterator get_nb_MZ_cluster_elements(double);
244  // erase an element:
245  void erase_MZ_cluster_element(std::map<double, int>::iterator);
246  // insert an element:
247  void insert_MZ_cluster_element(double, int);
248 
249  // add the scan vs TR index to the data structure:
250  // void add_scan_TR_index(std::map<int, float> IN){scan_TR_index = IN;};
251 
252  // get the processed data:
253  LCMSCData * getProcessedData(){return data_; }
254 
255  // increase the LC_elution_profile counter:
256  void increase_LC_elution_peak_counter(){LC_elution_peak_counter++; }
257  unsigned int get_LC_elution_peak_counter(){return LC_elution_peak_counter; }
258 
259  // get the maximal scan distance between two same monoisotopic masses
260  int getMaxScanDistance(){ return max_inter_scan_distance; }
261  void setMaxScanDistance(int in){ max_inter_scan_distance = in; }
262 
263 
264  // build up an index scan vs retention time:
265  // static void insert_into_scan_TR_index(int IN, float TR){scan_TR_index.insert(std::pair<int, float>(IN,TR));};
266 
267  };
268 
269 } // ns
270 
271 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_PROCESSDATA_H
Definition: ProcessData.h:63
Definition: BackgroundControl.h:56
int getNbMSTraces()
Definition: ProcessData.h:234
void setMaxScanDistance(int in)
Definition: ProcessData.h:261
double getMinimalIntensityLevel()
Definition: ProcessData.h:237
Definition: CentroidData.h:62
main_data_structure pMZ_LIST
Definition: ProcessData.h:95
std::map< double, int > MZ_CLUSTER
Definition: ProcessData.h:99
main_data_structure::iterator main_iterator
Definition: ProcessData.h:75
unsigned int LC_elution_peak_counter
Definition: ProcessData.h:100
unsigned int get_LC_elution_peak_counter()
Definition: ProcessData.h:257
Definition: MSPeak.h:64
BackgroundControl * backgroundController
Definition: ProcessData.h:105
float getIntensityThreshold()
Definition: SuperHirnParameters.h:283
std::multimap< int, MSPeak > elution_peak
Definition: ProcessData.h:71
std::multimap< double, MZ_series > main_data_structure
Definition: ProcessData.h:74
std::vector< elution_peak >::iterator MZ_series_ITERATOR
Definition: ProcessData.h:73
std::vector< elution_peak > MZ_series
Definition: ProcessData.h:72
LCMSCData * getProcessedData()
Definition: ProcessData.h:253
static SuperHirnParameters * instance()
Definition: SuperHirnParameters.h:222
void increase_LC_elution_peak_counter()
Definition: ProcessData.h:256
LCMSCData * data_
Definition: ProcessData.h:92
Definition: LCMSCData.h:62
int getMaxScanDistance()
Definition: ProcessData.h:260
int max_inter_scan_distance
Definition: ProcessData.h:89

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