1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Bogdan [553]
3 years ago
11

Write a program that repeatedly accepts as input a string of ACGT triples and produces a list of the triples and the correspondi

ng amino acids, one set per line. The program will continue to accept input until the user just presses ENTER without entering any DNA codes.
Computers and Technology
1 answer:
Andre45 [30]3 years ago
5 0

Answer:

Explanation:

The following code is written in Python. I created a dictionary with all the possible gene combinations and their corresponding amino acids. The user then enters a string. The string is split into triples and checked against the dictionary. If a value exists the gene and amino acid is printed, otherwise an "Invalid Sequence" error is printed for that triple. The program has been tested and the output can be seen in the attached image below.

def printAminoAcids():

   data = {

       'TTT': 'Phe', 'TCT': 'Ser', 'TGT': 'Cys', 'TAT': 'Tyr',

       'TTC': 'Phe', 'TCC': 'Ser', 'TGC': 'Cys', 'TAC': 'Tyr',

       'TTG': 'Leu', 'TCG': 'Ser', 'TGG': 'Trp', 'TAG': '***',

       'TTA': 'Leu', 'TCA': 'Ser', 'TGA': '***', 'TAA': '***',

       'CTT': 'Leu', 'CCT': 'Pro', 'CGT': 'Arg', 'CAT': 'His',

       'CTC': 'Leu', 'CCC': 'Pro', 'CGC': 'Arg', 'CAC': 'His',

       'CTG': 'Leu', 'CCG': 'Pro', 'CGG': 'Arg', 'CAG': 'Gln',

       'CTA': 'Leu', 'CCA': 'Pro', 'CGA': 'Arg', 'CAA': 'Gln',

       'GTT': 'Val', 'GCT': 'Ala', 'GGT': 'Gly', 'GAT': 'Asp',

       'GTC': 'Val', 'GCC': 'Ala', 'GGC': 'Gly', 'GAC': 'Asp',

       'GTG': 'Val', 'GCG': 'Ala', 'GGG': 'Gly', 'GAG': 'Glu',

       'GTA': 'Val', 'GCA': 'Ala', 'GGA': 'Gly', 'GAA': 'Glu',

       'ATT': 'Ile', 'ACT': 'Thr', 'AGT': 'Ser', 'AAT': 'Asn',

       'ATC': 'Ile', 'ACC': 'Thr', 'AGC': 'Ser', 'AAC': 'Asn',

       'ATG': 'Met', 'ACG': 'Thr', 'AGG': 'Arg', 'AAG': 'Lys',

       'ATA': 'Ile', 'ACA': 'Thr', 'AGA': 'Arg', 'AAA': 'Lys'

   }

   string = input("Enter Sequence or just click Enter to quit: ")

   sequence_list = []

   count = 0

   gene = ""

   for x in range(len(string)):

       if count < 3:

           gene += string[x]

           count += 1

       else:

           sequence_list.append(gene)

           gene = ""

           gene += string[x]

           count = 1

   sequence_list.append(gene)

   for gene in sequence_list:

       if gene.upper() in data:

           print(str(gene.upper()) + ": " + str(data[gene.upper()]))

       else:

           print(str(gene.upper()) + ": invalid sequence")

printAminoAcids()

You might be interested in
1.      To reference a style sheet across multiple HTML pages, how would you define your CSS?​
lawyer [7]

Answer:

If you want to make a footer that attaches to the bottom of the user's window and not just the bottom of the page, what two properties would you use? Q . The ------------- shorthand property sets all the border properties in one declaration.

Explanation:

7 0
3 years ago
What is a raster graphic?
kifflom [539]
<span>In computer graphics, a raster graphics or bitmap image is a dot matrix data structure, representing a generally rectangular grid of pixels, or points of color, viewable via a monitor, paper, or other display medium.</span>
6 0
3 years ago
MaKe TeA In ThE AnSwErs
AfilCa [17]
Pineapples don’t taste good.
4 0
3 years ago
Maia wants to highlight the word mob in her first paragraph. Choose the steps that Maia will need to do to complete this process
Bess [88]

Answer: Step 2: Go to the font command group

Step 3: click on the text highlight color button

Step 4: Click on the color

Explanation:

4 0
4 years ago
Read 2 more answers
A sentence that explains how one action happens because of another action is a
sammy [17]

Answer:B

Explanation:

6 0
3 years ago
Other questions:
  • I plugged my headphones into my computer, but the sound still came out of the speakers. help!
    12·2 answers
  • Given an array a, declared to contain 34 elements, write an expression that refers to the last element of the array.
    12·1 answer
  • What are the differences between message confidentiality and message integrity? Can you have confidentiality without integrity?
    9·1 answer
  • What is an internt?​
    10·1 answer
  • Which of the following entries into the username and password fields will NOT cause us to gain admin access? You may assume that
    12·1 answer
  • How does having weak security on your browser represent the weakest link in a network
    8·1 answer
  • Helen is working on her colleague’s photos. She came across this particular photo and was confused about which effect the photog
    15·2 answers
  • Write a class that specify the characteristics of a car, like type (sedan, jeep, mini, SUV, etc), gear (auto, manual), maximum s
    12·1 answer
  • How to tell if your cell phone is being tracked tapped or monitored by spy software?
    12·1 answer
  • Write a function called printRange() that accepts two integers as arguments and prints the sequence of numbers between the two a
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!