subject

Coding exercise on Python dictionaries. Look at the DNA translation code (with the included dictionary for the codons to amino acids), STANDARD_GENETIC_CODE = { 'UUU':'Phe', 'UUC':'Phe', 'UCU':'Ser', 'UCC':'Ser', 'UAU':'Tyr', 'UAC':'Tyr', 'UGU':'Cys', 'UGC':'Cys', 'UUA':'Leu', 'UCA':'Ser', 'UAA':None, 'UGA':None, 'UUG':'Leu', 'UCG':'Ser', 'UAG':None, 'UGG':'Trp', 'CUU':'Leu', 'CUC':'Leu', 'CCU':'Pro', 'CCC':'Pro', 'CAU':'His', 'CAC':'His', 'CGU':'Arg', 'CGC':'Arg', 'CUA':'Leu', 'CUG':'Leu', 'CCA':'Pro', 'CCG':'Pro', 'CAA':'Gln', 'CAG':'Gln', 'CGA':'Arg', 'CGG':'Arg', 'AUU':'Ile', 'AUC':'Ile', 'ACU':'Thr', 'ACC':'Thr', 'AAU':'Asn', 'AAC':'Asn', 'AGU':'Ser', 'AGC':'Ser', 'AUA':'Ile', 'ACA':'Thr', 'AAA':'Lys', 'AGA':'Arg', 'AUG':'Met', 'ACG':'Thr', 'AAG':'Lys', 'AGG':'Arg', 'GUU':'Val', 'GUC':'Val', 'GCU':'Ala', 'GCC':'Ala', 'GAU':'Asp', 'GAC':'Asp', 'GGU':'Gly', 'GGC':'Gly', 'GUA':'Val', 'GUG':'Val', 'GCA':'Ala', 'GCG':'Ala', 'GAA':'Glu', 'GAG':'Glu', 'GGA':'Gly', 'GGG':'Gly'}
def proteinTranslation(seq, geneticCode): """ This function translates a nucleic acid sequence into a protein sequence, until the end or until it comes across a stop codon """ seq = seq. replace('T','U') # Make sure we have RNA sequence proteinSeq = [] i = 0 while i+2 < len(seq): codon = seq[i:i+3] aminoAcid = geneticCode[codon] if aminoAcid is None: # Found stop codon break proteinSeq. append(aminoAcid) i += 3
Give a short verbal description of what the code does on each line. Then start typing the code out on the online Python interpreter, but use an alternative dictionary with key-values for codons to amino acid called NON_STANDARD_GENETIC_CODE. Just type the first 20 key-value pairs or so from the STANDARD_GENETIC_CODE dictionary shown in the book. Now what you need to do for this exercise is to modify the "def proteintranslation" function, so that it has an "if"statement before the line where it pulls the codons from the dictionary. With this modification, our code will first check if that codon exists in the dictionary, and if not it sets the codon to a default codon='X', else it sets the default codon = seq[i:i+3]. You need to have the code working by writing out the def function, and demonstrating that you can call the function with a DNA sequence, and print out the translation of the DNA string. Try it with a few different DNA strings, and see how many X's you get.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:00
Which part of the cpu accepts data?
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Knowing that the central portion of link bd has a uniform cross sectional area of 800 mm2 , determine the magnitude of the load p for which the normal stress in link bd is 50 mpa. (hint: link bd is a two-force member.) ans: p = 62.7 kn
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
How are stop motion special effects in animated films created
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
Monica and her team have implemented is successfully in an organization. what factor leads to successful is implementation? good between different departments in an organization leads to successful is implementation.
Answers: 1
You know the right answer?
Coding exercise on Python dictionaries. Look at the DNA translation code (with the included dictiona...
Questions
question
Mathematics, 04.03.2020 04:53