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
00035
00036 #ifndef OPENMS_ANALYSIS_TARGETED_PRECURSORIONSELECTIONPREPROCESSING_H
00037 #define OPENMS_ANALYSIS_TARGETED_PRECURSORIONSELECTIONPREPROCESSING_H
00038
00039 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
00040 #include <OpenMS/CHEMISTRY/AASequence.h>
00041 #include <OpenMS/FORMAT/FASTAFile.h>
00042 #include <OpenMS/KERNEL/FeatureMap.h>
00043
00044 #include <algorithm>
00045 #include <cmath>
00046 #include <set>
00047 #include <fstream>
00048 namespace OpenMS
00049 {
00050
00056 class OPENMS_DLLAPI PrecursorIonSelectionPreprocessing :
00057 public DefaultParamHandler
00058 {
00059 public:
00060 PrecursorIonSelectionPreprocessing();
00061 PrecursorIonSelectionPreprocessing(const PrecursorIonSelectionPreprocessing & source);
00062 ~PrecursorIonSelectionPreprocessing();
00063
00064 PrecursorIonSelectionPreprocessing & operator=(const PrecursorIonSelectionPreprocessing & source);
00065
00066
00067 const std::map<String, std::vector<DoubleReal> > & getProtMasses() const;
00068
00069
00070 const std::vector<DoubleReal> & getMasses(String acc) const;
00071
00072 const std::map<String, std::vector<DoubleReal> > & getProteinRTMap() const;
00073 const std::map<String, std::vector<DoubleReal> > & getProteinPTMap() const;
00074 const std::map<String, std::vector<String> > & getProteinPeptideSequenceMap() const;
00075
00076
00086 void dbPreprocessing(String db_path, bool save = true);
00087
00099 void dbPreprocessing(String db_path, String rt_model_path, String dt_model_path, bool save = true);
00100
00101
00109 void loadPreprocessing();
00110
00112 DoubleReal getWeight(DoubleReal mass);
00113
00114 DoubleReal getRT(String prot_id, Size peptide_index);
00115
00116 DoubleReal getPT(String prot_id, Size peptide_index);
00117
00118 void setFixedModifications(StringList & modifications);
00119 const std::map<char, std::vector<String> > & getFixedModifications()
00120 {
00121 return fixed_modifications_;
00122 }
00123
00124 void setGaussianParameters(DoubleReal mu, DoubleReal sigma);
00125 DoubleReal getGaussMu()
00126 {
00127 return mu_;
00128 }
00129
00130 DoubleReal getGaussSigma()
00131 {
00132 return sigma_;
00133 }
00134
00135 DoubleReal getRTProbability(String prot_id, Size peptide_index, Feature & feature);
00136 DoubleReal getRTProbability(DoubleReal pred_rt, Feature & feature);
00137
00138 protected:
00140 void savePreprocessedDB_(String db_path, String path);
00141 void savePreprocessedDBWithRT_(String db_path, String path);
00143 void loadPreprocessedDB_(String path);
00145 void filterTaxonomyIdentifier_(FASTAFile::FASTAEntry & entry);
00146 Int getScanNumber_(DoubleReal rt);
00147 DoubleReal getRTProbability_(DoubleReal min_obs_rt, DoubleReal max_obs_rt, DoubleReal pred_rt);
00149 void updateMembers_();
00150
00152 std::vector<DoubleReal> masses_;
00154 std::set<AASequence> sequences_;
00156 std::map<String, std::vector<DoubleReal> > prot_masses_;
00158 std::vector<DoubleReal> bin_masses_;
00160 std::vector<UInt> counter_;
00162 UInt f_max_;
00163
00164 bool fixed_mods_;
00165 std::map<String, std::vector<DoubleReal> > rt_prot_map_;
00166 std::map<String, std::vector<DoubleReal> > pt_prot_map_;
00167 std::map<String, std::vector<String> > prot_peptide_seq_map_;
00168 std::map<char, std::vector<String> > fixed_modifications_;
00169 DoubleReal sigma_;
00170 DoubleReal mu_;
00171
00172
00173 };
00174 }
00175
00176 #endif //#ifndef OPENMS_ANALYSIS_ID_PRECURSORIONSELECTIONPREPROCESSING_H