The function to be built, amino_acids, must return a list of a tuple and an integer when given a string of mRNA code. The first tuple must contain all the amino acids and the integer must be the number of distinct amino acids. You can use the dictionary below to help with your function. The function must also not include the stop codon codes. NOTE : For this piece of code, we'll assume that there's only one stop codon in the sequence {'CUU': 'Leu', 'UAG': '---', 'ACA': 'Thr', 'AAA': 'Lys', 'AUC': 'Ile', 'AAC': 'Asn','AUA': 'Ile', 'AGG': 'Arg', 'CCU': 'Pro', 'ACU': 'Thr', 'AGC': 'Ser','AAG': 'Lys', 'AGA': 'Arg', 'CAU': 'His', 'AAU': 'Asn', 'AUU': 'Ile','CUG': 'Leu', 'CUA': 'Leu', 'CUC': 'Leu', 'CAC': 'His', 'UGG': 'Trp','CAA': 'Gln', 'AGU': 'Ser', 'CCA': 'Pro', 'CCG': 'Pro', 'CCC': 'Pro', 'UAU': 'Tyr', 'GGU': 'Gly', 'UGU': 'Cys', 'CGA': 'Arg', 'CAG': 'Gln', 'UCU': 'Ser', 'GAU': 'Asp', 'CGG': 'Arg', 'UUU': 'Phe', 'UGC': 'Cys', 'GGG': 'Gly', 'UGA':'---', 'GGA': 'Gly', 'UAA': '---', 'ACG': 'Thr', 'UAC': 'Tyr', 'UUC': 'Phe', 'UCG': 'Ser', 'UUA': 'Leu', 'UUG': 'Leu', 'UCC': 'Ser', 'ACC': 'Thr', 'UCA': 'Ser', 'GCA': 'Ala', 'GUA': 'Val', 'GCC': 'Ala', 'GUC': 'Val', 'GGC':'Gly', 'GCG': 'Ala', 'GUG': 'Val', 'GAG': 'Glu', 'GUU': 'Val', 'GCU': 'Ala', 'GAC': 'Asp', 'CGU': 'Arg', 'GAA': 'Glu', 'AUG': 'Met', 'CGC': 'Arg'} '---' represents the stop codons Example would be : 'AUGUCGGCACAUUUAUGCUCCUAAUCC' To give : [('Met', 'Ser', 'Ala', 'His', 'Leu', 'Cys', 'Ser'), 6] This is the summary of what is required from the challenge: The output must be a list of a tuple of strings (amino acid) and a single integer (number of distinct amino acids) Must use the dictionary to call the amino acid or stop codon Must convert the three codes into an amino acid and stop at the stop codon (the function assumes all the codes have only one stop codon) ### START FUNCTION def amino_acids(mrna): ### END FUNCTION test : amino_acids('AUGUCGGCACAUUUAUGCUCCUAAUCC')
The function to be built, amino_acids, must return a list of a tuple and an integer when given a string of mRNA code. The first tuple must contain all the amino acids and the integer must be the number of distinct amino acids. You can use the dictionary below to help with your function. The function must also not include the stop codon codes.
NOTE : For this piece of code, we'll assume that there's only one stop codon in the sequence
{'CUU': 'Leu', 'UAG': '---', 'ACA': 'Thr', 'AAA': 'Lys', 'AUC': 'Ile', 'AAC': 'Asn','AUA': 'Ile', 'AGG': 'Arg', 'CCU': 'Pro', 'ACU': 'Thr', 'AGC': 'Ser','AAG': 'Lys', 'AGA': 'Arg', 'CAU': 'His', 'AAU': 'Asn', 'AUU': 'Ile','CUG': 'Leu', 'CUA': 'Leu', 'CUC': 'Leu', 'CAC': 'His', 'UGG': 'Trp','CAA': 'Gln', 'AGU': 'Ser', 'CCA': 'Pro', 'CCG': 'Pro', 'CCC': 'Pro', 'UAU': 'Tyr', 'GGU': 'Gly', 'UGU': 'Cys', 'CGA': 'Arg', 'CAG': 'Gln', 'UCU': 'Ser', 'GAU': 'Asp', 'CGG': 'Arg', 'UUU': 'Phe', 'UGC': 'Cys', 'GGG': 'Gly', 'UGA':'---', 'GGA': 'Gly', 'UAA': '---', 'ACG': 'Thr', 'UAC': 'Tyr', 'UUC': 'Phe', 'UCG': 'Ser', 'UUA': 'Leu', 'UUG': 'Leu', 'UCC': 'Ser', 'ACC': 'Thr', 'UCA': 'Ser', 'GCA': 'Ala', 'GUA': 'Val', 'GCC': 'Ala', 'GUC': 'Val', 'GGC':'Gly', 'GCG': 'Ala', 'GUG': 'Val', 'GAG': 'Glu', 'GUU': 'Val', 'GCU': 'Ala', 'GAC': 'Asp', 'CGU': 'Arg', 'GAA': 'Glu', 'AUG': 'Met', 'CGC': 'Arg'}
'---' represents the stop codons
Example would be :
'AUGUCGGCACAUUUAUGCUCCUAAUCC'
To give : [('Met', 'Ser', 'Ala', 'His', 'Leu', 'Cys', 'Ser'), 6]
This is the summary of what is required from the challenge:
- The output must be a list of a tuple of strings (amino acid) and a single integer (number of distinct amino acids)
- Must use the dictionary to call the amino acid or stop codon
- Must convert the three codes into an amino acid and stop at the stop codon (the function assumes all the codes have only one stop codon)
### START FUNCTION
def amino_acids(mrna):
### END FUNCTION
test : amino_acids('AUGUCGGCACAUUUAUGCUCCUAAUCC')
Expected Outputs
amino_acids('AUGUCGGCACAUUUAUGCUCCUAAUCC') == [('Met', 'Ser', 'Ala', 'His', 'Leu', 'Cys', 'Ser'), 6] amino_acids('AUGCCACCUUGA') == [('Met', 'Pro', 'Pro'), 2] amino_acids('AUGUCCCCUGCACGAGGGCCAUCCUGAUCCCCCCAU') == [('Met', 'Ser', 'Pro', 'Ala', 'Arg', 'Gly', 'Pro', 'Ser'), 6] amino_acids('AUGUGGCGACUCUAUCGCGUUGCCCGGUACUGAAUGCCACCU') == [('Met', 'Trp', 'Arg', 'Leu', 'Tyr', 'Arg', 'Val', 'Ala', 'Arg', 'Tyr'), 7]
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images