Class Seed
Stores the start and end positions in the horizonal and vertical dimension.

All Subcl's ChainedSeed, SimpleSeed
Defined in <seqan/seeds.h>
Signature template <typename TSpec[, typename TConfig]> class Seed;

Template Parameters

TSpec The seed specialization type.
TConfig The configuration object to use for this seed, defaults to DefaultSeedConfig.

Interface Function Overview

Interface Metafunction Overview

Detailed Description

Examples

The following example shows the usage of three seed extension algorithms using the tags MaxExtend, UnGappedXDrop, and GappedXDrop.

//Examples for three seed extension algorithms.
#include <iostream>
#include <seqan/seeds.h>

using namespace seqan;

int main()
{
    String<char> a = "SEEDabXcdXefXXX";
    String<char> b = "SEEDabYcdefYYYY";

    Seed<Simple> seed1(0, 0, 4);          //left=0; length=4
    extendSeed(seed1, a, b, EXTEND_BOTH, MatchExtend());
    std::cout << "endPositionH(seed1) = " << endPositionH(seed1) << std::endl;
    std::cout << "endPositionV(seed1) = " << endPositionV(seed1) << std::endl;

    Seed<Simple> seed2(0, 0, 4);          //left=0; length=4
    Score<> scoring(1, -1, -1);
    extendSeed(seed2, a, b, EXTEND_BOTH, scoring, 2, UnGappedXDrop());
    std::cout << "endPositionH(seed2) = " << endPositionH(seed2) << std::endl;
    std::cout << "endPositionV(seed2) = " << endPositionV(seed2) << std::endl;

    Seed<Simple> seed3(0, 0, 4);          //left=0; length=4
    extendSeed(seed3, a, b, EXTEND_BOTH, scoring, 2, GappedXDrop());
    std::cout << "endPositionH(seed3) = " << endPositionH(seed3) << std::endl;
    std::cout << "endPositionV(seed3) = " << endPositionV(seed3) << std::endl;

    return 0;
}

The output is as follows:

endPositionH(seed1) = 6
endPositionV(seed1) = 6
endPositionH(seed2) = 9
endPositionV(seed2) = 9
endPositionH(seed3) = 14
endPositionV(seed3) = 13

Here is an example for global seed chaining:

#include <iostream>
#include <seqan/seeds.h>

using namespace seqan;

int main()
{
    // Build SeedSet.
    SeedSet<Seed<Simple>, Unordered> seedSet;
    addSeed(seedSet, Seed<Simple>(0, 93, 281, 342), Single());
    addSeed(seedSet, Seed<Simple>(3, 237, 127, 364), Single());
    addSeed(seedSet, Seed<Simple>(3, 284, 86, 368), Single());
    addSeed(seedSet, Seed<Simple>(5, 146, 239, 374), Single());
    addSeed(seedSet, Seed<Simple>(299, 352, 405, 460), Single());

    // Perform sparse chaining, uses time O(n log n).
    String<Seed<Simple> > chain;
    chainSeedsGlobally(chain, seedSet, SparseChaining());

    // Print results to stdout.
    for (unsigned i = 0; i < length(chain); ++i)
        std::cout << "Seed(" << beginPositionH(chain[i]) << ", "
                  << beginPositionV(chain[i]) << ", " << endPositionH(chain[i])
                  << ", " << endPositionV(chain[i]) << ")\n";

    return 0;
}

Interface Functions Detail

TDiagonal beginDiagonal(seed);

Returns the begin diagonal of a Seed.

Parameters

seed The Seed to query for its begin diagonal.

Returns

TDiagonal The diagonal of the Seed's begin position of type Diagonal.

Data Races

Thread safety unknown!

TPosition beginPositionH(seed);

Returns the begin position of the seed in the database (horizontal direction).

Parameters

seed The seed to query.

Returns

TPosition The horizontal begin position of type Position.

Data Races

Thread safety unknown!

TPosition beginPositionV(seed);

Returns the begin position of the seed in the query (vertical direction).

Parameters

seed The seed to query.

Returns

TPosition The vertical begin position of type Position.

Data Races

Thread safety unknown!

TDiagonal endDiagonal(seed);

Returns the end diagonal of a Seed.

Parameters

seed The Seed to query for its end diagonal.

Returns

TDiagonal The diagonal of the Seed's end position of type Diagonal.

Data Races

Thread safety unknown!

TPosition endPositionH(seed);

Returns the end position of the seed in the database (horizontal direction).

Parameters

seed The seed to query.

Returns

TPosition The horizontal end position of type Position.

Data Races

