Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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] 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started