libuproc  1.2.0
orf.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 
31 #ifndef UPROC_ORF_H
32 #define UPROC_ORF_H
33 
34 #include "uproc/common.h"
35 #include "uproc/io.h"
36 #include "uproc/matrix.h"
37 
39 #define UPROC_ORF_FRAMES 6
40 
54 struct uproc_orf
55 {
57  char *data;
58 
60  size_t start;
61 
63  size_t length;
64 
66  double score;
67 
69  unsigned frame;
70 };
71 
73 #define UPROC_ORF_INITIALIZER \
74  { \
75  NULL, 0, 0, 0.0, 0 \
76  }
77 
79 void uproc_orf_init(struct uproc_orf *orf);
80 
82 void uproc_orf_free(struct uproc_orf *orf);
83 
85 int uproc_orf_copy(struct uproc_orf *dest, const struct uproc_orf *src);
94 typedef bool uproc_orffilter(const struct uproc_orf *, const char *, size_t,
95  double, void *);
96 
114 void uproc_orf_codonscores(double *scores, const uproc_matrix *score_matrix);
115 
128 typedef struct uproc_orfiter_s uproc_orfiter;
129 
140 uproc_orfiter *uproc_orfiter_create(const char *seq, const double *codon_scores,
141  uproc_orffilter *filter, void *filter_arg);
142 
145 
154 int uproc_orfiter_next(uproc_orfiter *iter, struct uproc_orf *next);
161 #endif
size_t length
Length of the amino acid sequence.
Definition: orf.h:63
uproc_orfiter * uproc_orfiter_create(const char *seq, const double *codon_scores, uproc_orffilter *filter, void *filter_arg)
Create orfiter object.
double score
Sum of codon scores.
Definition: orf.h:66
size_t start
Starting index w.r.t.
Definition: orf.h:60
void uproc_orf_free(struct uproc_orf *orf)
Freeing function.
Module: General IO.
Open reading frame.
Definition: orf.h:54
void uproc_orfiter_destroy(uproc_orfiter *iter)
Destroy orfiter object.
unsigned frame
On which frame the ORF was found.
Definition: orf.h:69
Module: 2D double matrix.
char * data
Derived amino acid sequence as string.
Definition: orf.h:57
int uproc_orfiter_next(uproc_orfiter *iter, struct uproc_orf *next)
Obtain the next ORF.
2D matrix
Iterates over a DNA/RNA sequence and yield all possible ORFs.
bool uproc_orffilter(const struct uproc_orf *, const char *, size_t, double, void *)
ORF filter function.
Definition: orf.h:94
Module: Common definitions.
int uproc_orf_copy(struct uproc_orf *dest, const struct uproc_orf *src)
Deep-copy function.
void uproc_orf_codonscores(double *scores, const uproc_matrix *score_matrix)
Prepare codon score table.
void uproc_orf_init(struct uproc_orf *orf)
Initializer function.