Thread safety unknown!

TPosition endPositionV(seed);

Returns the end position of the seed in the query (vertical direction).

Parameters

seed The seed to query.

Returns

TPosition The vertical end position of type Position.

Data Races

Thread safety unknown!

void extendSeed(seed, database, query, direction, MatchExtend); void extendSeed(seed, database, query, direction, scoringScheme, scoreDropOff, xDropTag);

Extends a seed.

Parameters

seed The Seed to extend.
database The database (horizontal) sequence.
query The query (vertical) sequence.
direction The extension direction. Type: ExtensionDirection.
scoringScheme The Score object to use for scoring alignments and gaps.
scoreDropOff The score drop after which the extension should stop. The extension stops if this value is exceeded. Only given for when using an x-drop algorithm.
xDropTag Tag for selecting x-drop method, one of UnGappedXDrop and GappedXDrop.

You can use the tags, MatchExtend, UnGappedXDrop, and GappedXDrop.

Note that the diagonals updated in seed do not necessarily reflect the diagonals for the optimal extension but the diagonals used in all traces of the extension. However, they are guaranteed to include the optimal extension's trace.

Examples

The documentation of the class Seed contains an example for seed extension.

Data Races

Thread safety unknown!

See Also

TDiagonal lowerDiagonal(seed);

Returns the leftmost diagonal of the seed (minimum diagonal value).

Parameters

seed The seed to query for its lower diagonal.

Returns

TDiagonal The lower diagonal value of type Diagonal.

Data Races

Thread safety unknown!

TSeedScore score(seed);

Returns the score of a Seed.

Parameters

seed The Seed to query for its score.

Returns

TSeedScore The score value of the seed of type SeedScore.

Data Races

Thread safety unknown!

TSize seedSize(seed);

Returns the number of matches and mismatches of the seed. This is the longest true diagonal fitting into its dimensions.

Parameters

seed The Seed to query for its size.

Returns

TSize The size of the type Size.

Data Races

Thread safety unknown!

void setBeginPositionH(seed, pos);

Sets the begin position of the seed in the database (horizontal direction).

Parameters

seed The Seed to set the horizontal begin position for.
pos The value to set for the horizontal begin position.

Data Races

Thread safety unknown!

void setBeginPositionV(seed, pos);

Sets the begin position of the seed in the query (vertical direction).

Parameters

seed The Seed to set the vertical begin position for.
pos The value to set for the vertical begin position.

Data Races

Thread safety unknown!

void setEndPositionH(seed, pos);

Sets the end position of the seed in the database (horizontal direction).

Parameters

seed The Seed to set the horizontal end position for.
pos The value to set for the horizontal end position.

Data Races

Thread safety unknown!

void setEndPositionV(seed, pos);

Sets the end position of the seed in the query (vertical direction).

Parameters

seed The Seed to set the vertical end position for.
pos The value to set for the vertical end position.

Data Races

Thread safety unknown!

void setLowerDigonal(seed, diag);

Sets a new value for the leftmost diagonal of a seed.

Parameters

seed The Seed to set the diagonal value for.
diag The value to set for the diagonal.

Data Races

Thread safety unknown!

void setScore(seed, scoreVal);

Sets the Seed score value.

Parameters

seed The Seed to set the score value of.
scoreVal The score value to set. The type can queried from the type of seed using SeedScore.

Data Races

Thread safety unknown!

void setUpperDigonal(seed, diag);

Sets a new value for the rightmost diagonal of a seed.

Parameters

seed The Seed to set the diagonal value for.
diag The value to set for the diagonal.

Data Races

Thread safety unknown!

TDiagonal upperDiagonal(seed);

Returns the rightmost diagonal of the seed (maximum diagonal value).

Parameters

seed The seed to query for its upper diagonal.

Returns

TDiagonal The upper diagonal value of type Diagonal.

Data Races

Thread safety unknown!

Interface Metafunctions Detail

Diagonal<TSeed>::Type;

The diagonal type of a Seed.

Template Parameters

TSeed The Seed to query for its diagonal type.

Returns

Type The diagonal type of TSeed.

Position<TSeed>::Type;

The position type of a Seed.

Template Parameters

TSeed The Seed type to query.

Returns

Type The position type of TSeed.

SeedScore<TSeed>::Type;

The seed score type of a Seed.

Template Parameters

TSeed The Seed to query for its seed score type.

Returns

Type The score type of TSeed.

Size<TSeed>::Type;

The size type of a Seed.

Template Parameters

TSeed The Seed to query for its size type.

Returns

Type The size type of TSeed.