~ubuntu-branches/ubuntu/quantal/genometools/quantal-backports

« back to all changes in this revision

Viewing changes to src/core/trans_table_api.h

  • Committer: Package Import Robot
  • Author(s): Sascha Steinbiss
  • Date: 2012-07-09 14:10:23 UTC
  • Revision ID: package-import@ubuntu.com-20120709141023-juuu4spm6chqsf9o
Tags: upstream-1.4.1
ImportĀ upstreamĀ versionĀ 1.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  Copyright (c) 2010 Sascha Steinbiss <steinbiss@zbh.uni-hamburg.de>
 
3
  Copyright (c) 2010 Center for Bioinformatics, University of Hamburg
 
4
 
 
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.
 
8
 
 
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.
 
16
*/
 
17
 
 
18
#ifndef TRANS_TABLE_API_H
 
19
#define TRANS_TABLE_API_H
 
20
 
 
21
#include "core/str_array_api.h"
 
22
 
 
23
typedef struct GtTransTable GtTransTable;
 
24
 
 
25
/* The number of the standard translation scheme. */
 
26
#define GT_STANDARD_TRANSLATION_SCHEME 1U
 
27
 
 
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
 
31
   name. */
 
32
GtStrArray*   gt_trans_table_get_scheme_descriptions(void);
 
33
 
 
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);
 
40
 
 
41
/* Returns the standard translation table. */
 
42
GtTransTable* gt_trans_table_new_standard(GtError *err);
 
43
 
 
44
/* Returns the description of <tt>. */
 
45
const char*   gt_trans_table_description(const GtTransTable *tt);
 
46
 
 
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);
 
54
 
 
55
bool          gt_trans_table_is_start_codon(const GtTransTable *tt,
 
56
                                            char c1, char c2, char c3);
 
57
 
 
58
bool          gt_trans_table_is_stop_codon(const GtTransTable *tt,
 
59
                                           char c1, char c2, char c3);
 
60
 
 
61
/* Deletes <tt>. */
 
62
void          gt_trans_table_delete(GtTransTable *tt);
 
63
 
 
64
#endif