Question: #NAME: # - - - - - - - - - - - - - - - - - - - - - - -
#NAME:
#
#PYTHON LAB
#
#PART
#FUNCTION NAME: rnaprotein
#PARAMETERS: An RNA sequence
#PURPOSE: The function should:
# Divide the RNA sequence into a list of base codons.
#HINT: You could use CodonList inside this function from previous lecture.
# Create a new protein string.
# Use the "standardcode" dictionary to find the amino acid for each codon in the list.
# 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 eg prot
standardcode
"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": PCCC: P "CCA": PCCG: P "CAU": H
"CAC": H "CAA": Q "CAG": Q "CGU": RCGC: R
"CGA": RCGG: 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": AGCC: A "GCA": A
GCG: A "GAU": D "GAC": D "GAA": E "GAG": E
"GGU": GGGC: G "GGA": GGGG: G
def rnaprotein:
return
#EXAMPLE:
#proteinrnaproteinGCGAGGGUCUGA
#print protein
#This should print:
#ARV
#
#PART
#FUNCTION NAME: dnaprotein
#PARAMETERS: A DNA sequence
#PURPOSE: The function should:
# Clean the DNA sequence and convert it to RNA. Just change Ts to Us dont reverse compliment
# Divide the RNA sequence into a list of base codons.
# Create a new protein string.
# Use the "standardcode" dictionary to find the amino acid for each codon.
# NOTE: Stop translating after "Stop" codons.
# Return the new protein string.
#RETURN VALUES: A protein sequence. A string
# FUNCTION
def dnaprotein:
return
#EXAMPLE:
#proteinndaprotein
ATGCaaaGAGacTGAgCC
t
#print protein
#The function would return:
# MQRD
#############Extra Practice##############
# Modify your dnaprotein function
# Use a tryexcept loop with your dictionary so that if the key is NOT in the dictionary,
# It adds a instead to the protein sequence.
#EXAMPLE:
#proteindnaprotein
ATGCaaGAGacTGAgCC
t
#print protein
###
#Should print:
# MRD
please dont use chatgpt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
