Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifndef OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCMS_H
00046 #define OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCMS_H
00047
00048 #include <string>
00049 #include <vector>
00050 #include <map>
00051
00052 namespace OpenMS
00053 {
00054
00055 class OPENMS_DLLAPI LCMS
00056 {
00057
00059
00060
00061 private:
00062
00063
00064 std::string spec_name;
00065
00066
00067 std::vector<SHFeature> feature_list;
00068
00069
00070 int spectrum_id;
00071
00072
00073 int MASTER_ID;
00074
00075
00076 std::map<int, std::string> raw_spec_names;
00077
00078
00079 std::map<double, std::pair<double, double> > ALIGNMENT_ERROR;
00080
00082
00083
00084 public:
00085
00086 static double MINIMAL_PEP_PROPHET_THERSHOLD;
00087
00088
00089
00090 ~LCMS();
00091
00092
00093 LCMS(std::string);
00094 LCMS();
00095
00096 LCMS(const LCMS *);
00097
00098
00099 LCMS(const LCMS &);
00100
00101
00102 void show_info();
00103
00104
00105 LCMS & operator=(const LCMS &);
00106
00107
00108 void order_by_mass();
00109
00110
00111 float compare_feature_mass(const void *, const void *);
00112
00113
00114
00115 struct OPERATOR_MZ
00116 {
00117
00118 bool operator()(const SHFeature A, const SHFeature B) const
00119 {
00120
00121 if (A.MONO_MZ == B.MONO_MZ)
00122 {
00123 return A.TR < B.TR;
00124 }
00125 else
00126 {
00127 return A.MONO_MZ < B.MONO_MZ;
00128 }
00129 }
00130
00131 };
00132
00133
00134
00135 struct OPERATOR_FeatureCompare
00136 {
00137
00138 bool operator()(const SHFeature A, const SHFeature B) const
00139 {
00140
00141 if (A.feature_ID == B.feature_ID)
00142 {
00143 return true;
00144 }
00145 else
00146 {
00147 return false;
00148 }
00149 }
00150
00151 };
00152
00153
00154 void tag_peaks_with_spectrum_ID()
00155 {
00156 std::vector<SHFeature>::iterator p = feature_list.begin();
00157 while (p != feature_list.end())
00158 {
00159 (*p).set_spectrum_ID(get_spectrum_ID());
00160 p++;
00161 }
00162 }
00163
00164
00165 int get_nb_common_peaks(int);
00166
00168
00169
00170
00171
00172
00173 void clear_feature_list()
00174 { return feature_list.clear(); }
00175 std::vector<SHFeature> get_feature_list()
00176 { return feature_list; }
00177 std::vector<SHFeature> * get_feature_list_reference()
00178 { return &feature_list; }
00179 bool check_feature_list_empty()
00180 { return feature_list.empty(); }
00181
00182
00183 std::vector<SHFeature>::iterator get_feature_list_begin()
00184 { return feature_list.begin(); }
00185 std::vector<SHFeature>::iterator get_feature_list_end()
00186 { return feature_list.end(); }
00187
00188
00189 void add_feature(SHFeature * IN)
00190 {
00191
00192 if (IN->get_feature_ID() == -1)
00193 {
00194 IN->set_feature_ID((int) feature_list.size());
00195 }
00196 feature_list.push_back(*IN);
00197 IN = NULL;
00198 }
00199
00200
00201 void remove_feature_by_ID(SHFeature *);
00202 void remove_feature_by_ID(int);
00203
00204 void remove_feature(SHFeature *);
00205 void remove_feature(int i)
00206 {
00207 if (i < int(feature_list.size()))
00208 {
00209 feature_list.erase(feature_list.begin() + i);
00210 }
00211 }
00212
00213
00214 std::vector<SHFeature>::iterator remove_feature_from_list(std::vector<SHFeature>::iterator IN)
00215 { return feature_list.erase(IN); }
00216
00217
00218 unsigned int get_nb_features()
00219 { return (unsigned int) feature_list.size(); }
00220
00221 std::string get_spec_name()
00222 { return spec_name; }
00223 void set_spec_name(std::string IN)
00224 { spec_name = IN; }
00225
00226
00227 int get_spectrum_ID()
00228 { return spectrum_id; }
00229 void set_spectrum_ID(int IN)
00230 { spectrum_id = IN; }
00231
00232
00233 void setFeatureLCMSID();
00234
00235
00236 SHFeature * find_feature_by_ID(int);
00237
00238
00239 void remove_raw_spec_name(int ID)
00240 { raw_spec_names.erase(ID); }
00241 void add_raw_spec_name(int ID, std::string name)
00242 { raw_spec_names.insert(make_pair(ID, name)); }
00243 bool check_raw_spec_name_empty()
00244 { return raw_spec_names.empty(); }
00245 std::map<int, std::string>::iterator get_raw_spec_name_start()
00246 { return raw_spec_names.begin(); }
00247 std::map<int, std::string>::iterator get_raw_spec_name_end()
00248 { return raw_spec_names.end(); }
00249 std::map<int, std::string> get_raw_spec_name_map()
00250 { return raw_spec_names; }
00251 int get_nb_raw_specs()
00252 { return (int) raw_spec_names.size(); }
00253 std::string get_raw_spec_name(int ID)
00254 {
00255 std::map<int, std::string>::iterator p = raw_spec_names.find(ID);
00256 if (p == raw_spec_names.end())
00257 {
00258 return "";
00259 }
00260 return (*p).second;
00261 }
00262
00263
00264 bool check_LCMS_name(std::string);
00265
00266
00267 bool find_LC_MS_by_ID(int);
00268
00269
00270 void add_raw_spec_name_map(std::map<int, std::string> IN)
00271 {
00272 std::map<int, std::string>::iterator p = IN.begin();
00273 while (p != IN.end())
00274 {
00275 int ID = (*p).first;
00276 std::map<int, std::string>::iterator F = raw_spec_names.find(ID);
00277 if (F != raw_spec_names.end())
00278 {
00279 ID += (int) raw_spec_names.size();
00280 }
00281 raw_spec_names.insert(make_pair(ID, (*p).second));
00282 p++;
00283 }
00284 }
00285
00286
00287 int get_nb_identified_features()
00288 {
00289 int count = 0;
00290 std::vector<SHFeature>::iterator P = get_feature_list_begin();
00291 while (P != get_feature_list_end())
00292 {
00293 if ((*P).get_MS2_info())
00294 count++;
00295 P++;
00296 }
00297 return count;
00298 }
00299
00300
00301 int get_nb_identified_features(double PepProb_T)
00302 {
00303 int count = 0;
00304 std::vector<SHFeature>::iterator P = get_feature_list_begin();
00305 while (P != get_feature_list_end())
00306 {
00307 if ((*P).get_MS2_info(PepProb_T))
00308 count++;
00309 P++;
00310 }
00311 return count;
00312 }
00313
00315
00316
00317 void add_alignment_error(double TR, double ERROR_UP, double ERROR_DOWN)
00318 {
00319 std::pair<double, double> tmp(ERROR_UP, ERROR_DOWN);
00320 ALIGNMENT_ERROR.insert(std::pair<double, std::pair<double, double> >(TR, tmp));
00321 }
00322
00323
00324 void get_alignment_error(double, double *, double *);
00325
00326
00327 void set_MASTER_ID(int IN)
00328 { MASTER_ID = IN; }
00329 int get_MASTER_ID()
00330 { return MASTER_ID; }
00331 };
00332
00333 }
00334
00335 #endif // OPENMS_TRANSFORMATIONS_FEATUREFINDER_SUPERHIRN_LCMS_H