Question
Enhancing your Ribosome . Take your Ribosome code, and improve it so that it translates the DNA sequence detailed in yhr vh7.aminoAcidDict2.py file. You can
Enhancing your Ribosome. Take your Ribosome code, and improve it so that it translates the DNA sequence detailed in yhr vh7.aminoAcidDict2.py file.
You can incorporate that code by pasteing it in, but you should build out the makeCodonToAaDict function, as described there and use it,such as by having your getAa function call it. Alterntatively you could just build a new streamlined getAa that can deal with any codon. The choice is yours.
Save your results as one file: call it Dict.yourUserName.py and upload it here
Heres the Ribosome code below:
Enhanced Ribosomecodontable = {'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', 'TAA':'_', 'TAG':'_','TGC':'C', 'TGT':'C', 'TGA':'_', 'TGG':'W',}
def getAa(codon, codontable):
'''takes imput of a codon and codontable and returns the appropriate amino acid(a letter) or stop (_), else return an X'''
if codon in codontable:
return codontable[codon]
else:
return 'X'
#X=Unknown/Any amino acid
def translateDna(DNA):
'''takes a DNA and devides it into codons, calls getAa for each codon and returns it the Polypeptide translation''' indexlist=range(0,len(DNA),3)
codons=[]
for index in indexlist:
codons.append(DNA[index:index+3])
protein=''
for codon in codons:
aminoAcid= getAa(codon,codontable)
protein=protein+aminoAcid
return protein
#TEST Code For translateDNAprint translateDna('ATGTTTTTCTTATTGCTTCTCCTACTGATTATCATAATGGTTGTCGTAGTGTCTTCCTCGATCGAGTAGCCCTCCCCCACCGACTACCACAACGGCTGCCGCAGCGTATTACTAATAGTGACATCACCAACAGAATAACAAAAAGGATGACGAAGAGTGTTGCTGGCGTCGCCGACGGAGAAGGGGTGGCGGAGGGTAGAAAAA)
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