35 #ifndef OPENMS_DATASTRUCTURES_SUFFIXARRAYSEQAN_H
36 #define OPENMS_DATASTRUCTURES_SUFFIXARRAYSEQAN_H
55 public std::binary_function<double, double, bool>
77 return f1 < (f2 -
tol_);
89 public std::binary_function<double, double, bool>
112 return (f2 ==
end_) ? f1 <= f2 -
start_ : f1 < f2;
133 typedef seqan::TopDown<seqan::ParentLinks<> >
TIterSpec;
134 typedef seqan::Index<seqan::String<char>, seqan::IndexEsa<TIterSpec> >
TIndex;
135 typedef seqan::Iter<TIndex, seqan::VSTree<TIterSpec> >
TIter;
178 void findSpec(std::vector<std::vector<std::pair<std::pair<SignedSize, SignedSize>,
double> > >& candidates,
const std::vector<double>& spec);
186 bool save(
const String& filename);
195 bool open(
const String& filename);
202 void setTolerance(
double t);
208 double getTolerance()
const;
216 bool isDigestingEnd(
const char aa1,
const char aa2)
const;
223 void setTags(
const std::vector<OpenMS::String>& tags);
229 const std::vector<OpenMS::String>& getTags();
235 void setUseTags(
bool use_tags);
247 void setNumberOfModifications(
Size number_of_mods);
253 Size getNumberOfModifications();
255 void printStatistic();
271 inline void goNextSubTree_(
TIter& it,
double& m, std::stack<double>& allm, std::stack<std::map<double, SignedSize> >& mod_map)
350 inline void goNext_(
TIter& it,
double& m, std::stack<double>& allm, std::stack<std::map<double, SignedSize> >& mod_map)
355 goNextSubTree_(it, m, allm, mod_map);
359 inline void parseTree_(
TIter& it, std::vector<std::pair<SignedSize, SignedSize> >& out_number, std::vector<std::pair<SignedSize, SignedSize> >& edge_length, std::vector<SignedSize>& leafe_depth)
366 if (length(parentEdgeLabel(it)) > 0)
368 if (countChildren(it) > 0)
370 edge_length.push_back(std::pair<SignedSize, SignedSize>(depth, length(parentEdgeLabel(it))));
378 if (countChildren(it) > 0)
380 out_number.push_back(std::pair<SignedSize, SignedSize>(depth, countChildren(it)));
384 leafe_depth.push_back(depth);
390 else if (!goRight(it))
397 edge_length.push_back(std::pair<SignedSize, SignedSize>(depth, le - length(parentEdgeLabel(it))));
401 if (isRoot(it))
return;
421 SignedSize findFirst_(
const std::vector<double>& spec,
double& m);
450 #endif //OPENMS_DATASTRUCTURES_SUFFIXARRAYSEQAN_H
void goNext_(TIter &it, double &m, std::stack< double > &allm, std::stack< std::map< double, SignedSize > > &mod_map)
overwriting goNext from seqan index_esa_stree.h for mass update during suffix array traversal ...
Definition: SuffixArraySeqan.h:350
A more convenient string class.
Definition: String.h:57
Class that uses SEQAN library for a suffix array. It can be used to find peptide Candidates for a MS ...
Definition: SuffixArraySeqan.h:128
void goNextSubTree_(TIter &it, double &m, std::stack< double > &allm, std::stack< std::map< double, SignedSize > > &mod_map)
overwriting goNextSubTree_ from seqan index_esa_stree.h for mass update during suffix array traversal...
Definition: SuffixArraySeqan.h:271
bool use_tags_
if tags are used
Definition: SuffixArraySeqan.h:444
const String & s_
reference to strings for which the suffix array is build
Definition: SuffixArraySeqan.h:436
seqan::Index< seqan::String< char >, seqan::IndexEsa< TIterSpec > > TIndex
Definition: SuffixArraySeqan.h:134
comparator for two doubles with a tolerance value
Definition: SuffixArraySeqan.h:88
double tol_
tolerance
Definition: SuffixArraySeqan.h:446
seqan::Iter< TIndex, seqan::VSTree< TIterSpec > > TIter
Definition: SuffixArraySeqan.h:135
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:128
FloatsWithTolLess(const double &t)
constructor
Definition: SuffixArraySeqan.h:61
int const & start_
start index
Definition: SuffixArraySeqan.h:116
seqan::TopDown< seqan::ParentLinks<> > TIterSpec
Definition: SuffixArraySeqan.h:133
IntsInRangeLess(const int &s, const int &e)
constructor
Definition: SuffixArraySeqan.h:95
bool operator()(double f1, double f2) const
implementation of the '<' operator for two doubles with the tolerance value
Definition: SuffixArraySeqan.h:75
SignedSize number_of_modifications_
number of allowed modifications
Definition: SuffixArraySeqan.h:440
void goNextSubTree_(TIter &it)
goes to the next sub tree
Definition: SuffixArraySeqan.h:315
int const & end_
end index
Definition: SuffixArraySeqan.h:117
WEIGHTMODE
Definition: WeightWrapper.h:55
double const & tol_
tolerance value
Definition: SuffixArraySeqan.h:81
Definition: WeightWrapper.h:55
IntsInRangeLess(const IntsInRangeLess &source)
copy constructor
Definition: SuffixArraySeqan.h:100
comparator for two doubles with a tolerance value
Definition: SuffixArraySeqan.h:54
std::vector< String > tags_
all tags
Definition: SuffixArraySeqan.h:442
void parseTree_(TIter &it, std::vector< std::pair< SignedSize, SignedSize > > &out_number, std::vector< std::pair< SignedSize, SignedSize > > &edge_length, std::vector< SignedSize > &leafe_depth)
Definition: SuffixArraySeqan.h:359
TIndex index_
seqan suffix array
Definition: SuffixArraySeqan.h:410
Encapsulated weight queries to simplify mono vs average weight computation.
Definition: WeightWrapper.h:50
FloatsWithTolLess(const FloatsWithTolLess &rhs)
copy constructor
Definition: SuffixArraySeqan.h:66
bool operator()(int f1, int f2) const
implementation of the '<' operator for two doubles with the tolerance value
Definition: SuffixArraySeqan.h:109
String toString(T i)
toString functions (single argument)
Definition: StringUtils.h:68
TIter it_
seqan suffix array iterator
Definition: SuffixArraySeqan.h:412
abstract class for suffix array
Definition: SuffixArray.h:50