libuproc  1.2.0
protclass.h
Go to the documentation of this file.
1 /* Copyright 2014 Peter Meinicke, Robin Martinjak
2  *
3  * This file is part of libuproc.
4  *
5  * libuproc is free software: you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License as published by the Free
7  * Software Foundation, either version 3 of the License, or (at your option)
8  * any later version.
9  *
10  * libuproc is distributed in the hope that it will be useful, but WITHOUT ANY
11  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libuproc. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
30 #ifndef UPROC_PROTCLASS_H
31 #define UPROC_PROTCLASS_H
32 
33 #include "uproc/common.h"
34 #include "uproc/ecurve.h"
35 #include "uproc/substmat.h"
36 #include "uproc/list.h"
37 
45 {
48 
50  double score;
51 };
52 
54 #define UPROC_PROTRESULT_INITIALIZER \
55  { \
56  0, 0 \
57  }
58 
60 void uproc_protresult_init(struct uproc_protresult *results);
61 
63 void uproc_protresult_free(struct uproc_protresult *results);
64 
67  const struct uproc_protresult *src);
83 typedef struct uproc_protclass_s uproc_protclass;
84 
97 typedef bool uproc_protfilter(const char *seq, size_t seq_len,
98  uproc_family family, double score, void *arg);
99 
109 };
110 
121  const uproc_ecurve *fwd,
122  const uproc_ecurve *rev,
123  const uproc_substmat *substmat,
124  uproc_protfilter *filter,
125  void *filter_arg);
126 
129 
143 int uproc_protclass_classify(const uproc_protclass *pc, const char *seq,
144  uproc_list **results);
145 
162 typedef void uproc_protclass_trace_cb(const struct uproc_word *word,
163  uproc_family family, size_t index,
164  bool reverse, const double *scores,
165  void *opaque);
166 
174  uproc_protclass_trace_cb *cb, void *cb_arg);
181 #endif
uproc_family family
Predicted family.
Definition: protclass.h:47
List of homogenous items (also known as "vector" or "arraylist")
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.
Definition: protclass.h:162
All results (unordered)
Definition: protclass.h:108
Protein classification result.
Definition: protclass.h:44
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.
Array of matrices of amino acid distances.
int uproc_protresult_copy(struct uproc_protresult *dest, const struct uproc_protresult *src)
Deep-copy a uproc_protresult struct.
Module: List.
uproc_protclass_mode
Classification mode.
Definition: protclass.h:104
void uproc_protresult_free(struct uproc_protresult *results)
Free allocated pointers of uproc_protresult struct.
Only the result with the maximum score.
Definition: protclass.h:106
int uproc_protclass_classify(const uproc_protclass *pc, const char *seq, uproc_list **results)
Classify DNA sequence.
void uproc_protclass_set_trace(uproc_protclass *pc, uproc_protclass_trace_cb *cb, void *cb_arg)
Set trace callback.
Evolutionary Curve.
void uproc_protresult_init(struct uproc_protresult *results)
Initialize a uproc_protresult struct.
Module: Evolutionary Curve.
Module: Common definitions.
Module: Amino acid substitution matrix.
double score
Prediction score.
Definition: protclass.h:50
Protein sequence classifier.
Amino acid word.
Definition: word.h:45
uint_least16_t uproc_family
Identifier of a protein family.
Definition: common.h:93
void uproc_protclass_destroy(uproc_protclass *pc)
Destroy protein classifier.
bool uproc_protfilter(const char *seq, size_t seq_len, uproc_family family, double score, void *arg)
Protein filter function type.
Definition: protclass.h:97