Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

PrecursorIonSelectionPreprocessing.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------------
00002 //                   OpenMS -- Open-Source Mass Spectrometry
00003 // --------------------------------------------------------------------------
00004 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
00005 // ETH Zurich, and Freie Universitaet Berlin 2002-2012.
00006 //
00007 // This software is released under a three-clause BSD license:
00008 //  * Redistributions of source code must retain the above copyright
00009 //    notice, this list of conditions and the following disclaimer.
00010 //  * Redistributions in binary form must reproduce the above copyright
00011 //    notice, this list of conditions and the following disclaimer in the
00012 //    documentation and/or other materials provided with the distribution.
00013 //  * Neither the name of any author or any participating institution
00014 //    may be used to endorse or promote products derived from this software
00015 //    without specific prior written permission.
00016 // For a full list of authors, refer to the file AUTHORS.
00017 // --------------------------------------------------------------------------
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
00022 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // --------------------------------------------------------------------------
00031 // $Maintainer: Alexandra Zerck $
00032 // $Authors: $
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

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:43 using doxygen 1.7.1