Next: String Distance Function ( Up: Alignment Data Types Previous: String Matching Algorithms (   Contents   Index

# Score Matrix ( score_matrix )

Definition

An instance S of the data type score_matrix is an object required by alignment computations. The object contains an alphabet representing residues and maintains a table that assigns a score to any pair of aligned residues. In addition it maintains the gap penalty values.
Remark: This data type is experimental. It can significantly change in future versions.

#include < LEDA/string/score_matrix.h >

Creation

 score_matrix S(int defmatch = 1, int defmismatch = -1) creates an instance S of type score_matrix. The alphabet is set to the standard alphabet consisting of the capital letters A - Z. The scores are initialized to defmatch if the letters are idendical (1 by default), to defmismatch otherwise (-1 by default). score_matrix S(alphabet& alt, int defmatch = 1, int defmismatch = -1) creates an instance S of type score_matrix. The alphabet is set to alt. The scores are initialized to defmatch if the letters are idendical (1 by default), to defmismatch otherwise (-1 by default).

Operations

 void S.setScore(char a, char b, int sc) sets the score for a and b to sc. Precondition a and b are in the score alphabet. Otherwise an exception is thrown. int S.getScore(char a, char b) returns the score for a and b. Precondition a and b are in the score alphabet. Otherwise an exception is thrown. bool S.hasScore(char a, char b) returns bool if score is defined for a and b, otherwise false. void S.setScoreMatch(int sc) sets the score for all pairs a and a to sc. void S.setScoreMismatch(int sc) sets the score for all pairs a and b with a != b to sc. void S.setGapPenalty(int pen) sets the penalty for starting a new gap to pen. void S.setGapIncPenalty(int incpen) sets the penalty for extending a gap by one position to incpen. void S.setGapPenalty(int pen, int incpen) sets the penalty for starting a new gap to pen and for extending a gap by 1 position to incpen. int S.getGapPenalty() returns the penalty for starting a new gap. int S.getGapIncPenalty() returns the penalty for extending a gap by one position.

Next: String Distance Function ( Up: Alignment Data Types Previous: String Matching Algorithms (   Contents   Index