Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
SHFeature.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 // 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_SHFEATURE_H
46 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_SHFEATURE_H
47 
48 namespace OpenMS
49 {
50 
51  class OPENMS_DLLAPI SHFeature
52  {
53 
55  // declaration of the private members:
56 
57 private:
58 
60  // IDENTIFICATION PARAMETERS:
61  // name of the spectra:
62  std::map<double, std::vector<MS2Info> > MS2_SCANS;
64 
66  // raw MS peak paramaters:
67  int scan_apex;
69  int scan_end;
72  double PEAK_SCORE;
73  double SignalToNoise;
75 
77  // Analysis parameters:
80  double SCORE_HOLDER;
82  double PI;
83 
85  // LC/MS run ID parameters:
87  int MASTER_ID;
88 
90  // string to store ms1 feature extra information:
92 
94  // LC elution profile:
96 
97  // static values:
98  static double _MONO_H;
99  static double _MONO_O;
100 
102  // LC/MS matching things:
103  std::map<int, SHFeature> matched_feature_list;
104 
105  // ranges of m/z and tr:
106  double TR_APEX;
108  double MONO_MZ_END;
110 
112  // associated MS2 feature:
114 
116  // declaration of the public members:
117 
118 public:
119 
120  double TR;
121  double MONO_MZ;
122  double TR_START;
123  double TR_END;
126 
127  // class destructor
128  ~SHFeature();
129 
130  // copy constructor:
131  SHFeature(const SHFeature &);
132 
133  // class constructor
134  SHFeature(const SHFeature *);
135  // constructor for the object SHFeature:
136  SHFeature(double, double, int, int, int, int, float, float, float);
137  // constructor for the object SHFeature:
138  SHFeature(float, int, int);
140  SHFeature();
141  // copy constructor:
142  SHFeature & operator=(const SHFeature &);
143 
144  // show the content of the spectra
145  void show_info();
146  // show MS/MS spectra info:
147  void showMS2consensSpectraInfo();
148 
150  // comparision operators:
151  bool operator==(const SHFeature &);
152 
153  // add MS/MS info to the SHFeature:
154  void add_MS2_info(MS2Info *);
155  void add_MS2_info(std::map<double, std::vector<MS2Info> > *);
156  bool get_MS2_info();
157  bool get_MS2_info(double);
158 
160  {
161  return MS2_SCANS.empty();
162  }
163 
165  {
166  return MS2_SCANS.clear();
167  }
168 
170  {
171  return (int) MS2_SCANS.size();
172  }
173 
174  std::map<double, std::vector<MS2Info> > * get_MS2_SCAN_MAP()
175  {
176  return &MS2_SCANS;
177  }
178 
179  std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCANS_START()
180  { return MS2_SCANS.begin(); }
181  std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCANS_END()
182  { return MS2_SCANS.end(); }
183  // get the best ms2 scan == closest to the apex:
184  MS2Info * get_best_MS2_SCAN();
185  MS2Info * get_best_MS2_SCAN(double);
186 
187  void setFeatureExtraInformation(std::string in)
188  { featureExtraInformation = in; }
190  { return featureExtraInformation; }
191 
192  // functions to set/access machted features:
193  void add_matched_feature(SHFeature *);
194  std::map<int, SHFeature> * get_match_list_REFERENCE()
195  { return &matched_feature_list; }
196  std::map<int, SHFeature> get_match_list()
197  { return matched_feature_list; }
198  std::map<int, SHFeature>::iterator get_match_list_start()
199  { return matched_feature_list.begin(); }
200  std::map<int, SHFeature>::iterator get_match_list_end()
201  { return matched_feature_list.end(); }
202  std::map<int, SHFeature>::iterator find_match_by_id(int ID)
203  { return matched_feature_list.find(ID); }
204 
205  // get feature at a certain LC-MS by LC_MS id
206  SHFeature * get_feature(int);
207 
208  // get the total peak are over all matched features:
209  double get_MATCHED_peak_area();
210  bool check_match_by_id(int);
212  { matched_feature_list.clear(); }
213  // get the profile over all matched features:
214  std::map<int, double> get_feature_profile();
215 
216  // return number of times this feature has been seen = nb_replicates in list plus 1!
218  { return (int) (matched_feature_list.size() + 1); }
220  { return get_replicate_match_nb(); }
221  // return the sum of all intensities over replicates:
222  double get_replicate_intensity_sum();
223 
225  // start here all the get / set
226  // function to access the
227  // variables of the class
228 
229  // access the parent mass of feature, calculated from the SQ
230  double get_MZ()
231  { return MONO_MZ; }
232  void set_MZ(double in)
233  { MONO_MZ = in; }
234  double get_MZ_START()
235  { return MONO_MZ_START; }
236  void set_MZ_START(double IN)
237  { MONO_MZ_START = IN; }
238  double get_MZ_END()
239  { return MONO_MZ_END; }
240  void set_MZ_END(double IN)
241  { MONO_MZ_END = IN; }
242 
243  double get_THEO_MZ()
244  { return get_best_MS2_SCAN()->get_MONO_MZ(); }
245  double get_THEO_MZ(double T)
246  { return get_best_MS2_SCAN(T)->get_MONO_MZ(); }
247  std::string get_AC()
248  { return get_best_MS2_SCAN()->get_AC(); }
249  std::string get_AC(double T)
250  { return get_best_MS2_SCAN(T)->get_AC(); }
251  bool check_AC(std::string IN)
252  { return get_best_MS2_SCAN()->compare_AC(IN); }
253  bool check_AC(std::string IN, double T)
254  { return get_best_MS2_SCAN(T)->compare_AC(IN); }
255  std::string get_SQ()
256  { return get_best_MS2_SCAN()->get_SQ(); }
257  std::string get_SQ(double T)
258  { return get_best_MS2_SCAN(T)->get_SQ(); }
259  std::string get_TOTAL_SQ()
260  { return get_best_MS2_SCAN()->get_TOTAL_SQ(); }
261  std::string get_TOTAL_SQ(double T)
262  { return get_best_MS2_SCAN(T)->get_TOTAL_SQ(); }
263  std::string get_MOD_SQ()
264  { return get_best_MS2_SCAN()->get_MOD_SQ(); }
265  std::string get_MOD_SQ(double T)
266  { return get_best_MS2_SCAN(T)->get_MOD_SQ(); }
267  double get_pep_prob()
268  { return get_best_MS2_SCAN()->get_PEP_PROB(); }
269  double get_pep_prob(double T)
270  { return get_best_MS2_SCAN(T)->get_PEP_PROB(); }
271  std::string get_MS2_TYPE_TAG()
272  { return get_best_MS2_SCAN()->get_MS2_TYPE_TAG(); }
273  std::string get_MS2_TYPE_TAG(double T)
274  { return get_best_MS2_SCAN(T)->get_MS2_TYPE_TAG(); }
276  { return get_best_MS2_SCAN()->get_SCAN_START(); }
277  int get_MS2_scan(double T)
278  { return get_best_MS2_SCAN(T)->get_SCAN_START(); }
279  std::map<double, std::vector<MS2Info> > * get_MS2_SCAN_LIST()
280  { return &(MS2_SCANS); }
281  std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCAN_LIST_START()
282  { return MS2_SCANS.begin(); }
283  std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCAN_LIST_END()
284  { return MS2_SCANS.end(); }
285 
287  { return scan_apex; }
288  void set_scan_number(int IN)
289  { scan_apex = IN; }
291  { return scan_start; }
292  void set_scan_start(int IN)
293  { scan_start = IN; }
295  { return scan_end; }
296  void set_scan_end(int IN)
297  { scan_end = IN; }
299  { return charge_state; }
300  void set_charge_state(int IN)
301  { charge_state = IN; }
302  void set_peak_area(float IN)
303  { total_peak_area = IN; }
304  double get_peak_area()
305  { return total_peak_area; }
306  // get peak area at a certain LC/MS:
307  double get_peak_area(int);
309  { return apex_peak_intensity; }
310  void set_apex_peak_intensity(double in)
311  { apex_peak_intensity = in; }
312  void normalize_peak_area_by_factor(double factor)
313  { total_peak_area *= factor; }
314 
316  { return alignment_error_up; }
317  void set_alignment_error_up(double IN)
318  { alignment_error_up = IN; }
320  { return alignment_error_down; }
321  void set_alignment_error_down(double IN)
322  { alignment_error_down = IN; }
323 
324  void set_SCORE_HOLDER(double IN)
325  { SCORE_HOLDER = IN; }
327  { return SCORE_HOLDER; }
328 
330  { return TR; }
331  void set_retention_time(double IN)
332  { TR = IN; }
334  { return TR_START; }
335  void set_retention_time_START(double IN)
336  { TR_START = IN; }
338  { return TR_END; }
339  void set_retention_time_END(double IN)
340  { TR_END = IN; }
341 
342  // original mz and Tr coordinates
344  { return TR_APEX; }
346  { TR_APEX = IN; }
347  double get_raw_MZ()
348  { return MONO_MZ_ORIGINAL; }
349  void set_raw_MZ(double IN)
350  { MONO_MZ_ORIGINAL = IN; }
351 
352  // feature ID:
353  void set_feature_ID(int IN)
354  { feature_ID = IN; }
356  { return feature_ID; }
357 
358  void set_spectrum_ID(int IN)
359  {
360  spectrum_ID = IN;
361  /*
362  if( MS2TraceFeature != NULL){
363  MS2TraceFeature.set
364  }
365  */
366  }
367 
369  { return spectrum_ID; }
370 
371  void set_MASTER_ID(int IN)
372  { MASTER_ID = IN; }
374  { return MASTER_ID; }
375 
376  // check how many matches
377  int get_nb_common_match();
378 
379  // get/set the peak score
380  double get_peak_score()
381  { return PEAK_SCORE; }
382  void set_peak_score(double in)
383  { PEAK_SCORE = in; }
384 
385  // get the molecular mass of the corrsponding peptide!
386  double get_Molecular_Mass();
387 
388  // fetaure PI:
389  double get_FEATURE_PI()
390  { return PI; }
391  void set_FEATURE_PI(double IN)
392  { PI = IN; }
393 
394  // check charge states, in cases where a feature was
395  // created based on a MS2 trace, charge state is unknown ( = -1 )
396  // -> derivce the charge state from the matched feature (if this is
397  // also not -1
398  void deriveChargeStates(SHFeature *);
399 
400  // LC elution profile
402  { LCprofile = IN; }
404  { return LCprofile; }
405 
407  // parameters computed over matched features:
408  double get_profile_retention_time();
409  double get_profile_Molecular_Mass();
410 
412  // status if feature has been matched:
414  { return feature_match_status; }
416  { feature_match_status = IN; }
417 
419  // access the MS2 feature
421  { MS2TraceFeature = new MS2Feature(in); }
423  { delete MS2TraceFeature; MS2TraceFeature = NULL; }
425  { return MS2TraceFeature; }
426 
428  { return SignalToNoise; }
429  void setSignalToNoise(double in)
430  { SignalToNoise = in; }
431 
433  { return BackgroundNoise; }
434  void setBackgroundNoiseLevel(double in)
435  { BackgroundNoise = in; }
436 
438  // get static members:
439  //static double get_MZ_TOL(){return MZ_TOL;};
440  static double get_MONO_H()
441  { return _MONO_H; }
442 
443  // compare to masses at the PPM value and decided
444  // if they fall into the m/z tolerance window
445  static bool compareFeatureMassValuesAtPPMLevel(double, double);
446 
447  // get the masse error at the PPM value
448  static double getFeatureMassErrorAtPPMLevel(double);
449 
450  };
451 
452 } // ns
453 
454 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_SHFEATURE_H
double TR_START
Definition: SHFeature.h:122
std::map< double, std::vector< MS2Info > >::iterator get_MS2_SCAN_LIST_END()
Definition: SHFeature.h:283
double get_retention_time_START()
Definition: SHFeature.h:333
double get_retention_time_END()
Definition: SHFeature.h:337
double PI
Definition: SHFeature.h:82
double MONO_MZ_ORIGINAL
Definition: SHFeature.h:109
void set_apex_peak_intensity(double in)
Definition: SHFeature.h:310
void setBackgroundNoiseLevel(double in)
Definition: SHFeature.h:434
void set_peak_score(double in)
Definition: SHFeature.h:382
int scan_end
Definition: SHFeature.h:69
std::map< int, SHFeature > get_match_list()
Definition: SHFeature.h:196
std::string get_SQ()
Definition: SHFeature.h:255
double get_peak_score()
Definition: SHFeature.h:380
int get_MS2_scan()
Definition: SHFeature.h:275
static double _MONO_H
Definition: SHFeature.h:98
double get_FEATURE_PI()
Definition: SHFeature.h:389
double alignment_error_down
Definition: SHFeature.h:79
double BackgroundNoise
Definition: SHFeature.h:74
void set_retention_time_START(double IN)
Definition: SHFeature.h:335
std::string get_SQ(double T)
Definition: SHFeature.h:257
bool check_MS2_empty()
Definition: SHFeature.h:159
std::string get_AC(double T)
Definition: SHFeature.h:249
std::map< int, SHFeature > * get_match_list_REFERENCE()
Definition: SHFeature.h:194
double get_SCORE_HOLDER()
Definition: SHFeature.h:326
void normalize_peak_area_by_factor(double factor)
Definition: SHFeature.h:312
int get_scan_number()
Definition: SHFeature.h:286
void set_MZ_END(double IN)
Definition: SHFeature.h:240
#define NULL
Definition: IsotopeWaveletParallelFor.h:41
std::string get_MOD_SQ(double T)
Definition: SHFeature.h:265
bool check_AC(std::string IN, double T)
Definition: SHFeature.h:253
std::map< double, std::vector< MS2Info > > MS2_SCANS
Definition: SHFeature.h:62
std::string get_MOD_SQ()
Definition: SHFeature.h:263
void setLCelutionProfile(FeatureLCProfile *IN)
Definition: SHFeature.h:401
double TR_END
Definition: SHFeature.h:123
std::string getFeatureExtraInformation()
Definition: SHFeature.h:189
int get_MS2_SCANS_SIZE()
Definition: SHFeature.h:169
void set_raw_MZ(double IN)
Definition: SHFeature.h:349
double get_THEO_MZ()
Definition: SHFeature.h:243
int scan_apex
Definition: SHFeature.h:67
double get_retention_time()
Definition: SHFeature.h:329
double get_MZ_START()
Definition: SHFeature.h:234
void set_SCORE_HOLDER(double IN)
Definition: SHFeature.h:324
double get_THEO_MZ(double T)
Definition: SHFeature.h:245
void set_MASTER_ID(int IN)
Definition: SHFeature.h:371
void set_MZ(double in)
Definition: SHFeature.h:232
void setFeatureExtraInformation(std::string in)
Definition: SHFeature.h:187
void set_scan_start(int IN)
Definition: SHFeature.h:292
void set_scan_end(int IN)
Definition: SHFeature.h:296
double MONO_MZ_START
Definition: SHFeature.h:107
FeatureLCProfile * getLCelutionProfile()
Definition: SHFeature.h:403
void removeAllMS2Information()
Definition: SHFeature.h:164
bool check_AC(std::string IN)
Definition: SHFeature.h:251
int get_matching_nb()
Definition: SHFeature.h:219
std::string get_TOTAL_SQ()
Definition: SHFeature.h:259
int feature_ID
Definition: SHFeature.h:125
int get_scan_start()
Definition: SHFeature.h:290
double apex_peak_intensity
Definition: SHFeature.h:71
void setSignalToNoise(double in)
Definition: SHFeature.h:429
int spectrum_ID
Definition: SHFeature.h:86
Definition: MS2Feature.h:54
double PEAK_SCORE
Definition: SHFeature.h:72
void erase_match_list()
Definition: SHFeature.h:211
void set_FEATURE_PI(double IN)
Definition: SHFeature.h:391
double MONO_MZ
Definition: SHFeature.h:121
std::map< double, std::vector< MS2Info > > * get_MS2_SCAN_MAP()
Definition: SHFeature.h:174
double SignalToNoise
Definition: SHFeature.h:73
double TR_APEX
Definition: SHFeature.h:106
void set_retention_time_END(double IN)
Definition: SHFeature.h:339
std::map< int, SHFeature >::iterator get_match_list_end()
Definition: SHFeature.h:200
std::string get_TOTAL_SQ(double T)
Definition: SHFeature.h:261
std::map< int, SHFeature > matched_feature_list
Definition: SHFeature.h:103
void set_feature_ID(int IN)
Definition: SHFeature.h:353
std::string featureExtraInformation
Definition: SHFeature.h:91
Definition: FeatureLCProfile.h:66
int get_MS2_scan(double T)
Definition: SHFeature.h:277
int scan_start
Definition: SHFeature.h:68
void set_feature_match_status(bool IN)
Definition: SHFeature.h:415
std::map< int, SHFeature >::iterator find_match_by_id(int ID)
Definition: SHFeature.h:202
double get_MZ()
Definition: SHFeature.h:230
void set_MZ_START(double IN)
Definition: SHFeature.h:236
void set_raw_retention_time_apex(double IN)
Definition: SHFeature.h:345
std::map< double, std::vector< MS2Info > >::iterator get_MS2_SCANS_START()
Definition: SHFeature.h:179
double get_alignment_error_up()
Definition: SHFeature.h:315
void set_alignment_error_down(double IN)
Definition: SHFeature.h:321
double TR
Definition: SHFeature.h:120
FeatureLCProfile * LCprofile
Definition: SHFeature.h:95
std::map< double, std::vector< MS2Info > > * get_MS2_SCAN_LIST()
Definition: SHFeature.h:279
void set_spectrum_ID(int IN)
Definition: SHFeature.h:358
void set_retention_time(double IN)
Definition: SHFeature.h:331
int MASTER_ID
Definition: SHFeature.h:87
void removeMS2Feature()
Definition: SHFeature.h:422
int get_charge_state()
Definition: SHFeature.h:298
double get_MZ_END()
Definition: SHFeature.h:238
std::map< double, std::vector< MS2Info > >::iterator get_MS2_SCANS_END()
Definition: SHFeature.h:181
const double PI
PI.
int get_feature_ID()
Definition: SHFeature.h:355
int get_MASTER_ID()
Definition: SHFeature.h:373
double get_raw_retention_time_apex()
Definition: SHFeature.h:343
std::string get_MS2_TYPE_TAG(double T)
Definition: SHFeature.h:273
MS2Feature * MS2TraceFeature
Definition: SHFeature.h:113
void set_alignment_error_up(double IN)
Definition: SHFeature.h:317
static double _MONO_O
Definition: SHFeature.h:99
bool get_feature_match_status()
Definition: SHFeature.h:413
std::map< double, std::vector< MS2Info > >::iterator get_MS2_SCAN_LIST_START()
Definition: SHFeature.h:281
double MONO_MZ_END
Definition: SHFeature.h:108
double get_apex_peak_intensity()
Definition: SHFeature.h:308
double get_raw_MZ()
Definition: SHFeature.h:347
void set_scan_number(int IN)
Definition: SHFeature.h:288
double get_pep_prob(double T)
Definition: SHFeature.h:269
void set_charge_state(int IN)
Definition: SHFeature.h:300
static double get_MONO_H()
Definition: SHFeature.h:440
void set_peak_area(float IN)
Definition: SHFeature.h:302
double getBackgroundNoiseLevel()
Definition: SHFeature.h:432
int get_replicate_match_nb()
Definition: SHFeature.h:217
MS2Feature * getMS2Feature()
Definition: SHFeature.h:424
double total_peak_area
Definition: SHFeature.h:70
int get_spectrum_ID()
Definition: SHFeature.h:368
int charge_state
Definition: SHFeature.h:124
std::string get_AC()
Definition: SHFeature.h:247
Definition: SHFeature.h:51
void addMS2Feature(MS2Feature *in)
Definition: SHFeature.h:420
double alignment_error_up
Definition: SHFeature.h:78
bool feature_match_status
Definition: SHFeature.h:81
std::string get_MS2_TYPE_TAG()
Definition: SHFeature.h:271
double getSignalToNoise()
Definition: SHFeature.h:427
double get_alignment_error_down()
Definition: SHFeature.h:319
std::map< int, SHFeature >::iterator get_match_list_start()
Definition: SHFeature.h:198
int get_scan_end()
Definition: SHFeature.h:294
double get_peak_area()
Definition: SHFeature.h:304
double SCORE_HOLDER
Definition: SHFeature.h:80
double get_pep_prob()
Definition: SHFeature.h:267
Definition: MS2Info.h:57

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