/* These code fragments emphasise the fact that the Genetic Code is a 3D array. (Incidentally this IS an efficient way of looking it up.) This code is in C but could be changed to PERL, Java, Javascript, Python or (with a bit more effort) FORTRAN. I _think_ register variables are unsupported in non-C languages so just make them ints. There's an amazing[ly confusing] discussion of unsigned in Javascript on the Web. Good luck. Just save this file "as text", remove the top and bottom lines and, in the case of C, provide a main() function and compile it. There is another copy under Software. */ #include #include /* PROTOTYPES START */ void strupper(char *); /* destructively turns a string to UC */ void init(void); /* see comments in code */ void strinv(char *); /* inverts e.g. FinsburyPark to kraPyrubsniF */ void complem(char *); /* A to T C to G etc. */ char decode(char *); /* see comments in code */ int main(void); /* this function needs writing ! */ /* PROTOTYPES END */ /* The following might come in useful somewhere */ void strupper(char *c) { int i=0; for(;i3||d[1]>3||d[2]>3) return '?'; else return(c[d[0]][d[1]][d[2]]); } /* global variable for aa names.... (!) */ /* NB in C an N-letter string ocupies N+1 chars with \'0 at the end. */ char aanames[26][4] = { "Ala"," ","Cys","Asp","Glu","Phe","Gly","His","Ile"," ","Lys","Leu","Met", "Asn"," ","Pro","Gln","Arg","Ser","Thr"," ","Val","Trp"," ","Tyr"," "}; int main(void) { ; }