~ubuntu-branches/ubuntu/quantal/libpal-java/quantal

« back to all changes in this revision

Viewing changes to src/pal/datatype/CodonTable.java

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2012-01-27 13:57:54 UTC
  • Revision ID: package-import@ubuntu.com-20120127135754-d63l3581f65fw9pk
Tags: upstream-1.5.1
ImportĀ upstreamĀ versionĀ 1.5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// CodonTable.java
 
2
//
 
3
// (c) 1999-2001 PAL Development Core Team
 
4
//
 
5
// This package may be distributed under the
 
6
// terms of the Lesser GNU General Public License (LGPL)
 
7
 
 
8
 
 
9
package pal.datatype;
 
10
 
 
11
 
 
12
/**
 
13
 * Describes a device for translating Nucleotide triplets
 
14
 * or codon indices into amino acid codes.
 
15
 * Codon Indexes (or states) are defined as in GeneralizedCodons
 
16
 *
 
17
 * @author Matthew Goode
 
18
 * @author Alexei Drummond
 
19
 *
 
20
 * @note
 
21
 *   <ul>
 
22
 *     <li> 19 August 2003 - Added getAminoAcidStateFromIUPACStates()
 
23
 *   </ul>
 
24
 *
 
25
 * @version $Id: CodonTable.java,v 1.10 2003/09/04 03:22:34 matt Exp $
 
26
 */
 
27
 
 
28
public interface CodonTable extends java.io.Serializable {
 
29
 
 
30
        /** TypeID for Universal */
 
31
        static final int UNIVERSAL = 0;
 
32
        /** TypeID for Vertebrate Mitochondrial*/
 
33
        static final int VERTEBRATE_MITOCHONDRIAL = 1;
 
34
        /** TypeID for Yeast */
 
35
        static final int YEAST = 2;
 
36
        /** TypeID for Mold Protozoan Mitochondrial */
 
37
        static final int MOLD_PROTOZOAN_MITOCHONDRIAL = 3;
 
38
        /** TypeID for Mycoplasma */
 
39
        static final int MYCOPLASMA = 4;
 
40
        /** TypeID for Invertebrate Mitochondrial */
 
41
        static final int INVERTEBRATE_MITOCHONDRIAL = 5;
 
42
        /** TypeID for Cilate */
 
43
        static final int CILATE = 6;
 
44
        /** TypeID for Echinoderm Mitochondrial */
 
45
        static final int ECHINODERM_MITOCHONDRIAL = 7;
 
46
        /** TypeID for Euplotid Nuclear */
 
47
        static final int EUPLOTID_NUCLEAR = 8;
 
48
        /** TypeID for Ascidian Mitochondrial */
 
49
        static final int ASCIDIAN_MITOCHONDRIAL = 9;
 
50
        /** TypeID for Flatworm Mitochondrial */
 
51
        static final int FLATWORM_MITOCHONDRIAL = 10;
 
52
        /** TypeID for Blepharisma Nuclear */
 
53
        static final int BLEPHARISMA_NUCLEAR = 11;
 
54
        /** TypeID for Bacterial */
 
55
        static final int BACTERIAL = 12;
 
56
        /** TypeID for Alternative Yeast */
 
57
        static final int ALTERNATIVE_YEAST = 13;
 
58
 
 
59
        /**
 
60
         * A textual version of an organism type - type is index into array
 
61
         */
 
62
        static final String[] ORGANISM_TYPE_NAMES = {
 
63
                "Universal",
 
64
                "Vertebrate Mitochondrial",
 
65
                "Yeast",
 
66
                "Mold Protozoan Mitochondrial",
 
67
                "Mycoplasma",
 
68
                "Invertebrate Mitochondrial",
 
69
                "Cilate",
 
70
                "Echinoderm Mitochondrial",
 
71
                "Euplotid Nuclear",
 
72
                "Ascidian Mitochondrial",
 
73
                "Flatworm Mitochondrial",
 
74
                "Blepharisma Nuclear",
 
75
                "Bacterial",
 
76
                "Alternative Yeast"
 
77
        };
 
78
 
 
79
        /**
 
80
         * Returns the char associated with AminoAcid represented by 'codon'
 
81
         * @note char is as defined by AminoAcids.java
 
82
         * @see AminoAcids
 
83
         * @return state for '?' if codon unknown or wrong length
 
84
         */
 
85
        char getAminoAcidChar(char[] codon);
 
86
 
 
87
        /**
 
88
         * Returns the state associated with AminoAcid represented by 'codon'
 
89
         * @note state is as defined by AminoAcids.java
 
90
         * @see AminoAcids
 
91
         * @return '?' if codon unknown or wrong length
 
92
         */
 
93
        int getAminoAcidState(char[] codon);
 
94
 
 
95
        /**
 
96
         * @return all the possible codons for a given amino acid
 
97
         */
 
98
        char[][] getCodonsFromAminoAcidState(int aminoAcidState);
 
99
 
 
100
        /*
 
101
         * @return all the possible codons for a given amino acid
 
102
         */
 
103
        char[][] getCodonsFromAminoAcidChar(char aminoAcidChar);
 
104
 
 
105
        /** Returns the amino acid char at the corresponding codonIndex */
 
106
        char getAminoAcidCharFromCodonIndex(int codonIndex);
 
107
 
 
108
        /** Returns the amino acid state at the corresponding codonIndex */
 
109
        int getAminoAcidStateFromCodonIndex(int codonIndex);
 
110
 
 
111
        /*
 
112
         * @returns three IUPAC states representing the given amino acid
 
113
         * @note The returned array should not be altered, and implementations
 
114
         *       should attempt to implement this as efficiently as possible
 
115
         * @note the returned array may not be enough to accurately reconstruct the amino acid (as it may be too ambiguous)
 
116
        */
 
117
        int[] getIUPACStatesFromAminoAcidState(int aminoAcid);
 
118
        int[] getStatesFromAminoAcidState(int aminoAcid);
 
119
 
 
120
        /**
 
121
         * @return The AminoAcid states given the nucleotides states (array should be of size 3)
 
122
         */
 
123
        int getAminoAcidStateFromStates(int[] states);
 
124
 
 
125
 
 
126
        /**
 
127
         * @return the codon states of terminator amino acids.
 
128
         */
 
129
        int[] getTerminatorIndexes();
 
130
 
 
131
        /**
 
132
         * Returns the number of terminator amino acids.
 
133
         */
 
134
        int getNumberOfTerminatorIndexes();
 
135
 
 
136
        /**
 
137
         * @return the type of this organism (see defined type constants)
 
138
         */
 
139
        int getOrganismTypeID();
 
140
 
 
141
        /**
 
142
         * @return true if the amino acids that map to two codons are the same (synonymous). False otherwise
 
143
         */
 
144
        boolean isSynonymous(int codonIndexOne, int codonIndexTwo);
 
145
}