[BiO BB] (no subject)
Kouichi Takahashi
shafi at sfc.keio.ac.jp
Tue Oct 9 10:05:59 EDT 2001
> "Sucheta Tripathi" <tsucheta at hotmail.com> writes:
>
> > I was writing a small program of DNA-> protein translation in C, but
> > when substituting 3 letter codons by an amino acid I can't think of
> > any other option than for if ..elseif statements, which makes me
> > wild. Can anyone suggest me any other way to go about it.
>
> Switch statement?
Table lookup.
const int CodonTable[4][4][4] =
{
{
/* AA? */
{Lys,Asn,Lys,Asn},
/* AC? */
{Thr,Thr,Thr,Thr},
/* AG? */
{Arg,Ser,Arg,Ser},
/* AT? */
{Ile,Ile,Met,Ile}
},
{
/* CA? */
{Gln,His,Gln,His},
/* CC? */
{Pro,Pro,Pro,Pro},
/* CG? */
{Arg,Arg,Arg,Arg},
/* CT? */
{Leu,Leu,Leu,Leu}
},
{
/* GA? */
{Glu,Asp,Glu,Asp},
/* GC? */
{Ala,Ala,Ala,Ala},
/* GG? */
{Gly,Gly,Gly,Gly},
/* GT? */
{Val,Val,gVal,Val}
},
{
/* TA? */
{Term,Tyr,Term,Tyr},
/* TC? */
{Ser,Ser,Ser,Ser},
/* TG? */
{Term,Cys,Trp,Cys},
/* TT? */
{Leu,Phe,Leu,Phe}
},
};
-----
Kouichi Takahashi E-CELL Project,
email: shafi at sfc.keio.ac.jp Institute for Advanced Biosciences
shafi at e-cell.org Keio Univ. SFC
More information about the BBB
mailing list