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 20:10
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
question
Computers and Technology, 23.06.2019 10:20
Suppose there is a relation r(a, b, c) with a b+-tree index with search keys (a, b).1. what is the worst-case cost of finding records satisfying 10 < a < 50 using this index, in terms of the number of records n1, retrieved and the height h of the tree? 2. what is the worst-case cost of finding records satisfying 10 < a < 50 and 5 < b < 10 using this index, in terms of the number of records n2 that satisfy this selection, as well as n1 and h defined above? 3. under what conditions on n1 and n2, would the index be an efficient way of finding records satisfying the condition from part (2)?
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
What are the possible consequences of computer hacking? what is computer piracy? describe some examples. what are the effects of computer piracy? what are the possible consequences of computer piracy? what is intentional virus setting? describe some examples. what are the effects of intentional virus setting? what are the possible consequences of intentional virus setting? what is invasion of privacy? describe some examples. what are the effects of invasion of privacy? what are the possible consequences of invasion of privacy? what is an acceptable use policy and what is the purpose of the acceptable use policy what is intellectual property and how can you use it?
Answers: 1
question
Computers and Technology, 24.06.2019 18:20
The following if statement contains a logic error, not a syntax error. rewrite it so that it is correct. assume the variable age already exists and holds a valid number. if (age == 18 & & age == 19) {
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, 13.04.2021 18:40
question
Mathematics, 13.04.2021 18:40
question
Mathematics, 13.04.2021 18:40
question
Mathematics, 13.04.2021 18:40
Questions on the website: 13722367