#include <codon.h>
Public Member Functions | |
| codon () | |
| codon (const std::string &def) | |
| void | use (const int tabid) |
| char | operator[] (const string &cd) |
| char | operator[] (char cc[3]) |
| map< char, double > | getAAUniformFrequency () const |
| void | show (ostream &ous) const |
| codon () | |
| codon (const std::string &def) | |
| char | operator[] (const string &cd) |
| char | operator[] (char cc[3]) |
| map< char, double > | getAAUniformFrequency () const |
Static Public Member Functions | |
| static void | readCodonTable () |
| static void | setCodonFile (const char file[]) |
| static void | showAllCodonTables (ostream &ous) |
Static Public Attributes | |
| static const string | univcodon = "ttt F ttc F tta L ttg L tct S tcc S tca S tcg S tat Y tac Y taa * tag * tgt C tgc C tga * tgg W ctt L ctc L cta L ctg L cct P ccc P cca P ccg P cat H cac H caa Q cag Q cgt R cgc R cga R cgg R att I atc I ata I atg M act T acc T aca T acg T aat N aac N aaa K aag K agt S agc S aga R agg R gtt V gtc V gta V gtg V gct A gcc A gca A gcg A gat D gac D gaa E gag E ggt G ggc G gga G ggg G" |
| static char | unknownaa = 'X' |
| static char | codonfile [200] = "/home/kzhou/etc/codontable.txt" |
Private Member Functions | |
| void | convert () |
| void | convert () |
Private Attributes | |
| char | majorStart [4] |
| set< string > | altstart |
| map< string, char > | tab |
| char | nuc2aa [67] |
Static Private Attributes | |
| static vector< map< string, char > > | codontables = vector<map<string,char> >(28) |
| static vector< set< string > > | starts = vector<set<string> >(28) |
| codon::codon | ( | ) |
| codon::codon | ( | const std::string & | def | ) |
use a given codon table given as a string of TTT F TTC F .... This class should be able to input from more formats, such as files etc.
| def | is the string version of the codontable. It is in 3nt codon followed by space followed by sigle letter amino acid code. |
References convert(), majorStart, and tab.
| codon::codon | ( | ) |
| codon::codon | ( | const std::string & | def | ) |
| void codon::use | ( | const int | tabid | ) |
switch to a particular codon table. for example useTable(12). This will switch to Candida yeast codon table.
References altstart, codontables, convert(), readCodonTable(), showAllCodonTables(), starts, and tab.
Referenced by DNA::setCodonTable().
| char codon::operator[] | ( | const string & | cd | ) |
translate codon into one letter aa code This is the key method to convert codon into aa.
References hashcodon(), and nuc2aa.
| char codon::operator[] | ( | char | cc[3] | ) |
translate codon into amino acid one-ltter code. This is the efficient version. unknown codons such as NNN will be translated into '?' This is controlled by the unknowaa variable.
more efficient version
References hashcodon(), and nuc2aa.
| map< char, double > codon::getAAUniformFrequency | ( | ) | const |
| void codon::readCodonTable | ( | ) | [static] |
References codonfile, codontables, ifstream(), isCodonHeader(), starts, and string().
Referenced by showAllCodonTables(), and use().
| void codon::setCodonFile | ( | const char | file[] | ) | [static] |
References codonfile.
| void codon::show | ( | ostream & | ous | ) | const |
for debug purpose
References altstart, majorStart, and tab.
| void codon::showAllCodonTables | ( | ostream & | ous | ) | [static] |
| void codon::convert | ( | ) | [private] |
| char codon::operator[] | ( | const string & | cd | ) |
| char codon::operator[] | ( | char | cc[3] | ) |
| map<char,double> codon::getAAUniformFrequency | ( | ) | const |
| void codon::convert | ( | ) | [private] |
const string codon::univcodon = "ttt F ttc F tta L ttg L tct S tcc S tca S tcg S tat Y tac Y taa * tag * tgt C tgc C tga * tgg W ctt L ctc L cta L ctg L cct P ccc P cca P ccg P cat H cac H caa Q cag Q cgt R cgc R cga R cgg R att I atc I ata I atg M act T acc T aca T acg T aat N aac N aaa K aag K agt S agc S aga R agg R gtt V gtc V gta V gtg V gct A gcc A gca A gcg A gat D gac D gaa E gag E ggt G ggc G gga G ggg G" [static] |
char codon::unknownaa = 'X' [static] |
Symbol to use for unknow amino acid default X. translation of codons with Ns, such as NNN NNA, .... Even two bases determine an AA, we still translate it to X.
Referenced by convert().
char codon::codonfile = "/home/kzhou/etc/codontable.txt" [static] |
this is a global parameter it should be assigned to the system-wide directory. Now default to user or programmer's home directory $HOME/etc/codontable.txt
Referenced by readCodonTable(), and setCodonFile().
char codon::majorStart[4] [private] |
set<string> codon::altstart [private] |
map< string, char > codon::tab [private] |
temporary used by constructors. String foramt => tab ==convert()==>array format [nuc2aa]
Referenced by codon(), convert(), getAAUniformFrequency(), show(), and use().
char codon::nuc2aa [private] |
Referenced by convert(), and operator[]().
vector< map< string, char > > codon::codontables = vector<map<string,char> >(28) [static, private] |
so far there are 23 with 7,8 removed actually 21 table. We will leave 7,8 empty. I gave 28 for future growth. To see this table is loaded, you need to test the codon table at index 1.
Referenced by readCodonTable(), showAllCodonTables(), and use().
vector< set< string > > codon::starts = vector<set<string> >(28) [static, private] |
Referenced by readCodonTable(), and use().
1.5.6