Class Specialization
VSTree Iterator
Abstract iterator for suffix trees.
Iter<TContainer, VSTree<TSpec> >
Include Headers
seqan/index.h
Parameters
TContainer
Type of the container that can be iterated.
Metafunctions: Container
TSpec
The specialization type.
Remarks
This iterator is a pointer to a node in the suffix tree (given by the enhanced suffix array IndexEsa). Every node can uniquely be mapped to an interval of the suffix array containing all suffixes of the node's subtree. This interval and some extra information constitute the VertexDescriptor returned by the value function of the iterator.
Specialization of
Specializations
BottomUp IteratorIterator for an efficient postorder depth-first search in a suffix tree.
TopDown IteratorIterator for virtual trees that can go down and right beginning from the root.
Metafunctions
ContainerType of the container given an iterator. (Iter)
DifferenceType of an object that stores the difference between two iterators. (Iter)
GetValueType for reading values. (Iter)
IteratorType of iterator objects that are used to traverse the container. (Iter)
PositionType of an object that represents a position in a container. (Iter)
ReferenceReference type. (Iter)
SpecThe spec of a class. (Iter)
ValueType of the items in the container or behind an iterator. (Iter)
Functions
alignmentReturns an alignment of the occurrences of the representative substring in the index text.
assignValueAssigns value to item. (Iter)
atBeginDetermines whether an iterator is at the beginning position. (Iter)
atEndDetermines whether an iterator is at the end position. (Iter)
atEndOfSequenceReturns true if the iterator is at the end of a sequence. (Iter)
beginReturns an iterator pointing to the root node of the virtual string tree/trie of an index. The only exception are Postorder iterators, where begin returns an iterator pointing to the leftmost node in the tree/trie.
childrenAreLeavesTest whether iterator points to a node with only leaf-children.
containerContainer of an iterator.
countChildrenCount the number of children of a tree node.
countOccurrencesReturns the number of occurrences of representative substring or a q-gram in the index text.
differenceThe difference between two iterators. (Iter)
getFrequencyReturns the number of sequences, which contain the representative as a substring.
getOccurrenceReturns an occurrence of the representative substring or a q-gram in the index text.
getOccurrencesReturns all occurrences of the representative substring or a q-gram in the index text.
getOccurrencesBwtReturns the characters left beside all occurrence of the representative substring in the index text.
getValueAccess to the value. (Iter)
goBeginIterates to the first position of a container. (Iter)
goEndIterates to the last position of a container. (Iter)
goFurtherIterates some steps further. (Iter)
goNextIterates to next position. (Iter)
goPreviousIterates to pevious position. (Iter)
isLeafTest whether a tree iterator points to a leaf.
isLeftMaximalTest whether the occurrences of an iterator's representative mutually differ in the character left of the hits.
isPartiallyLeftExtensibleTest whether the characters left of the two occurrences of representative are equal.
isRightTerminalTest whether iterator points to a suffix.
isRootTest whether a tree iterator points to the root node.
isUniqueTest whether the representative occurs only once in every sequence.
moveValueAssigns value to item. (Iter)
nodeHullPredicateIf false this node and its subtree is concealed.
nodePredicateIf false this node will be skipped during the bottom-up traversal.
positionPosition of an iterator. (Iter)
rangeReturns the suffix array interval borders of occurrences of representative substring or a q-gram in the index text.
repLengthReturns the length of the substring representing the path from root to iterator node.
representativeReturns a substring representing the path from root to iterator node.
valueReference to the value.
Examples
This code shows how an index can be used with iterators to achieve a pre-order tree like traversal in DFS of the text "tobeornottobe". In order to do so a Top-Down History iterator is used.
1#include <seqan/index.h>
2
3using namespace seqan;
4
5int main ()
6{
7    typedef Index<CharString> TIndex;
8
9    TIndex index("tobeornottobe");
10    Iterator<TIndex, TopDown<ParentLinks<> > >::Type it(index);
11
12    do {
13        // Print theletters from the root to the current node
14        std::cout << representative(it) << std::endl;
15
16        if (!goDown(it) && !goRight(it))
17            while (goUp(it) && !goRight(it)) ;
18    } while (!isRoot(it));
19
20    return 0;
21}
be
beornottobe
e
eornottobe
nottobe
o
obe
obeornottobe
ornottobe
ottobe
rnottobe
t
tobe
tobeornottobe
ttobe
SeqAn - Sequence Analysis Library - www.seqan.de
 

Page built @2013/07/11 09:12:39