codon.h

Go to the documentation of this file.
00001 #ifndef CODON_H
00002 #define CODON_H
00003 
00004 #include <map>
00005 #include <string>
00006 #include <iostream>
00007 
00008 using namespace std;
00009 
00010 /* convert base to integer
00011  * A=>0, C=>1, G=>2, T,U=>3, 
00012  * S,W,R,Y,K,M,B,V,H,D,N => 4-14
00013  * regardless of case
00014  */
00015 int hashbase(char n);
00016 /* convert 3-letter codon to a integer
00017  * from 0-63
00018  */
00019 int hashcodon(char c[3]);
00020 int hashcodon(const string &cc);
00021 
00022 class codon {
00023    public:
00024       /* initialize with the default universal codon */
00025       codon();
00026       /* use a given codon table 
00027        * given as a string of TTT F TTC F ....
00028        * This class should be able to input from more 
00029        * formats, such as files etc.
00030        * */
00031       codon(const std::string &def);
00032       char operator[](const string &cd);
00033       char operator[](char cc[3]);
00034       map<char,double> getAAUniformFrequency() const;
00035 
00036    private:
00037       map<string, char> tab;
00038       char nuc2aa[65]; // last character is ?
00039       void convert();
00040 };
00041 
00042 /* the universal codon table is defined like this
00043  */
00044 //   char nuc2aa[64]={ /* AAA */  'K', /* AAC */  'N', /* AAG */  'K',
00061 // Any exception must be handled outside this table.
00062 
00063 #endif

Generated on Wed Oct 14 21:49:10 2009 for Softwares from Orpara by  doxygen 1.5.6