Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 14:30, officialrogerfp3gf2s
Select the correct answer. a company wants to use online methods to target more customers. it decides to conduct a market research by collecting the data of a few customers with their consent. they want to track data of the sites that their customers frequently visit. which software can the company? a. spyware b. bots c. adware d. trojan horse e. rootkits
Answers: 1
image
Computers and Technology, 24.06.2019 15:00, cooljariel11
What questions about an audience should be asked during presentation preparation? check all that apply. what does the audience already know about the topic? how will multimedia tools inspire the audience? is the information interesting and engaging? how will this information affect the presentation? will the audience change the message’s purpose? what is likely to interest the audience?
Answers: 3
image
Computers and Technology, 25.06.2019 02:30, Nismo3501037
What are the charges for invasion of privacy on computers
Answers: 1
image
Computers and Technology, 25.06.2019 08:10, Krazyyykiddd
What refrigerant has been approved for new household refrigerators and freezers
Answers: 1
Do you know the correct answer?
Coding exercise on Python dictionaries. Look at the DNA translation code (with the included dictiona...

Questions in other subjects: