Question: #NAME: # - - - - - - - - - - - - - - - - - - - - - - -

#NAME:
#------------------------------------------------------------------------------------------
#PYTHON LAB 6
#------------------------------------------------------------------------------------------
#PART 1-
#FUNCTION NAME: rna2protein
#PARAMETERS: 1(An RNA sequence)
#PURPOSE: The function should:
# (1) Divide the RNA sequence into a list of 3-base codons.
#HINT: You could use CodonList inside this function from previous lecture.
# (2) Create a new protein string.
# (3) Use the "standard_code" dictionary to find the amino acid for each codon in the list.
# (4) Return the new protein string.
#RETURN VALUES: A protein sequence. (A string)
#Hint: When building the protein you are trying to return, add the dictionary values below (the letters
# of the amino acids to an empty string (e.g., prot="").
standard_code ={
"UUU": "F", "UUC": "F", "UUA": "L", "UUG": "L", "UCU": "S",
"UCC": "S", "UCA": "S", "UCG": "S", "UAU": "Y", "UAC": "Y",
"UAA": "*", "UAG": "*", "UGA": "*", "UGU": "C", "UGC": "C",
"UGG": "W", "CUU": "L", "CUC": "L", "CUA": "L", "CUG": "L",
"CCU": "P","CCC": "P", "CCA": "P","CCG": "P", "CAU": "H",
"CAC": "H", "CAA": "Q", "CAG": "Q", "CGU": "R","CGC": "R",
"CGA": "R","CGG": "R", "AUU": "I", "AUC": "I", "AUA": "I",
"AUG": "M", "ACU": "T", "ACC": "T", "ACA": "T", "ACG": "T",
"AAU": "N", "AAC": "N", "AAA": "K", "AAG": "K", "AGU": "S",
"AGC": "S", "AGA": "R", "AGG": "R", "GUU": "V", "GUC": "V",
"GUA": "V", "GUG": "V", "GCU": "A","GCC": "A", "GCA": "A",
"GCG": "A", "GAU": "D", "GAC": "D", "GAA": "E", "GAG": "E",
"GGU": "G","GGC": "G", "GGA": "G","GGG": "G"}
def rna2protein():
return
#EXAMPLE:
#protein=rna2protein("GCGAGGGUCUGA")
#print (protein)
#This should print:
#ARV*
#------------------------------------------------------------------------------------------
#PART 2-
#FUNCTION NAME: dna2protein
#PARAMETERS: 1(A DNA sequence)
#PURPOSE: The function should:
# (1) Clean the DNA sequence and convert it to RNA. Just change T's to U's (don't reverse compliment)
# (2) Divide the RNA sequence into a list of 3-base codons.
# (3) Create a new protein string.
# (4) Use the "standard_code" dictionary to find the amino acid for each codon.
# [NOTE: Stop translating after "Stop" codons.]
# (5) Return the new protein string.
#RETURN VALUES: A protein sequence. (A string)
#== FUNCTION 2==
def dna2protein():
return
#EXAMPLE:
#protein=nda2protein("
ATGCaaaGAGacTGAgCC
\t
")
#print (protein)
#The function would return:
# MQRD*
#############Extra Practice##############
# Modify your dna2protein function
# Use a try/except loop with your dictionary so that if the key is NOT in the dictionary,
# It adds a "?" instead to the protein sequence.
#EXAMPLE:
#protein2=dna2protein("
ATGC-aaGAGacTGAgCC
\t
")
#print (protein2)
###
#Should print:
# M?RD*
please dont use chatgpt

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 Programming Questions!