Class Align
Tabular alignment of same-type sequences.

Implements EqualityComparableConcept
All Impl'd EqualityComparableConcept
Defined in <seqan/align.h>
Signature template <typename TSequence, typename TGapSpec> class Align;

Template Parameters

TSequence Type of the underlying sequence.
TGapSpec Tag for selecting the Gaps specialization.

Member Function Overview

Member Functions Inherited From EqualityComparableConcept

Interface Function Overview

Interface Metafunction Overview

Detailed Description

The Alignment class is for storing tabular alignments of sequences having the same type. They do so by being a container of Gaps objects. The most common use case is storing pairwise alignments that are generated by one of the dynamic programming alignment algorithms.

Example

Here is an example of using an Align object with globalAlignment.

#include <seqan/basic.h>
#include <seqan/sequence.h>
#include <seqan/file.h>  // for I/O
#include <seqan/align.h>
#include <seqan/score.h>

using namespace seqan;

int main()
{
    StringSet<DnaString> stringSet;
    appendValue(stringSet, "AGTTTAATCA");
    appendValue(stringSet, "AGTATACGA");

    Align<DnaString> align(stringSet);                        // Initialize the Align object using a StringSet.

    int score = globalAlignment(align, EditDistanceScore());  // Compute a global alingment using the Align object.

    std::cout << "score = " << score << std::endl;
    std::cout << "align\n" << align << std::endl;

    return 0;
}

The output is as follows:

score = -4
align
      0     .    : 
        AGTTTAATCA
        ||| | |  |
        AGTAT-ACGA



See Also

Interface Functions Detail

void clearClipping(align);

Clear clipping on all rows.

Parameters

align Align object to clear clippings of.

void clearGaps(align);

Clear gaps of all Align rows.

Parameters

align The Align object to clear all all gaps from.

TCol col(align);

Returns the columns of an Align object.

Parameters

align The Align object to get the cols of.

Returns

TCol The column of the Align object (Metafunction: Col).

TCols cols(align);

Returns the columns of an Align object.

Parameters

align The Align object to get the cols of.

Returns

TCols The columns of the Align object (Metafunction: Cols).

TStream operator<<(stream, align);

Stream-output for Align objects.

Parameters

stream std::ostream to write to.
align Align object to write out.

Returns

TStream Reference to stream after output of align.

TRow row(align, pos);

Returns a single row of an Align object.

Parameters

align The Align object to get the row of.
pos The number of the row to get.

Returns

TRow Reference to the given row of align (Metafunction: Row).

TRows rows(align);

Returns the rows of an Align object.

Parameters

align The Align object to get the rows for.

Returns

TRows A container with the Gaps of the Align object.

void setStrings(align, stringSet);

Loads the sequences of a string set into an alignment.

Parameters

align Align object to set underlying sequence of.
stringSet The StringSet with the data.

TStringSet stringSet(align);

Return string set with all ungapped sequences.

Parameters

align Align object to get sequences of.

Returns

TStringSet The set of ungapped sequences (Metafunction: StringSetType).

void write(stream, align, id, Raw());

Deprecated.

Old-style I/O.

Writing of Gaps to Streams in human-readable format.

Parameters

stream The Stream to write to.
align The Align object to write out.
id ID string (ignored).

Interface Metafunctions Detail

Col<TAlign>::Type

The column type for Align objects.

Template Parameters

TAlign The Align object to query for its column type.

Returns

Type The resulting type.

Cols<TAlign>::Type

Return the type representing a column in an Align object.

Template Parameters

TAlign The Align object to get the column type for.

Returns

Type The resulting column type.

GetValue<TAlign>::Type

Return the get-value type for an Align object.

Template Parameters

TAlign The Align object to get the get-value type for.

Returns

Type The resulting get-value type.

GetValue<TAlign>::Type

Return the reference type for an Align object.

Template Parameters

TAlign The Align object to get the reference type for.

Returns

Type The resulting reference type.

Row<TAlign>::Type

Return the row type (Gaps specialization).

Template Parameters

TAlign The Align object to get the row type for.

Returns

Type The resulting row type.

Rows<TAlign>::Type

Return the type used for rows in an Align object (a Gaps specialization).

Template Parameters

TAlign The Align object to get the rows type for.

Returns

Type The resulting rows type.

Rows<TAlign>::Type;

Return the type of the underlying sequence.

Template Parameters

TAlign The Align object to get the underlying sequence type for.

Returns

Type The resulting sequence type.

Rows<TAlign>::Type

Return the type that would be used for a string set of the sources.

Template Parameters

TAlign The Align object to get the string set type for.

Returns

Type The resulting string set type.

Value<TAlign>::Type

Return the value type for an Align object.

Template Parameters

TAlign The Align object to get the value type for.

Returns

Type The resulting value type.