Spec IndexEsa
An index based on an enhanced suffix array.

Extends Index
Implements StringTreeConcept
All Extended Index
All Impl'd StringTreeConcept
Defined in <seqan/index.h>
Signature template <typename TText, typename TSpec> class Index<TText, IndexEsa<TSpec> >;

Template Parameters

TText The text type.
TSpec The specialization, defaults to void.

Interface Function Overview

Interface Functions Inherited From Index

Interface Functions Inherited From StringTreeConcept

Interface Metafunction Overview

Interface Metafunctions Inherited From Index

Interface Metafunctions Inherited From StringTreeConcept

Detailed Description

The fibres (see Index and Fibre) of this index are a suffix array (see EsaSA), a lcp table (see EsaLcp), etc.

This index can be accessed as a Suffix Tree using the VSTreeIterator classes.

See Also

Interface Functions Detail

TValue bwtAt(position, index);

Shortcut for value(indexBwt(..), ..).

Parameters

index The IndexEsa object holding the fibre.
position A position in the array on which the value should be accessed.

Returns

TValue A reference or proxy to the value.

TValue childAt(position, index);

Shortcut for value(indexChildtab(..), ..).

Parameters

position A position in the array on which the value should be accessed.
index The IndexEsa object holding the fibre.

Returns

TValue A reference or proxy to the value.

void createChildtab(childTab, lcp[, algoTag]);

Creates a child table from a given lcp table.

Parameters

childTab A reference to the resulting child table.
lcp A given lcp table.
algoTag A tag that identifies the algorithm which is used for the creation.

The size of childTab must be at least length(text) before calling this function.

TBwt indexBwt(index);

Shortcut for getFibre(.., EsaBwt).

Parameters

index The IndexEsa object holding the fibre.

Returns

TBwt A reference to the EsaBwt fibre (Burrows-Wheeler table).

TChildTab indexChildtab(index);

Shortcut for getFibre(.., EsaChildtab).

Parameters

index The Index object holding the fibre.

Returns

TChildTab A reference to the EsaChildtab fibre (child table).

TIsa indexIsa(index);

Shortcut for getFibre(.., EsaIsa).

Parameters

index The Index object holding the fibre.

Returns

TIsa A reference to the inverse suffix array fibre.

TLcp indexLcp(index);

Shortcut for getFibre(.., EsaLcp).

Parameters

index The Index object holding the fibre.

Returns

TLcp A reference to the EsaLcp fibre (lcp table).

TLcpe indexLcpe(index);

Shortcut for getFibre(.., EsaLcpe).

Parameters

index The Index object holding the fibre.

Returns

TLcpe A reference to the EsaLcpe fibre (enhanced lcp table).

TSa indexSA(index);

Shortcut for getFibre(.., EsaSA).

Parameters

index The Index object holding the fibre.

Returns

TSa A reference to the suffix array fibre.

Examples

The following code shows how the BWT of a text can be computed.

#include <seqan/index.h>

using namespace seqan;

int main ()
{
    Index<String<char> > index("MISSISSIPPI");

    // Because indices are build on demand we force the index creation here.
    indexRequire(index, FibreSA());

    std::cout << "BWT\tSuffices" << std::endl;

    for (unsigned i = 0; i < length(indexSA(index)); ++i)
    {
        unsigned textPos = (saAt(i, index) == 0) ? length(index) - 1 : saAt(i, index) - 1;
        std::cout << textAt(textPos, index) << "\t" << suffix(indexText(index), textPos) << std::endl;
    }
    return 0;
}

The output is as follows:

BWT	Suffices
P	PI
S	SIPPI
S	SISSIPPI
M	MISSISSIPPI
I	I
P	PPI
I	IPPI
S	SSIPPI
S	SSISSIPPI
I	ISSIPPI
I	ISSISSIPPI

TValue isaAt(position, index);

Shortcut for value(indexIsa(..), ..).

Parameters

index The Index object holding the fibre.
position A position in the array on which the value should be accessed.

Returns

TValue A reference or proxy to the value in the inverse suffix array.

TValue lcpAt(position, index);

Shortcut for value(indexLcp(..), ..).

Parameters

index The Index object holding the fibre.
position A position in the array on which the value should be accessed.

Returns

TValue A reference or proxy to the value.

TValue lcpeAt(position, index);

Shortcut for value(indexLcpe(..), ..).

Parameters

index The Index object holding the fibre.
position A position in the array on which the value should be accessed.

Returns

TValue A reference or proxy to the value.

TValue saAt(position, index);

Note.

Advanced functionality, not commonly used.

Shortcut for value(indexSA(..), ..).

Parameters

index The Index object holding the fibre.
position A position in the array on which the value should be accessed.

Returns

TValue A reference or proxy to the value in the suffix array. To be more precise, a reference to a position containing a value of type SAValue is returned (or a proxy). SAValue

Examples

The following code shows how the BWT of a text can be computed.

#include <seqan/index.h>

using namespace seqan;

int main ()
{
    Index<String<char> > index("MISSISSIPPI");

    // Because indices are build on demand we force the index creation here.
    indexRequire(index, FibreSA());

    std::cout << "BWT\tSuffices" << std::endl;

    for (unsigned i = 0; i < length(indexSA(index)); ++i)
    {
        unsigned textPos = (saAt(i, index) == 0) ? length(index) - 1 : saAt(i, index) - 1;
        std::cout << textAt(textPos, index) << "\t" << suffix(indexText(index), textPos) << std::endl;
    }
    return 0;
}
BWT	Suffices
P	PI
S	SIPPI
S	SISSIPPI
M	MISSISSIPPI
I	I
P	PPI
I	IPPI
S	SSIPPI
S	SSISSIPPI
I	ISSIPPI
I	ISSISSIPPI