Definition
An instance A of the data type alignment is an object maintaining
two strings, a
scorematrix, a penalty value for starting a gap and a
penalty value for extending an already started gap. It provides several
functions for global and local alignment computation. The
result of an alignment computation is stored in the object.
Remark: This data type is experimental. It can significantly change
in future versions.
#include < LEDA/core/alignment.h >
Creation
alignment | A | creates an instance A of type alignment. |
alignment | A(const score_matrix& score) | |
creates an instance A of type alignment and initializes the score matrix to score. | ||
alignment | A(const score_matrix& score, const string& s1, const string& s2) | |
creates an instance A of type alignment and initializes the score matrix to score, and the strings to s1 and s2. | ||
alignment | A(const string& s1, const string& s2) | |
creates an instance A of type alignment and initializes the strings to s1 and s2. |
Operations
void | A.setStringA(const string& x) | |
sets the first string to x. | ||
void | A.setStringB(const string& x) | |
sets the second string to x. | ||
string | A.getStringA() | returns the first string. |
string | A.getStringB() | returns the second string. |
string | A.getAlA() | returns the first alignment string, that is the first string with its gaps after an alignment computation. |
string | A.getAlB() | returns the second alignment string, that is the second string with its gaps after an alignment computation. |
string | A.getAlInfo() | shows the correspondence information for each position in the two alignment strings. Its i-th position is "/", if the letters are identical, "X" if the are different but they are matched and " " if there is a gap in one of the alignment strings. |
void | A.setGapPenalty(int x) | sets the penalty for a gap to x. |
void | A.setGapIncPenalty(int x) | sets the penalty for extending an existing gap by one position to x. |
int | A.getGapPenalty() | returns the penalty for a gap. |
int | A.getGapIncPenalty() | returns the penalty for a gap extension of one position. |
void | A.global_nw() | runs a global alignment algorithm based on Needleman and Wunsch, where there is a penalty x for each gap proportional to its length. x can be set by setGapPenalty. The algorithm requires quadratic space. |
void | A.local_sw() | runs a local alignment algorithm based on Smith and Waterman, where there is a penalty x for each gap proportional to its length. x can be set by setGapPenalty. The algorithm requires quadratic space. |
void | A.global_aff_nw() | runs a global alignment algorithm based on Needleman and Wunsch, where there is a penalty x + k*y for each gap, where k is the length of the gap. x can be set by setGapPenalty and x by setGapIncPenalty. The algorithm requires quadratic space. |
void | A.local_aff_sw() | runs a local alignment algorithm based on Smith and Waterman, where there is a penalty x + k*y for each gap, where k is the length of the gap. x can be set by setGapPenalty and x by setGapIncPenalty. The algorithm requires quadratic space. |
unsigned int | A.longest_common_substring() | |
returns the length of the longest common substring of the two strings. | ||
unsigned int | A.longest_common_subsequence() | |
returns the length of the longest common subsequence of the two strings and stores them aligned in the alignment strings. |