libuproc
1.2.0
|
Amino acid alphabet. More...
Data Structures | |
struct | uproc_alphabet |
Amino acid alphabet. More... | |
Functions | |
uproc_alphabet * | uproc_alphabet_create (const char *s) |
Create alphabet object. More... | |
void | uproc_alphabet_destroy (uproc_alphabet *alpha) |
Destroy alphabet object. More... | |
uproc_amino | uproc_alphabet_char_to_amino (const uproc_alphabet *alpha, int c) |
Translate character to amino acid. More... | |
int | uproc_alphabet_amino_to_char (const uproc_alphabet *alpha, uproc_amino a) |
Translate amino acid to character. More... | |
const char * | uproc_alphabet_str (const uproc_alphabet *alpha) |
Return the underlying string. More... | |
Amino acid alphabet.
An object of this type is required to translate between characters and the internal representation of amino acids. The order of this alphabet is very significant to the results. Each uproc_ecurve has an "intrinsic" alphabet and should not be used with a uproc_substmat that was derived from a different alphabet.
uproc_alphabet* uproc_alphabet_create | ( | const char * | s | ) |
Create alphabet object.
The first argument string s
must be a string exactly UPROC_ALPHABET_SIZE characters long which consists only of uppercase letters. No letter shall appear twice. Passing an unterminated char array results in undefined behaviour.
void uproc_alphabet_destroy | ( | uproc_alphabet * | alpha | ) |
Destroy alphabet object.
uproc_amino uproc_alphabet_char_to_amino | ( | const uproc_alphabet * | alpha, |
int | c | ||
) |
Translate character to amino acid.
alpha | alphabet object |
c | character to translate |
c
is a non-alphabetic character.Does not set uproc_errno.
int uproc_alphabet_amino_to_char | ( | const uproc_alphabet * | alpha, |
uproc_amino | a | ||
) |
Translate amino acid to character.
alpha | alphabet object |
a | amino acid to translate |
a
is not between 0 and UPROC_ALPHABET_SIZE.Does not set uproc_errno.
const char* uproc_alphabet_str | ( | const uproc_alphabet * | alpha | ) |
Return the underlying string.
Returns a pointer to the underlying string, which is a copy of the argument passed to uproc_alphabet_create().