| OpenMS 2.5.0

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-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 // 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 #pragma once
46
47 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/SuperHirnConfig.h>
48 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/MS2Info.h>
49 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/FeatureLCProfile.h>
50 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/SUPERHIRN/MS2Feature.h>
51
52 #include <map>
53 #include <vector>
54 #include <string>
55
56 namespace OpenMS
57 {
58
59 class SUPERHIRN_DLLAPI SHFeature
60 {
61
63 // declaration of the private members:
64
65 private:
66
68 // IDENTIFICATION PARAMETERS:
69 // name of the spectra:
70 std::map<double, std::vector<MS2Info> > MS2_SCANS;
72
74 // raw MS peak parameters:
75 int scan_apex;
76 int scan_start;
77 int scan_end;
78 double total_peak_area;
79 double apex_peak_intensity;
80 double PEAK_SCORE;
81 double SignalToNoise;
82 double BackgroundNoise;
83
85 // Analysis parameters:
86 double alignment_error_up;
87 double alignment_error_down;
88 double SCORE_HOLDER;
89 bool feature_match_status;
90 double PI;
91
93 // LC/MS run ID parameters:
94 int spectrum_ID;
95 int MASTER_ID;
96
98 // string to store ms1 feature extra information:
99 std::string featureExtraInformation;
100
102 // LC elution profile:
103 FeatureLCProfile * LCprofile;
104
105 // static values:
106 static double _MONO_H;
107 static double _MONO_O;
108
110 // LC/MS matching things:
111 std::map<int, SHFeature> matched_feature_list;
112
113 // ranges of m/z and tr:
114 double TR_APEX;
115 double MONO_MZ_START;
116 double MONO_MZ_END;
117 double MONO_MZ_ORIGINAL;
118
120 // associated MS2 feature:
121 MS2Feature * MS2TraceFeature;
122
124 // declaration of the public members:
125
126 public:
127
128 double TR;
129 double MONO_MZ;
130 double TR_START;
131 double TR_END;
132 int charge_state;
133 int feature_ID;
134
135 // class destructor
136 ~SHFeature();
137
138 // copy constructor:
139 SHFeature(const SHFeature &);
140
141 // class constructor
142 SHFeature(const SHFeature *);
143 // constructor for the object SHFeature:
144 SHFeature(double, double, int, int, int, int, float, float, float);
145 // constructor for the object SHFeature:
146 SHFeature(float, int, int);
147 SHFeature(MS2Feature *);
148 SHFeature();
149 // copy constructor:
150 SHFeature & operator=(const SHFeature &);
151
152 // show the content of the spectra
153 void show_info();
154 // show MS/MS spectra info:
155 void showMS2consensSpectraInfo();
156
158 // comparison operators:
159 bool operator==(const SHFeature &);
160
161 // add MS/MS info to the SHFeature:
162 void add_MS2_info(MS2Info *);
163 void add_MS2_info(std::map<double, std::vector<MS2Info> > *);
164 bool get_MS2_info();
165 bool get_MS2_info(double);
166
167 bool check_MS2_empty();
168
169 void removeAllMS2Information();
170
171 int get_MS2_SCANS_SIZE();
172
173 std::map<double, std::vector<MS2Info> > * get_MS2_SCAN_MAP();
174
175 std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCANS_START();
176 std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCANS_END();
177 // get the best ms2 scan == closest to the apex:
178 MS2Info * get_best_MS2_SCAN();
179 MS2Info * get_best_MS2_SCAN(double);
180
181 void setFeatureExtraInformation(std::string in);
182 std::string getFeatureExtraInformation();
183
184 // functions to set/access matched features:
185 void add_matched_feature(SHFeature *);
186 std::map<int, SHFeature> * get_match_list_REFERENCE();
187 std::map<int, SHFeature> get_match_list();
188 std::map<int, SHFeature>::iterator get_match_list_start();
189 std::map<int, SHFeature>::iterator get_match_list_end();
190 std::map<int, SHFeature>::iterator find_match_by_id(int ID);
191
192 // get feature at a certain LC-MS by LC_MS id
193 SHFeature * get_feature(int);
194
195 // get the total peak are over all matched features:
196 double get_MATCHED_peak_area();
197 bool check_match_by_id(int);
198 void erase_match_list();
199 // get the profile over all matched features:
200 std::map<int, double> get_feature_profile();
201
202 // return number of times this feature has been seen = nb_replicates in list plus 1!
203 int get_replicate_match_nb();
204 int get_matching_nb();
205 // return the sum of all intensities over replicates:
206 double get_replicate_intensity_sum();
207
209 // start here all the get / set
210 // function to access the
211 // variables of the class
212
213 // access the parent mass of feature, calculated from the SQ
214 double get_MZ();
215 void set_MZ(double in);
216 double get_MZ_START();
217 void set_MZ_START(double in);
218 double get_MZ_END();
219 void set_MZ_END(double in);
220
221 double get_THEO_MZ();
222 double get_THEO_MZ(double T);
223 std::string get_AC();
224 std::string get_AC(double T);
225 bool check_AC(std::string in);
226 bool check_AC(std::string in, double T);
227 std::string get_SQ();
228 std::string get_SQ(double T);
229 std::string get_TOTAL_SQ();
230 std::string get_TOTAL_SQ(double T);
231 std::string get_MOD_SQ();
232 std::string get_MOD_SQ(double T);
233 double get_pep_prob();
234 double get_pep_prob(double T);
235 std::string get_MS2_TYPE_TAG();
236 std::string get_MS2_TYPE_TAG(double T);
237 int get_MS2_scan();
238 int get_MS2_scan(double T);
239 std::map<double, std::vector<MS2Info> > * get_MS2_SCAN_LIST();
240 std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCAN_LIST_START();
241 std::map<double, std::vector<MS2Info> >::iterator get_MS2_SCAN_LIST_END();
242
243 int get_scan_number();
244 void set_scan_number(int in);
245 int get_scan_start();
246 void set_scan_start(int in);
247 int get_scan_end();
248 void set_scan_end(int in);
249 int get_charge_state();
250 void set_charge_state(int in);
251 void set_peak_area(float in);
252 double get_peak_area();
253 // get peak area at a certain LC/MS:
254 double get_peak_area(int);
255 double get_apex_peak_intensity();
256 void set_apex_peak_intensity(double in);
257 void normalize_peak_area_by_factor(double factor);
258
259 double get_alignment_error_up();
260 void set_alignment_error_up(double in);
261 double get_alignment_error_down();
262 void set_alignment_error_down(double in);
263
264 void set_SCORE_HOLDER(double in);
265 double get_SCORE_HOLDER();
266
267 double get_retention_time();
268 void set_retention_time(double in);
269 double get_retention_time_START();
270 void set_retention_time_START(double in);
271 double get_retention_time_END();
272 void set_retention_time_END(double in);
273
274 // original mz and Tr coordinates
275 double get_raw_retention_time_apex();
276 void set_raw_retention_time_apex(double in);
277 double get_raw_MZ();
278 void set_raw_MZ(double in);
279
280 // feature ID:
281 void set_feature_ID(int in);
282 int get_feature_ID();
283
284 void set_spectrum_ID(int in);
285
286 int get_spectrum_ID();
287
288 void set_MASTER_ID(int in);
289 int get_MASTER_ID();
290
291 // check how many matches
292 int get_nb_common_match();
293
294 // get/set the peak score
295 double get_peak_score();
296 void set_peak_score(double in);
297
298 // get the molecular mass of the corresponding peptide!
299 double get_Molecular_Mass();
300
301 // feature PI:
302 double get_FEATURE_PI();
303 void set_FEATURE_PI(double in);
304
305 // check charge states, in cases where a feature was
306 // created based on a MS2 trace, charge state is unknown ( = -1 )
307 // -> derive the charge state from the matched feature (if this is
308 // also not -1
309 void deriveChargeStates(SHFeature *);
310
311 // LC elution profile
312 void setLCelutionProfile(FeatureLCProfile * in);
313 FeatureLCProfile * getLCelutionProfile();
314
316 // parameters computed over matched features:
317 double get_profile_retention_time();
318 double get_profile_Molecular_Mass();
319
321 // status if feature has been matched:
322 bool get_feature_match_status();
323 void set_feature_match_status(bool in);
324
326 // access the MS2 feature
327 void addMS2Feature(MS2Feature * in);
328 void removeMS2Feature();
329 MS2Feature * getMS2Feature();
330
331 double getSignalToNoise();
332 void setSignalToNoise(double in);
333
334 double getBackgroundNoiseLevel();
335 void setBackgroundNoiseLevel(double in);
336
338 // get static members:
339 //static double get_MZ_TOL(){return MZ_TOL;};
340 static double get_MONO_H();
341
342 // compare to masses at the PPM value and decided
343 // if they fall into the m/z tolerance window
344 static bool compareFeatureMassValuesAtPPMLevel(double, double);
345
346 // get the masse error at the PPM value
347 static double getFeatureMassErrorAtPPMLevel(double);
348
349 };
350
351 } // ns
352
OpenMS::SHFeature::charge_state
int charge_state
Definition: SHFeature.h:132
OpenMS::SHFeature::LCprofile
FeatureLCProfile * LCprofile
Definition: SHFeature.h:103
OpenMS::SHFeature::PEAK_SCORE
double PEAK_SCORE
Definition: SHFeature.h:80
OpenMS::SHFeature::matched_feature_list
std::map< int, SHFeature > matched_feature_list
Definition: SHFeature.h:111
OpenMS::SHFeature::alignment_error_down
double alignment_error_down
Definition: SHFeature.h:87
OpenMS::SHFeature::TR_START
double TR_START
Definition: SHFeature.h:130
OpenMS::SHFeature
Definition: SHFeature.h:59
OpenMS::SHFeature::SCORE_HOLDER
double SCORE_HOLDER
Definition: SHFeature.h:88
MS2Info.h
OpenMS::SHFeature::TR
double TR
Definition: SHFeature.h:128
OpenMS::SHFeature::MONO_MZ_ORIGINAL
double MONO_MZ_ORIGINAL
Definition: SHFeature.h:117
OpenMS::SHFeature::scan_start
int scan_start
Definition: SHFeature.h:76
OpenMS::SHFeature::BackgroundNoise
double BackgroundNoise
Definition: SHFeature.h:82
OpenMS::SHFeature::scan_apex
int scan_apex
Definition: SHFeature.h:75
OpenMS::SHFeature::MONO_MZ_START
double MONO_MZ_START
Definition: SHFeature.h:115
OpenMS::SHFeature::scan_end
int scan_end
Definition: SHFeature.h:77
MS2Feature.h
OpenMS::SHFeature::total_peak_area
double total_peak_area
Definition: SHFeature.h:78
OpenMS::MS2Feature
Definition: MS2Feature.h:55
OpenMS::SHFeature::featureExtraInformation
std::string featureExtraInformation
Definition: SHFeature.h:99
OpenMS::SHFeature::MS2_SCANS
std::map< double, std::vector< MS2Info > > MS2_SCANS
Definition: SHFeature.h:70
OpenMS::SHFeature::feature_ID
int feature_ID
Definition: SHFeature.h:133
OpenMS::MS2Info
Definition: MS2Info.h:58
OpenMS::SHFeature::TR_END
double TR_END
Definition: SHFeature.h:131
OpenMS::SHFeature::_MONO_O
static double _MONO_O
Definition: SHFeature.h:107
OpenMS::SHFeature::_MONO_H
static double _MONO_H
Definition: SHFeature.h:106
FeatureLCProfile.h
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::SHFeature::spectrum_ID
int spectrum_ID
Definition: SHFeature.h:94
OpenMS::SHFeature::PI
double PI
Definition: SHFeature.h:90
OpenMS::SHFeature::SignalToNoise
double SignalToNoise
Definition: SHFeature.h:81
OpenMS::SHFeature::alignment_error_up
double alignment_error_up
Definition: SHFeature.h:86
OpenMS::SHFeature::MASTER_ID
int MASTER_ID
Definition: SHFeature.h:95
OpenMS::SHFeature::MONO_MZ
double MONO_MZ
Definition: SHFeature.h:129
OpenMS::SHFeature::MS2TraceFeature
MS2Feature * MS2TraceFeature
Definition: SHFeature.h:121
OpenMS::FeatureLCProfile
Definition: FeatureLCProfile.h:66
OpenMS::SHFeature::feature_match_status
bool feature_match_status
Definition: SHFeature.h:89
OpenMS::SHFeature::MONO_MZ_END
double MONO_MZ_END
Definition: SHFeature.h:116
OpenMS::SHFeature::TR_APEX
double TR_APEX
Definition: SHFeature.h:114
OpenMS::SHFeature::apex_peak_intensity
double apex_peak_intensity
Definition: SHFeature.h:79
KDTree::operator==
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806