Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
SuffixArrayTrypticCompressed.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-2015.
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: Clemens Groepl,Andreas Bertsch$
32 // $Authors: Chris Bauer $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_DATASTRUCTURES_SUFFIXARRAYTRYPTICCOMPRESSED_H
36 #define OPENMS_DATASTRUCTURES_SUFFIXARRAYTRYPTICCOMPRESSED_H
37 
40 
41 #include <OpenMS/CONCEPT/Types.h>
42 #include <OpenMS/OpenMSConfig.h>
43 
44 namespace OpenMS
45 {
46  class String;
47 
63  class OPENMS_DLLAPI SuffixArrayTrypticCompressed :
64  public SuffixArray
65  , public WeightWrapper
66  {
67 
68 public:
69 
86  SuffixArrayTrypticCompressed(const String& st, const String& filename, const WeightWrapper::WEIGHTMODE weight_mode = WeightWrapper::MONO);
87 
92 
97 
101  String toString();
102 
116  void findSpec(std::vector<std::vector<std::pair<std::pair<SignedSize, SignedSize>, double> > >& candidates, const std::vector<double>& spec);
117 
124  bool save(const String& file_name);
131  bool open(const String& file_name);
132 
138  void setTolerance(double t);
139 
144  double getTolerance() const;
145 
152  bool isDigestingEnd(const char aa1, const char aa2) const;
153 
159  void setTags(const std::vector<String>& tags);
160 
165  const std::vector<String>& getTags();
166 
171  void setUseTags(bool use_tags);
172 
177  bool getUseTags();
178 
183  void setNumberOfModifications(Size number_of_mods);
184 
189  Size getNumberOfModifications();
190 
194  void printStatistic();
195 
196 protected:
197 
202 
208  SignedSize getNextSep_(const SignedSize p) const;
209 
216  SignedSize getLCP_(const std::pair<SignedSize, SignedSize>& last_point, const std::pair<SignedSize, SignedSize>& current_point);
217 
225  SignedSize findFirst_(const std::vector<double>& spec, double& m);
226 
238  SignedSize findFirst_(const std::vector<double>& spec, double& m, SignedSize start, SignedSize end);
239 
252  void parseTree_(SignedSize start_index, SignedSize stop_index, SignedSize depth, SignedSize walked_in, SignedSize edge_len, std::vector<std::pair<SignedSize, SignedSize> >& out_number, std::vector<std::pair<SignedSize, SignedSize> >& edge_length, std::vector<SignedSize>& leafe_depth);
253 
260  bool hasMoreOutgoings_(SignedSize start_index, SignedSize stop_index, SignedSize walked_in);
261 
262  const String& s_;
263 
264  double tol_;
265 
266  std::vector<std::pair<SignedSize, SignedSize> > indices_;
267 
268  std::vector<SignedSize> lcp_;
269 
270  std::vector<SignedSize> skip_;
271 
272  //const SignedSize getIndex_ (const String & s);
273 
274  double masse_[256];
275 
277 
278  std::vector<String> tags_;
279 
280  bool use_tags_;
281 
283  };
284 }
285 
286 #endif //OPENMS_DATASTRUCTURES_SUFFIXARRAYTRYPTICCOMPRESSED_H
std::vector< SignedSize > lcp_
vector of ints with lcp values
Definition: SuffixArrayTrypticCompressed.h:268
A more convenient string class.
Definition: String.h:57
SignedSize progress_
Definition: SuffixArrayTrypticCompressed.h:282
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:128
std::vector< std::pair< SignedSize, SignedSize > > indices_
vector of pairs of ints describing all relevant suffixes
Definition: SuffixArrayTrypticCompressed.h:266
bool use_tags_
indicates whether tags are used or not
Definition: SuffixArrayTrypticCompressed.h:280
double tol_
mass tolerance for finding candidates
Definition: SuffixArrayTrypticCompressed.h:264
WEIGHTMODE
Definition: WeightWrapper.h:55
std::vector< String > tags_
all given tags
Definition: SuffixArrayTrypticCompressed.h:278
Size number_of_modifications_
number of allowed modifications
Definition: SuffixArrayTrypticCompressed.h:276
Definition: WeightWrapper.h:55
const String & s_
the string with which the suffix array is build
Definition: SuffixArrayTrypticCompressed.h:262
Encapsulated weight queries to simplify mono vs average weight computation.
Definition: WeightWrapper.h:50
String toString(T i)
toString functions (single argument)
Definition: StringUtils.h:68
std::vector< SignedSize > skip_
vector of ints with skip values
Definition: SuffixArrayTrypticCompressed.h:270
Class that implements a suffix array for a String. It can be used to find peptide Candidates for a MS...
Definition: SuffixArrayTrypticCompressed.h:63
abstract class for suffix array
Definition: SuffixArray.h:50

OpenMS / TOPP release 2.0.0 Documentation generated on Wed Mar 30 2016 16:18:42 using doxygen 1.8.5