Hi, my head is boiling now for 3 days! I want to get all the DNA encodings for the peptide: the peptide is a sequence of amino acids, i.e. amino acid M , and amino acid Q can form an MQ or QM peptide
DNA coding means that for each amino acid there is a DNA code (called a codon) (for some, there is more than one code, i.e. amino acid T has 4 different code / codons)
The last function in the following code does not work, so I want someone to make it work for me and please do not require an integrated query language (I forgot its abbreviation!) `
private string[] CODONS ={ "TTT", "TTC", "TTA", "TTG", "TCT", "TCC", "TCA", "TCG", "TAT", "TAC", "TGT", "TGC", "TGG", "CTT", "CTC", "CTA", "CTG", "CCT", "CCC", "CCA", "CCG", "CAT", "CAC", "CAA", "CAG", "CGT", "CGC", "CGA", "CGG", "ATT", "ATC", "ATA", "ATG", "ACT", "ACC", "ACA", "ACG", "AAT", "AAC", "AAA", "AAG", "AGT", "AGC", "AGA", "AGG", "GTT", "GTC", "GTA", "GTG", "GCT", "GCC", "GCA", "GCG", "GAT", "GAC", "GAA", "GAG", "GGT", "GGC", "GGA", "GGG", }; private string[] AMINOS_PER_CODON = { "F", "F", "L", "L", "S", "S", "S", "S", "Y", "Y", "C", "C", "W", "L", "L", "L", "L", "P", "P", "P", "P", "H", "H", "Q", "Q", "R", "R", "R", "R", "I", "I", "I", "M", "T", "T", "T", "T", "N", "N", "K", "K", "S", "S", "R", "R", "V", "V", "V", "V", "A", "A", "A", "A", "D", "D", "E", "E", "G", "G", "G", "G", }; public string codonToAminoAcid(String codon) { for (int k = 0; k < CODONS.Length; k++) { if (CODONS[k].Equals(codon)) { return AMINOS_PER_CODON[k]; } } // never reach here with valid codon return "X"; } public string AminoAcidToCodon(String aminoAcid) { for (int k = 0; k < AMINOS_PER_CODON .Length; k++) { if (AMINOS_PER_CODON [k].Equals(aminoAcid )) { return CODONS[k]; } } // never reach here with valid codon return "X"; } public string GetCodonsforPeptide(string pep) { string result = ""; for (int i = 0; i <pep.Length ; i++) { result = AminoAcidToCodon(pep.Substring (i,1) ); for (int q = 0; q < pep.Length; q++) { result += AminoAcidToCodon(pep.Substring(q, 1)); } } return result; }