Provides object used for alignment scoring. More...
Go to the source code of this file.
Typedefs | |
typedef struct Scorer | Scorer |
Scorer object used for alignment scoring. More... | |
Functions | |
Scorer * | scorerCreate (const char *name, int *scores, char maxCode, int gapOpen, int gapExtend) |
Scorer constructor. More... | |
void | scorerDelete (Scorer *scorer) |
Scorer destructor. More... | |
int | scorerGetGapExtend (Scorer *scorer) |
Gap extend penalty getter. More... | |
int | scorerGetGapOpen (Scorer *scorer) |
Gap open penalty getter. More... | |
char | scorerGetMaxCode (Scorer *scorer) |
Max code getter. More... | |
int | scorerGetMaxScore (Scorer *scorer) |
Max score getter. More... | |
const char * | scorerGetName (Scorer *scorer) |
Name getter. More... | |
int | scorerIsScalar (Scorer *scorer) |
Scalar getter. More... | |
int | scorerScore (Scorer *scorer, char a, char b) |
Scores two codes. More... | |
Scorer * | scorerDeserialize (char *bytes) |
Scorer deserialization method. More... | |
void | scorerSerialize (char **bytes, int *bytesLen, Scorer *scorer) |
Scorer serialization method. More... | |
char | scorerDecode (char c) |
Scorer static decoding method. More... | |
char | scorerEncode (char c) |
Scorer static encoding method. More... | |
Provides object used for alignment scoring.
Scorer object used for alignment scoring.
Scorer is organized as a similarity table with additional gap penalties. Affine gap penalty model is used. Scorer codes are defined as characters. Scorer works only on input characters coded with the scorerEncode(char) method.
Scorer* scorerCreate | ( | const char * | name, |
int * | scores, | ||
char | maxCode, | ||
int | gapOpen, | ||
int | gapExtend | ||
) |
Scorer constructor.
Input scores table must be an array which length is equal to maxCode * maxCode. Input scores table must be organized so that columns and rows correspond to the codes shown in scorerEncode(char).
name | scorer name, copy is made |
scores | similarity table, copy is made |
maxCode | maximum code that scorer should work with |
gapOpen | gap open penalty given as a positive integer |
gapExtend | gap extend penalty given as a positive integer |
char scorerDecode | ( | char | c | ) |
Scorer static decoding method.
Function is exact inverse of scorerEncode(char).
c | input character |
void scorerDelete | ( | Scorer * | scorer | ) |
Scorer destructor.
scorer | scorer object |
Scorer* scorerDeserialize | ( | char * | bytes | ) |
Scorer deserialization method.
Method deserializes scorer object from a byte buffer.
bytes | byte buffer |
char scorerEncode | ( | char | c | ) |
Scorer static encoding method.
Encoding method is case insensitive. Function returns character code which is grater or equal to zero or if the codes are not available -1.
Encoding is done in the following way:
c | input character |
int scorerGetGapExtend | ( | Scorer * | scorer | ) |
Gap extend penalty getter.
Gap extend penalty is defined as a positive integer.
scorer | scorer object |
int scorerGetGapOpen | ( | Scorer * | scorer | ) |
Gap open penalty getter.
Gap open penalty is defined as a positive integer.
scorer | scorer object |
char scorerGetMaxCode | ( | Scorer * | scorer | ) |
Max code getter.
Max code is defined as the highest code scorer can work with.
scorer | scorer object |
int scorerGetMaxScore | ( | Scorer * | scorer | ) |
Max score getter.
Max score is defined as the highest score two codes can be scored.
scorer | scorer object |
const char* scorerGetName | ( | Scorer * | scorer | ) |
Name getter.
Scorer name usually coresponds to similarity matrix names.
scorer | scorer object |
int scorerIsScalar | ( | Scorer * | scorer | ) |
Scalar getter.
Getter for scalar property. Scorer is scalar if the similarity matrix can be reduced to match, mismatch scorer. In other words scorer is scalar if every two equal codes are scored equaly and every two unequal codes are scored equaly.
scorer | scorer object |
int scorerScore | ( | Scorer * | scorer, |
char | a, | ||
char | b | ||
) |
Scores two codes.
Given scorer scores two given codes. Both codes should be greater or equal to 0 and less than maxCode.
scorer | scorer object |
a | first code |
b | second code |
void scorerSerialize | ( | char ** | bytes, |
int * | bytesLen, | ||
Scorer * | scorer | ||
) |
Scorer serialization method.
Method serializes scorer object to a byte buffer.
bytes | output byte buffer |
bytesLen | output byte buffer length |
scorer | scorer object |