Spec AnnotationTreeIterator
Iterator of the annotation tree represetned by a FragmentStore.

Extends Iter
All Extended Iter
All Impl'd IteratorAssociatedTypesConcept
Defined in <seqan/store.h>
Signature template <typename TFragmentStore> class Iter<TFragmentStore, AnnotationTree<> >;

Template Parameters

TFragmentStore The FragmentStore to iterate over.

Member Function Overview

Interface Function Overview

Interface Functions Inherited From IteratorAssociatedTypesConcept

Interface Metafunction Overview

Interface Metafunctions Inherited From Iter

Interface Metafunctions Inherited From IteratorAssociatedTypesConcept

Detailed Description

This iterator can move down, right, and up in the tree and supports a preorder DFS traversal using the functions goBegin, goNext, and atEnd.

Preorder means that the iterator visits the node befor it visits its children.

To obtain the type of the AnnotationTreeIterator for a FragmentStore specializiation TFragmentStore, you can use the metafunction Iterator as follows: Iterator<TFragmentStore>::Type.

Remarks

To access the annotation, the iterator points to, use getAnnotation. The annotation id is returned by value.

Example

A new annotation iterator can be instantiated as follows:

FragmentStore<> store;
Iterator<FragmentStore<>, AnnotationTree<> >::Type it;
it = begin(store, AnnotationTree<>());

Or shorter:

FragmentStore<> store;
Iterator<FragmentStore<>, AnnotationTree<> >::Type it(store);

Member Functions Detail

Iter::Iter(); Iter::Iter(store[, startInNode]);

Constructor

Parameters

store The FragmentStore with the annotation tree to iterate.
startInNode Annotation id of the ndoe the iterator should start at. Default: 0, the root node id.

The begin function can also be used to create a tree iterator that starts in the root node:

FragmentStore<> store;
Iterator<FragmentStore<>, AnnotationTree<> >::Type it;
it = begin(store, AnnotationTree<>());

Interface Functions Detail

void assignValueByKey(it, key, value);

Add or update a key-value pair of the current annotation.

Parameters

it The AnnotationTreeIterator to
key The key whose value should be changed. Type: SequenceConcept.
value The value that should be assigned. Type: SequenceConcept.

See Also

void clearValues(it);

Clear all key-value pairs of a given annotation.

Parameters

it The AnnotationTreeIterator to clear all key-value pairs of the current annotation.

See Also

TIter createLeftChild(it);

Create a new leftmost child of the current node and returns an iterator to it.

Parameters

it The AnnotationTreeIterator to create a left child for.

Returns

TIter Iterator to the new child.

See Also

TIter createRightChild(it);

Creates a new rightmost child of the current node and returns an iterator to it.

Parameters

it The AnnotationTreeIterator that was just created.

Returns

TIter Iterator to the new child.

See Also

TIter createSibling(it);

Creates a new right sibling of the current node and return an iterator to it.

Parameters

it The AnnotationTreeIterator to create the sibling for.

Returns

TIter Iterator to the new sibling.

See Also

TAnnotation getAnnotation(it);

Returns the current annotation.

Parameters

it The AnnotationTreeIterator to query for its annotation.

Returns

TAnnotation A reference to the AnnotationStoreElement the iterator points to.

TName getName(it);

Returns the identifier of the current annotation.

Parameters

it An AnnotationTreeIterator to query.

Returns

TName The name of the current annotation. This is a reference to the corresponding position in annotationNameStore.

See Also

TName getParentName(it);

Returns the identifier of the parent node in the annotationt ree of the current annotation.

Parameters

it The AnnotationTreeIterator to get the name for.

Returns

TName The name of the parent of the current annotation. This is a reference to the corresponding value in annotationNameStore.

TSeq getType(it);

Returns the type name of the current annotation.

Parameters

it The AnnotationTreeIterator to query for its type.

Returns

The name of the current annotation, e.g. "exon" or "mRNA". This is a reference to an entry in annotationTypeStore.

See Also

CharString getUniqueName(it);

Returns a unique name of the current annotation.

Parameters

it The AnnotationTreeIterator to query.

Returns

CharString A unique name of the current annotation.

Some annotation file formats do not require that every annotation has a non-empty name. This function returns the name if non-emtpy and otherwise generates one using the type an id.

See Also

bool getValueByKey(it, key, value);

Retrieve a key's value in the current annotation.

Parameters

it The AnnotationTreeIterator for which to retrieve the key.
key The key to get the value for.
value The resulting value.

See Also

bool goDown(it);

Move the iterator down to the leftmost child in the annotation tree.

Parameters

it The AnnotationTreeIterator to move.

Returns

bool true if the iterator could be moved and false otherwise.

See Also

void goNextUp(it);

Go to the next node in preorder DFS skipping the current node's subtree.

Parameters

it The AnnotationTreeIterator to

void goNextUp(it);

Go to the next node in preorder DFS skipping the subtrees of the current node and all of its siblings.

Parameters

it The AnnotationTreeIterator to

bool goRight(it);

Move the iterator right to the next sibling in the annotation tree.

Parameters

it The AnnotationTreeIterator to move.

Returns

bool true if the iterator could be moved and false otherwise.

See Also

void goRoot(it);

Move the iterator down to the tree root.

Parameters

it The AnnotationTreeIterator to move.

void goTo(it, annoId);

Moves the iterator to an arbitrary node giving its annotationId.

Parameters

it The AnnotationTreeIterator to move.
annoId The id of the annotation to move to.

bool goUp(it);

Move the iterator down to the parent in the annotation tree.

Parameters

it The AnnotationTreeIterator to move.

Returns

bool true if the iterator could be moved and false otherwise.

See Also

bool isLastChild(it);

Returns a boolean value that indicates whether the current node is the last child.

Parameters

it The AnnotationTreeIterator to query.

bool isLeaf(it);

Return a boolean indicating whether the annotation is a leaf.

Parameters

it The AnnotationTreeIterator to query.

bool isRoot(it);

Return a boolean indicating whether the annotation is the root.

Parameters

it The AnnotationTreeIterator to query.

TIter nodeDown(it);

Returns a new iterator to the first child node of the current annotation in the annotation tree.

Parameters

it The AnnotationTreeIterator to query.

Returns

TIter Iterator to the first child node of it.

See Also

TIter nodeRight(it);

Returns a new iterator to the right sibling of the current annotation in the annotation tree.

Parameters

it The AnnotationTreeIterator to query.

Returns

TIter Iterator to the right sibling of it.

See Also

TIter nodeUp(it);

Returns a new iterator to the parent node of the current annotation in the annotation tree.

Parameters

it The AnnotationTreeIterator to query.

Returns

TIter Iterator to the parent node.

See Also

void setName(it, name);

Sets the identifier of the current annotation.

Parameters

it Iterator to the annotation to set the name for.
name The new identifier of the annotation pointed to by it.

See Also

void setType(it, typeName);

Sets the type name of the current annotation.

Parameters

it The iterator to the annotation to set the type name for.
typeName The name of the type (e.g. "exon" or "mRNA"). Type: SequenceConcept.

See Also