codon Class Reference

#include <codon.h>

List of all members.

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)


Detailed Description

used for translation of nucleic acids. Normally we use T for U. We are kind of doing DNA CDS, not directly translating mRNA.

Constructor & Destructor Documentation

codon::codon (  ) 

initialize with the default universal codon table.

References altstart, convert(), majorStart, tab, and univcodon.

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.

Parameters:
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  ) 


Member Function Documentation

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

References tab.

Referenced by Protein::relativeEntropyUniform().

void codon::readCodonTable (  )  [static]

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]

References codontables, and readCodonTable().

Referenced by use().

void codon::convert (  )  [private]

convert the encoded table into one dimentional array for fast look up. unknown codon use ?, 1 for 1 Nucleotide at end of seq. 2 for two nucleotide of codon left even 6 aa can be determined by 2-nucleotides.

References hashcodon(), nuc2aa, tab, and unknownaa.

Referenced by codon(), and use().

char codon::operator[] ( const string &  cd  ) 

char codon::operator[] ( char  cc[3]  ) 

map<char,double> codon::getAAUniformFrequency (  )  const

void codon::convert (  )  [private]


Member Data Documentation

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]

universal codon It was initialized with lower case 3 letter codons followed by single letter amino acids code. Total 64 codons with star represents stop codon.

Referenced by codon().

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]

Referenced by codon(), and show().

set<string> codon::altstart [private]

alternative starts

Referenced by codon(), show(), and use().

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().


The documentation for this class was generated from the following files:

Generated on Wed Aug 10 11:57:09 2011 for Softwares from Orpara by  doxygen 1.5.6