2
Copyright (c) 2010 Sascha Steinbiss <steinbiss@zbh.uni-hamburg.de>
3
Copyright (c) 2010 Center for Bioinformatics, University of Hamburg
5
Permission to use, copy, modify, and distribute this software for any
6
purpose with or without fee is hereby granted, provided that the above
7
copyright notice and this permission notice appear in all copies.
9
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
#ifndef TRANS_TABLE_API_H
19
#define TRANS_TABLE_API_H
21
#include "core/str_array_api.h"
23
typedef struct GtTransTable GtTransTable;
25
/* The number of the standard translation scheme. */
26
#define GT_STANDARD_TRANSLATION_SCHEME 1U
28
/* Returns a <GtStrArray> of translation scheme descriptions, each of the
29
format "%d: %s" where the number is the translation scheme number (usable in
30
<gt_translator_set_translation_scheme()> and the string is the scheme
32
GtStrArray* gt_trans_table_get_scheme_descriptions(void);
34
/* Returns a translation table as given by <scheme> which refers to the numbers
35
as reported by <gt_translator_get_translation_table_descriptions()> or the
36
list given at the NCBI web site
37
__http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi__.
38
Returns NULL if an error occurred, see <err> for details. */
39
GtTransTable* gt_trans_table_new(unsigned int scheme, GtError *err);
41
/* Returns the standard translation table. */
42
GtTransTable* gt_trans_table_new_standard(GtError *err);
44
/* Returns the description of <tt>. */
45
const char* gt_trans_table_description(const GtTransTable *tt);
47
/* Writes the translation for the codon <c1>,<c2>,<c3> to the position pointed
48
to by <amino>. The current translation scheme set in <translator> is used.
49
Returns a negative value if an error occurred, see <err> for details.
50
Otherwise, 0 is returned. */
51
int gt_trans_table_translate_codon(const GtTransTable *tt,
52
char c1, char c2, char c3,
53
char *amino, GtError *err);
55
bool gt_trans_table_is_start_codon(const GtTransTable *tt,
56
char c1, char c2, char c3);
58
bool gt_trans_table_is_stop_codon(const GtTransTable *tt,
59
char c1, char c2, char c3);
62
void gt_trans_table_delete(GtTransTable *tt);