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

SuffixArrayTrypticCompressed.h (Maintainer: Chris Bauer)

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // --------------------------------------------------------------------------
00005 //                   OpenMS Mass Spectrometry Framework
00006 // --------------------------------------------------------------------------
00007 //  Copyright (C) 2003-2008 -- Oliver Kohlbacher, Knut Reinert
00008 //
00009 //  This library is free software; you can redistribute it and/or
00010 //  modify it under the terms of the GNU Lesser General Public
00011 //  License as published by the Free Software Foundation; either
00012 //  version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //  This library is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //  Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with this library; if not, write to the Free Software
00021 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 // --------------------------------------------------------------------------
00024 // $Maintainer: Chris Bauer$
00025 // --------------------------------------------------------------------------
00026 
00027 
00028 #ifndef OPENMS_DATASTRUCTURES_SUFFIXARRAYTRYPTICCOMPRESSED_H
00029 #define OPENMS_DATASTRUCTURES_SUFFIXARRAYTRYPTICCOMPRESSED_H
00030 
00031 #include <OpenMS/CONCEPT/Exception.h>
00032 #include <OpenMS/DATASTRUCTURES/SuffixArray.h>
00033 
00034 
00035 namespace OpenMS {
00036   class String;
00037 
00045 class SuffixArrayTrypticCompressed : public SuffixArray {
00046   
00047 public:
00048 
00057   SuffixArrayTrypticCompressed(const String& st, const String& sa_file_name) throw (Exception::InvalidValue, Exception::FileNotFound);
00058 
00062   SuffixArrayTrypticCompressed(const SuffixArrayTrypticCompressed & sa);
00063 
00067   virtual ~SuffixArrayTrypticCompressed();
00068 
00072   String toString();
00073 
00082   void findSpec(std::vector<std::vector<std::pair<std::pair<int, int>, float > > >& candidates, const std::vector<double> & spec) throw (Exception::InvalidValue);
00083 
00090   bool save(const String& file_name) throw (Exception::UnableToCreateFile);
00097   bool open(const String& file_name) throw (Exception::FileNotFound);
00098 
00104   void setTolerance(double t) throw (Exception::InvalidValue);
00105 
00110   double getTolerance() const;
00111 
00118   bool isDigestingEnd(const char aa1, const char aa2) const;
00119 
00125   void setTags(const std::vector<String>& tags) throw (Exception::InvalidValue);
00126 
00131   const std::vector<String>& getTags ();
00132 
00137   void setUseTags(bool use_tags);
00138 
00143   bool getUseTags();
00144 
00149   void setNumberOfModifications(unsigned int number_of_mods);
00150 
00155   unsigned int getNumberOfModifications ();
00156 
00160   void printStatistic ();
00161 
00162 protected:
00163 
00167   SuffixArrayTrypticCompressed();
00168 
00174   int getNextSep_(const int p) const;
00175 
00182   int getLCP_(const std::pair<int, int>& last_point, const std::pair<int, int>& current_point);
00183 
00191   int findFirst_(const std::vector<double>& spec, double& m);
00192 
00202   int findFirst_(const std::vector<double>& spec, double& m, int start, int end);
00203 
00216   void parseTree_(int start_index, int stop_index, int depth, int walked_in, int edge_len, std::vector<std::pair<int,int> >& out_number, std::vector<std::pair<int,int> >& edge_length, std::vector<int>& leafe_depth);
00217   
00224   bool hasMoreOutgoings_(int start_index, int stop_index, int walked_in);
00225 
00226   const String& s_; 
00227 
00228   double tol_; 
00229   
00230   std::vector<std::pair<int,int> > indices_; 
00231 
00232   std::vector<int> lcp_; 
00233 
00234   std::vector<int> skip_; 
00235 
00236   //const int getIndex_ (const String & s);
00237 
00238   double masse_[256]; 
00239 
00240   int number_of_modifications_; 
00241 
00242   std::vector<String> tags_; 
00243 
00244   bool use_tags_ ; 
00245 
00246   int progress_;
00247 };
00248 }
00249 
00250 #endif //OPENMS_DATASTRUCTURES_SUFFIXARRAYTRYPTICCOMPRESSED_H

Generated Tue Apr 1 15:36:38 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1