Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
LCMS.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 // written by Lukas N Mueller, 30.3.05
38 // Lukas.Mueller@imsb.biol.ethz.ch
39 // Group of Prof. Ruedi Aebersold, IMSB, ETH Hoenggerberg, Zurich
40 //
41 // Ported to OpenMS by Florian Zeller, florian.zeller@bsse.ethz.ch
42 // December 2010
43 //
44 
45 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCMS_H
46 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCMS_H
47 
48 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/SuperHirnConfig.h>
50 
51 #include <string>
52 #include <vector>
53 #include <map>
54 
55 namespace OpenMS
56 {
57 
58  class SUPERHIRN_DLLAPI LCMS
59  {
60 
62  // declaration of the private members:
63 
64 private:
65 
66  // name of the spectra:
67  std::string spec_name;
68 
69  // vector of object feature:
70  std::vector<SHFeature> feature_list;
71 
72  // a unique spectrum id to identify a spectrum:
74 
75  // MASTER RUN ID:
76  int MASTER_ID;
77 
78  // the LC-MS raw data names and their IDs
79  std::map<int, std::string> raw_spec_names;
80 
81  // alignment error:
82  std::map<double, std::pair<double, double> > ALIGNMENT_ERROR;
83 
85  // declaration of the public members:
86 
87 public:
88 
90 // static double PEP_PROPHET_THERSHOLD;
91 
92  // class destructor
93  ~LCMS();
94 
95  // class constructor
96  LCMS(std::string);
97  LCMS();
98  // copy constructor
99  LCMS(const LCMS *);
100 
101  // copy constructor
102  LCMS(const LCMS &);
103 
104  // show the content of the spectra
105  void show_info();
106 
107  // copy constructor:
108  LCMS & operator=(const LCMS &);
109 
110  // sort the features according their parent mass:
111  void order_by_mass();
112 
113  // function to compare the feature mass:
114  float compare_feature_mass(const void *, const void *);
115 
116  // this structure provides the function to compare
117  // in the sorting algorithm:
118  struct OPERATOR_MZ
119  {
120  // provide the compare function for sort:
121  bool operator()(const SHFeature A, const SHFeature B) const
122  {
123  // check if they have same mass
124  if (A.MONO_MZ == B.MONO_MZ)
125  {
126  return A.TR < B.TR;
127  }
128  else
129  {
130  return A.MONO_MZ < B.MONO_MZ;
131  }
132  }
133 
134  };
135 
136  // this structure provides the function to compare
137  // in the sorting algorithm:
139  {
140  // provide the compare function for sort:
141  bool operator()(const SHFeature A, const SHFeature B) const
142  {
143  // check if they have same mass
144  if (A.feature_ID == B.feature_ID)
145  {
146  return true;
147  }
148  else
149  {
150  return false;
151  }
152  }
153 
154  };
155 
156  // tag the feature with the spectrum id:
157  void tag_peaks_with_spectrum_ID();
158 
159  // count the number of common peaks of a given number of LC-MS:
160  int get_nb_common_peaks(int);
161 
163  // start here all the get / set
164  // function to access the
165  // variables of the class
166 
167  // get the whole feature list:
168  void clear_feature_list();
169  std::vector<SHFeature> get_feature_list();
170  std::vector<SHFeature> * get_feature_list_reference();
171  bool check_feature_list_empty();
172 
173  // access end /start of list:
174  std::vector<SHFeature>::iterator get_feature_list_begin();
175  std::vector<SHFeature>::iterator get_feature_list_end();
176 
177  // add a new feature to the list:
178  void add_feature(SHFeature * in);
179 
180  // remove a feature from the LC/MS run by ID:
181  void remove_feature_by_ID(SHFeature *);
182  void remove_feature_by_ID(int);
183  // remove a feature from the LC/MS run:
184  void remove_feature(SHFeature *);
185  void remove_feature(int i);
186 
187  // remove a feature by iterator and return the iterator to the next element
188  std::vector<SHFeature>::iterator remove_feature_from_list(std::vector<SHFeature>::iterator in);
189 
190  // get number of feature added:
191  unsigned int get_nb_features();
192 
193  std::string get_spec_name();
194  void set_spec_name(std::string in);
195 
196  // set / get spectrum id:
197  int get_spectrum_ID();
198  void set_spectrum_ID(int in);
199 
200  // set the id of all features
201  void setFeatureLCMSID();
202 
203  // search the list of feature for the one with input ID:
204  SHFeature * find_feature_by_ID(int);
205 
206  // access the raw data names:
207  void remove_raw_spec_name(int ID);
208  void add_raw_spec_name(int ID, std::string name);
209  bool check_raw_spec_name_empty();
210  std::map<int, std::string>::iterator get_raw_spec_name_start();
211  std::map<int, std::string>::iterator get_raw_spec_name_end();
212  std::map<int, std::string> get_raw_spec_name_map();
213  int get_nb_raw_specs();
214 
215  std::string get_raw_spec_name(int ID);
216 
217  // compare the LC/MS runs names
218  bool check_LCMS_name(std::string);
219 
220  // check if this LC/MS ID is present in the raw LC/MS runs
221  bool find_LC_MS_by_ID(int);
222 
223  // add the raw spectrum map:
224  void add_raw_spec_name_map(std::map<int, std::string> in);
225 
226  // counts the number of ms features, which contain MS2 info:
227  int get_nb_identified_features();
228 
229  // counts the number of ms features, which contain MS2 info (no thresholding)
230  int get_nb_identified_features(double PepProb_T);
231 
233  // access the alignment error:
234  // save an error:
235  void add_alignment_error(double TR, double ERROR_UP, double ERROR_DOWN);
236 
237  // get alignment error at specific TR:
238  void get_alignment_error(double, double *, double *);
239 
240  // access MASTER run ID:
241  void set_MASTER_ID(int in);
242  int get_MASTER_ID();
243  };
244 
245 }
246 
247 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCMS_H
Definition: LCMS.h:118
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
std::vector< SHFeature > feature_list
Definition: LCMS.h:70
Definition: LCMS.h:58
int feature_ID
Definition: SHFeature.h:134
std::map< int, std::string > raw_spec_names
Definition: LCMS.h:79
double MONO_MZ
Definition: SHFeature.h:130
std::string spec_name
Definition: LCMS.h:67
double TR
Definition: SHFeature.h:129
int spectrum_id
Definition: LCMS.h:73
bool operator()(const SHFeature A, const SHFeature B) const
Definition: LCMS.h:141
bool operator()(const SHFeature A, const SHFeature B) const
Definition: LCMS.h:121
int MASTER_ID
Definition: LCMS.h:76
Definition: SHFeature.h:60
static double MINIMAL_PEP_PROPHET_THERSHOLD
Definition: LCMS.h:89
std::map< double, std::pair< double, double > > ALIGNMENT_ERROR
Definition: LCMS.h:82

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