Answer to Question #277207 in Python for jammy

Question #277207

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*

1
Expert's answer
2021-12-09T01:23:45-0500
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='')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS