libuproc
1.2.0
|
Typedefs | |
typedef struct uproc_worditer_s | uproc_worditer |
Iterator over all words in an amino acid sequence. More... | |
Functions | |
uproc_worditer * | uproc_worditer_create (const char *seq, const uproc_alphabet *alpha) |
Create worditer object. More... | |
int | uproc_worditer_next (uproc_worditer *iter, size_t *index, struct uproc_word *fwd, struct uproc_word *rev) |
Obtain the next word(s) from a word iterator. More... | |
void | uproc_worditer_destroy (uproc_worditer *iter) |
Destroy worditer object. More... | |
typedef struct uproc_worditer_s uproc_worditer |
Iterator over all words in an amino acid sequence.
Produces all consecutive amino acid words of length UPROC_WORD_LEN found in a sequence. If a character is encountered that is not an amino acid, the next word will start after that character.
Example:
For a word length of 5, the sequence
contains the (forward) words:
uproc_worditer* uproc_worditer_create | ( | const char * | seq, |
const uproc_alphabet * | alpha | ||
) |
Create worditer object.
The iterator may not be used after the lifetime of the objects pointed to by seq
and alpha
has ended (only the pointer value is stored).
seq | sequence to iterate |
alpha | translation alphabet |
int uproc_worditer_next | ( | uproc_worditer * | iter, |
size_t * | index, | ||
struct uproc_word * | fwd, | ||
struct uproc_word * | rev | ||
) |
Obtain the next word(s) from a word iterator.
Invalid characters are not simply skipped, instead the first complete word after such character is returned next.
iter | iterator |
index | OUT: starting index of the current "forward" word |
fwd | OUT: read word in order as it appeared |
rev | OUT: read word in reversed order |
void uproc_worditer_destroy | ( | uproc_worditer * | iter | ) |
Destroy worditer object.