libuproc  1.2.0
Data Structures | Typedefs | Enumerations | Functions

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_protclassuproc_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...
 

Detailed Description

Protein sequence classifier.

Typedef Documentation

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.

Parameters
seqclassified sequence
seq_lenlength of the classified sequence
familypredicted family
scoretotal score for this family
arguser-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.

Parameters
wordthe word found in the ecurve
familythe corresponding family entry
indexposition in the protein sequence
reversewhether the word was found in the "reverse" ecurve
scoresscores of this match (array of size UPROC_SUFFIX_LEN)
arguser-supplied argument

Enumeration Type Documentation

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)

Function Documentation

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.

Parameters
modeWhich results to produce
fwduproc_ecurve for looking up words in original order
revuproc_ecurve for looking up words in reversed order
substmatSubstitution matrix used to determine scores
filterResult filtering function
filter_argAdditional 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.

Parameters
pcprotein classifier
seqsequence to classify
resultsOUT: classification results
void uproc_protclass_set_trace ( uproc_protclass pc,
uproc_protclass_trace_cb cb,
void *  cb_arg 
)

Set trace callback.

Parameters
pcprotein classifier
cbcallback function
cb_argadditional argument to cb