Taking some samples of DNA from patients, use state-of-the-art equipment to let computers collect and extract important information that can be found in the DNA sequence. Applying the computational analysis to the data extracted would enable the doctor to determine more accurately patients’ real health problems. In this scenario, you will serve as an intern in laboratory who will be assigned an important task. You will be given a long DNA sequence, which is represented in a string of letters. Your task is to convert 3-letter codons into protein residues. The output would be the corresponding residues.
INPUT: DNA sequence
OUTPUT: Generated 3-letter codons and corresponding protein residues
An input sample of DNA sequence would look like this:
TGGTACTCTTTCTTCACAAGGGCGCCGTGTGTG
The 3-letter codons are simply every three letters in the sequence.
TGG TAC TCT TTC TTC ACA AGG GCG CCG TGT GT
The corresponding protein residues based on generated 3-letter codons and equivalent mapping will be: WYSFFTRAPC*
d = {
'TTC': 'F', 'TTT': 'F', 'TCA': 'S', 'TCG': 'S', 'TGG': 'W', 'CCC': 'P',
'CCA': 'P', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 'TCC': 'S', 'TGT': 'C',
'TGC': 'C', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCG': 'P', 'CAT': 'H',
'CAC': 'H', 'CAA': 'Q', 'CGA': 'R', 'CGG': 'R', 'ATT': 'I', 'ACC': 'T',
'ACA': 'T', 'AAG': 'K', 'AGT': 'S', 'TAT': 'Y', 'TAC': 'Y', 'CTT': 'L',
'CTC': 'L', 'CGC': 'R', 'CAG': 'Q', 'CGT': 'R', 'ATC': 'I', 'ATA': 'I',
'ACG': 'T', 'AAT': 'N', 'AGC': 'S', 'AGA': 'R', 'GTG': 'V', 'GAC': 'D',
'GAA': 'E', 'ACT': 'T', 'AAA': 'K', 'GTT': 'V', 'ATG': 'M', 'AAC': 'N',
'GTA': 'V', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 'GGT': 'G',
'GGC': 'G', 'GGA': 'G', 'AGG': 'R', 'GTC': 'V', 'GCT': 'A', 'GAG': 'E',
'GGG': 'G',
}
dna = input('Enter DNA sequence: ')
dna_list = [dna[i - 3: i] for i in range(3, len(dna) + 1, 3)]
print(' '.join(dna_list))
for i in dna_list:
print(d[i], end='')
Comments
Leave a comment