Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Codon tables and amino acid letter converters In this exercise, you will create a Python solution that uses mappings to convert sequence information between different

Codon tables and amino acid letter converters
In this exercise, you will create a Python solution that uses mappings to convert sequence information between different amino acid representations. This includes the 3-letter codon code (RNA and DNA), the one letter amino acid code and the 3-letter amino acid code. The program will use different dictionaries that represent : codon tables one for DNA and the other for RNA, and amino acid letter representation converters.
Your task is to create a solution that asks for and collects a single input string using input() parses the string, looks up the information in the appropriate dictionary, and outputs the correct conversion For example:
if I enter ATG(without quotes), then the program will output:
ATG = MET
if I enter UAG(without quotes), then the program will output:
UAG =---
if I enter E(without quotes), then the program will output:
E = GLU
if I enter Asp(without quotes), then the program will output:
ASP = D
Hints:
The program might not get a valid codon. In that case, it should output 'unknown'. You can use the dictionary method 'get' and include a default_value to handle the 'unknown' case. Remeeber our discussion of how the or function is a short-circuit operator.
To get full credit on this assignment, your program needs to:
Run properly (execute and produce the correct output)
Contain docstrings and line comments (using #)
Include any assumptions or design decisions you made in writing your code
Include an overview describing what your program does with expected inputs and outputs as a program level docstring
converter
#!/usr/bin/env python3
# Name: Your full name
# Group Members: List full names or None
'''
Program docstring goes here
'''
short_AA ={
'CYS': 'C', 'ASP': 'D', 'SER': 'S','GLN': 'Q','LYS': 'K',
'ILE': 'I', 'PRO': 'P','THR': 'T', 'PHE': 'F', 'ASN': 'N',
'GLY': 'G', 'HIS': 'H', 'LEU': 'L', 'ARG': 'R','TRP': 'W',
'ALA': 'A', 'VAL': 'V', 'GLU': 'E','TYR': 'Y', 'MET': 'M'
}
long_AA ={value:key for key,value in short_AA.items()}
RNA_codon_table ={
# Second Base
# U C A G
#U
'UUU': 'Phe', 'UCU': 'Ser', 'UAU': 'Tyr', 'UGU': 'Cys',
'UUC': 'Phe', 'UCC': 'Ser', 'UAC': 'Tyr', 'UGC': 'Cys',
'UUA': 'Leu', 'UCA': 'Ser', 'UAA': '---', 'UGA': '---',
'UUG': 'Leu', 'UCG': 'Ser', 'UAG': '---', 'UGG': 'Trp',
#C
'CUU': 'Leu', 'CCU': 'Pro', 'CAU': 'His', 'CGU': 'Arg',
'CUC': 'Leu', 'CCC': 'Pro', 'CAC': 'His', 'CGC': 'Arg',
'CUA': 'Leu', 'CCA': 'Pro', 'CAA': 'Gln', 'CGA': 'Arg',
'CUG': 'Leu', 'CCG': 'Pro', 'CAG': 'Gln','CGG': 'Arg',
#A
'AUU': 'Ile', 'ACU': 'Thr', 'AAU': 'Asn', 'AGU': 'Ser',
'AUC': 'Ile', 'ACC': 'Thr', 'AAC': 'Asn', 'AGC': 'Ser',
'AUA': 'Ile', 'ACA': 'Thr', 'AAA': 'Lys', 'AGA': 'Arg',
'AUG': 'Met', 'ACG': 'Thr', 'AAG': 'Lys', 'AGG': 'Arg',
#G
'GUU': 'Val', 'GCU': 'Ala', 'GAU': 'Asp', 'GGU': 'Gly',
'GUC': 'Val', 'GCC': 'Ala', 'GAC': 'Asp', 'GGC': 'Gly',
'GUA': 'Val', 'GCA': 'Ala', 'GAA': 'Glu', 'GGA': 'Gly',
'GUG': 'Val', 'GCG': 'Ala', 'GAG': 'Glu', 'GGG': 'Gly'
}
dnaCodonTable ={key.replace('U','T'):value for key, value in rnaCodonTable.items()}
def main():
''' Function docstring goes here'''
pass
main()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions