Question: In Python, I have written a user-defined function that take sa given DNA codon and returns a list of all the amino acids that may
In Python, I have written a user-defined function that take sa given DNA codon and returns a list of all the amino acids that may result from any single point mutation in the codon. It is based on the dictionary I wrote, where the key is the codon and the value is its associated amino acid. Shown below:
geneticcode = { 'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M', 'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T', 'AAC':'N', 'AAT':'N', 'AAA':'K', 'AAG':'K', 'AGC':'S', 'AGT':'S', 'AGA':'R', 'AGG':'R', 'CTA':'L', 'CTC':'L', 'CTG':'L', 'CTT':'L', 'CCA':'P', 'CCC':'P', 'CCG':'P', 'CCT':'P', 'CAC':'H', 'CAT':'H', 'CAA':'Q', 'CAG':'Q', 'CGA':'R', 'CGC':'R', 'CGG':'R', 'CGT':'R', 'GTA':'V', 'GTC':'V', 'GTG':'V', 'GTT':'V', 'GCA':'A', 'GCC':'A', 'GCG':'A', 'GCT':'A', 'GAC':'D', 'GAT':'D', 'GAA':'E', 'GAG':'E', 'GGA':'G', 'GGC':'G', 'GGG':'G', 'GGT':'G', 'TCA':'S', 'TCC':'S', 'TCG':'S', 'TCT':'S', 'TTC':'F', 'TTT':'F', 'TTA':'L', 'TTG':'L', 'TAC':'Y', 'TAT':'Y', 'TGC':'C', 'TGT':'C', 'TGG':'W', }
bases = ["A","G","T","C"]
def function_1(codon):
for i in range (len(bases)): for base in bases: if codon[i] != base: aa = codon[:i] + base + codon[i+1:] print(geneticcode[aa], end=" ")
function_1("ATA")
When I run this program, the output is: V L L K R T M I I, as expected.
Now, write a user-defined function that takes an amino acid and randomly outputs an amino acid from function 1.
For example:
Input: F
Output: V
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
