Question: Please use basic python and do not import functions. [50 points] Write a function that takes as input a DNA sequence, and outputs the protein

Please use basic python and do not import functions. [50 points] WritePlease use basic python and do not import functions.

[50 points] Write a function that takes as input a DNA sequence, and outputs the protein sequence. Assume there are no introns. Look for the start codon (ATG) and map the codons from the start. When the codon read is a STOP codon, stop adding amino acids. Output should be the protein sequence. Codon table is attached as a text file. Hint: use dictionaries again to map the 64 codons to their amino acids - but instead of using nested loop, read from the codon.txt file. Partial code for creating codon table is given below. fin = open("codon.txt", "r") lines = fin.readlines() fin.close() aa=\{\} for line in lines: vals = line.split() \# split function split the line aa [_] = vals[_] \#Fill the blanks with appropriate values dnalen = len(seq) i=0 start=0 protein="" pwrite code here to read the line and look whether start codon is encountered. Then keep translating by using the dictionary until the codon read is a stop codon print(protein)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!