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

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