Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
PrecursorIonSelectionPreprocessing.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: Alexandra Zerck $
32 // $Authors: $
33 // --------------------------------------------------------------------------
34 //
35 
36 #ifndef OPENMS_ANALYSIS_TARGETED_PRECURSORIONSELECTIONPREPROCESSING_H
37 #define OPENMS_ANALYSIS_TARGETED_PRECURSORIONSELECTIONPREPROCESSING_H
38 
43 
44 #include <algorithm>
45 #include <cmath>
46 #include <set>
47 #include <fstream>
48 namespace OpenMS
49 {
50 
56  class OPENMS_DLLAPI PrecursorIonSelectionPreprocessing :
57  public DefaultParamHandler
58  {
59 public:
63 
65 
66 
67  const std::map<String, std::vector<DoubleReal> > & getProtMasses() const;
68 
69 
70  const std::vector<DoubleReal> & getMasses(String acc) const;
71 
72  const std::map<String, std::vector<DoubleReal> > & getProteinRTMap() const;
73  const std::map<String, std::vector<DoubleReal> > & getProteinPTMap() const;
74  const std::map<String, std::vector<String> > & getProteinPeptideSequenceMap() const;
75 
76 
86  void dbPreprocessing(String db_path, bool save = true);
87 
99  void dbPreprocessing(String db_path, String rt_model_path, String dt_model_path, bool save = true);
100 
101 
109  void loadPreprocessing();
110 
112  DoubleReal getWeight(DoubleReal mass);
113 
114  DoubleReal getRT(String prot_id, Size peptide_index);
115 
116  DoubleReal getPT(String prot_id, Size peptide_index);
117 
118  void setFixedModifications(StringList & modifications);
119  const std::map<char, std::vector<String> > & getFixedModifications()
120  {
121  return fixed_modifications_;
122  }
123 
124  void setGaussianParameters(DoubleReal mu, DoubleReal sigma);
126  {
127  return mu_;
128  }
129 
131  {
132  return sigma_;
133  }
134 
135  DoubleReal getRTProbability(String prot_id, Size peptide_index, Feature & feature);
136  DoubleReal getRTProbability(DoubleReal pred_rt, Feature & feature);
137 
138 protected:
140  void savePreprocessedDB_(String db_path, String path);
141  void savePreprocessedDBWithRT_(String db_path, String path);
143  void loadPreprocessedDB_(String path);
145  void filterTaxonomyIdentifier_(FASTAFile::FASTAEntry & entry);
146  Int getScanNumber_(DoubleReal rt);
147  DoubleReal getRTProbability_(DoubleReal min_obs_rt, DoubleReal max_obs_rt, DoubleReal pred_rt);
149  void updateMembers_();
150 
152  std::vector<DoubleReal> masses_;
154  std::set<AASequence> sequences_;
156  std::map<String, std::vector<DoubleReal> > prot_masses_;
158  std::vector<DoubleReal> bin_masses_;
160  std::vector<UInt> counter_;
163 
165  std::map<String, std::vector<DoubleReal> > rt_prot_map_;
166  std::map<String, std::vector<DoubleReal> > pt_prot_map_;
167  std::map<String, std::vector<String> > prot_peptide_seq_map_;
168  std::map<char, std::vector<String> > fixed_modifications_;
171 
172 
173  };
174 }
175 
176 #endif //#ifndef OPENMS_ANALYSIS_ID_PRECURSORIONSELECTIONPREPROCESSING_H
std::vector< UInt > counter_
counter for the bins
Definition: PrecursorIonSelectionPreprocessing.h:160
DoubleReal getGaussSigma()
Definition: PrecursorIonSelectionPreprocessing.h:130
A more convenient string class.
Definition: String.h:56
std::vector< DoubleReal > bin_masses_
the masses of the bins used for preprocessing (only used if bins are not equidistant, i.e. with ppm)
Definition: PrecursorIonSelectionPreprocessing.h:158
DoubleReal sigma_
Definition: PrecursorIonSelectionPreprocessing.h:169
std::map< String, std::vector< String > > prot_peptide_seq_map_
Definition: PrecursorIonSelectionPreprocessing.h:167
std::set< AASequence > sequences_
the sequences of the tryptic peptides
Definition: PrecursorIonSelectionPreprocessing.h:154
DoubleReal mu_
Definition: PrecursorIonSelectionPreprocessing.h:170
DoubleReal getGaussMu()
Definition: PrecursorIonSelectionPreprocessing.h:125
This class implements the database preprocessing needing for precursor ion selection.
Definition: PrecursorIonSelectionPreprocessing.h:56
An LC-MS feature.
Definition: Feature.h:66
UInt f_max_
maximal relative frequency of a mass
Definition: PrecursorIonSelectionPreprocessing.h:162
bool fixed_mods_
Definition: PrecursorIonSelectionPreprocessing.h:164
std::map< char, std::vector< String > > fixed_modifications_
Definition: PrecursorIonSelectionPreprocessing.h:168
std::map< String, std::vector< DoubleReal > > rt_prot_map_
Definition: PrecursorIonSelectionPreprocessing.h:165
std::map< String, std::vector< DoubleReal > > pt_prot_map_
Definition: PrecursorIonSelectionPreprocessing.h:166
String list.
Definition: StringList.h:56
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:144
FASTA entry type (identifier, description and sequence)
Definition: FASTAFile.h:61
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:90
std::vector< DoubleReal > masses_
all tryptic masses of the distinct peptides in the database
Definition: PrecursorIonSelectionPreprocessing.h:152
int Int
Signed integer type.
Definition: Types.h:100
const std::map< char, std::vector< String > > & getFixedModifications()
Definition: PrecursorIonSelectionPreprocessing.h:119
std::map< String, std::vector< DoubleReal > > prot_masses_
stores masses of tryptic peptides for proteins, key is the accession number
Definition: PrecursorIonSelectionPreprocessing.h:156

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