libuproc
1.2.0
|
Protein sequence classifier. More...
Data Structures | |
struct | uproc_protclass |
Protein sequence classifier. More... | |
Typedefs | |
typedef bool | uproc_protfilter(const char *seq, size_t seq_len, uproc_family family, double score, void *arg) |
Protein filter function type. More... | |
typedef void | uproc_protclass_trace_cb(const struct uproc_word *word, uproc_family family, size_t index, bool reverse, const double *scores, void *opaque) |
Tracing callback type. More... | |
Enumerations | |
enum | uproc_protclass_mode { UPROC_PROTCLASS_ALL, UPROC_PROTCLASS_MAX } |
Classification mode. More... | |
Functions | |
uproc_protclass * | uproc_protclass_create (enum uproc_protclass_mode mode, const uproc_ecurve *fwd, const uproc_ecurve *rev, const uproc_substmat *substmat, uproc_protfilter *filter, void *filter_arg) |
Create new protein classifier. More... | |
void | uproc_protclass_destroy (uproc_protclass *pc) |
Destroy protein classifier. More... | |
int | uproc_protclass_classify (const uproc_protclass *pc, const char *seq, uproc_list **results) |
Classify DNA sequence. More... | |
void | uproc_protclass_set_trace (uproc_protclass *pc, uproc_protclass_trace_cb *cb, void *cb_arg) |
Set trace callback. More... | |
Protein sequence classifier.
typedef bool uproc_protfilter(const char *seq, size_t seq_len, uproc_family family, double score, void *arg) |
Protein filter function type.
Used by uproc_protclass_classify() to decide whether a classification should be added to the results.
seq | classified sequence |
seq_len | length of the classified sequence |
family | predicted family |
score | total score for this family |
arg | user-supplied argument |
typedef void uproc_protclass_trace_cb(const struct uproc_word *word, uproc_family family, size_t index, bool reverse, const double *scores, void *opaque) |
Tracing callback type.
Additionally to the normal classification, it's possible to get information about every matched word by installing a tracing callback function with uproc_protclass_trace_cb().
This function will be called for every word match that was found in the ecurves while classifying a protein sequence.
word | the word found in the ecurve |
family | the corresponding family entry |
index | position in the protein sequence |
reverse | whether the word was found in the "reverse" ecurve |
scores | scores of this match (array of size UPROC_SUFFIX_LEN) |
arg | user-supplied argument |
enum uproc_protclass_mode |
Classification mode.
Determines which results uproc_protclass_classify() produces.
Enumerator | |
---|---|
UPROC_PROTCLASS_ALL |
Only the result with the maximum score. |
UPROC_PROTCLASS_MAX |
All results (unordered) |
uproc_protclass* uproc_protclass_create | ( | enum uproc_protclass_mode | mode, |
const uproc_ecurve * | fwd, | ||
const uproc_ecurve * | rev, | ||
const uproc_substmat * | substmat, | ||
uproc_protfilter * | filter, | ||
void * | filter_arg | ||
) |
Create new protein classifier.
mode | Which results to produce |
fwd | uproc_ecurve for looking up words in original order |
rev | uproc_ecurve for looking up words in reversed order |
substmat | Substitution matrix used to determine scores |
filter | Result filtering function |
filter_arg | Additional argument to filter |
void uproc_protclass_destroy | ( | uproc_protclass * | pc | ) |
Destroy protein classifier.
int uproc_protclass_classify | ( | const uproc_protclass * | pc, |
const char * | seq, | ||
uproc_list ** | results | ||
) |
Classify DNA sequence.
results
should be a pointer to a (uproc_list *) that is either NULL (in which case a new list is created) or which has which has already been used with this function. The list will contain items of type struct uproc_protresult. If
*results
is not NULL, all its elements will be passed to uproc_protresult_free() in the beginning.
pc | protein classifier |
seq | sequence to classify |
results | OUT: classification results |
void uproc_protclass_set_trace | ( | uproc_protclass * | pc, |
uproc_protclass_trace_cb * | cb, | ||
void * | cb_arg | ||
) |
Set trace callback.
pc | protein classifier |
cb | callback function |
cb_arg | additional argument to cb |