libuproc
1.2.0
|
Amino acid word. More...
Data Structures | |
struct | uproc_word |
Amino acid word. More... | |
Macros | |
#define | UPROC_WORD_INITIALIZER |
Initializer to be used for all uproc_word structs. More... | |
Functions | |
int | uproc_word_from_string (struct uproc_word *word, const char *str, const uproc_alphabet *alpha) |
Transform a string to amino acid word. More... | |
int | uproc_word_to_string (char *str, const struct uproc_word *word, const uproc_alphabet *alpha) |
Build string corresponding to amino acid word. More... | |
void | uproc_word_append (struct uproc_word *word, uproc_amino amino) |
Append amino acid. More... | |
void | uproc_word_prepend (struct uproc_word *word, uproc_amino amino) |
Prepend amino acid. More... | |
bool | uproc_word_startswith (const struct uproc_word *word, uproc_amino amino) |
Compare first amino acid of a word. More... | |
int | uproc_word_cmp (const struct uproc_word *w1, const struct uproc_word *w2) |
Compare words. More... | |
Amino acid word.
#define UPROC_WORD_INITIALIZER |
Initializer to be used for all uproc_word structs.
int uproc_word_from_string | ( | struct uproc_word * | word, |
const char * | str, | ||
const uproc_alphabet * | alpha | ||
) |
Transform a string to amino acid word.
Translates the first UPROC_WORD_LEN characters of the given string to a word object. Failure occurs if the string ends or an invalid character is encountered.
word | OUT: amino acid word |
str | string representation |
alpha | alphabet to use for translation |
int uproc_word_to_string | ( | char * | str, |
const struct uproc_word * | word, | ||
const uproc_alphabet * | alpha | ||
) |
Build string corresponding to amino acid word.
Translates an amino acid word back to a string. The string will be null-terminated, thus str
should point to a buffer of at least UPROC_WORD_LEN + 1
bytes.
str | buffer to store the string in |
word | amino acid word |
alpha | alphabet to use for translation |
void uproc_word_append | ( | struct uproc_word * | word, |
uproc_amino | amino | ||
) |
void uproc_word_prepend | ( | struct uproc_word * | word, |
uproc_amino | amino | ||
) |
bool uproc_word_startswith | ( | const struct uproc_word * | word, |
uproc_amino | amino | ||
) |
Compare first amino acid of a word.
int uproc_word_cmp | ( | const struct uproc_word * | w1, |
const struct uproc_word * | w2 | ||
) |
Compare words.
Comparison is done lexcographically (prefix first, suffix second).
w1
is less than, equal to, or greater than w2
.