DNA sequences are a series of four letters: A, C, G, and T. When our body is reading these sequences, it reads them in sets of three, which are referred to as codons. Each codon tells your body to do one of three things: 1. Start reading, 2. Add a molecule to the sequence, 3. Stop reading. The START codon is ATG, and the STOP codons are either TAA, TAG, or TGA; any of those three will stop it. Every other combination of A/C/G/T will add a different molecule to the sequence. Write a function dnaRead which takes a vector of strings, each of length 3, as the parameter and returns the DNA sequence between the start and stop codons, with the following qualities: • Function Specifications: o The function name: dna Read o The function parameters in this order: ▪ vector dna: a vector of strings each of length 3, only containing A/C/G/T o The function returns a string: ■ If any vector element is not length 3 or contains a character that is none of A, C, G, or T, return "Invalid Sequence" ■ It returns the combined DNA sequence between the start and stop codons, EXCLUSIVELY. ■ If there is no start codon, it returns the empty string, "". ■ If there is no stop codon, it returns the entire remainder of the string after the start codon.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

In C++

DNA sequences are a series of four letters: A, C, G, and T. When our body is reading these sequences, it reads them in sets
of three, which are referred to as codons. Each codon tells your body to do one of three things:
1. Start reading,
2. Add a molecule to the sequence,
3. Stop reading.
The START codon is ATG, and the STOP codons are either TAA, TAG, or TGA; any of those three will stop it. Every
other combination of A/C/G/T will add a different molecule to the sequence.
Write a function dnaRead which takes a vector of strings, each of length 3, as the parameter and returns the DNA sequence
between the start and stop codons, with the following qualities:
• Function Specifications:
o The function name: dna Read
o The function parameters in this order:
▪ vector<string> dna: a vector of strings each of length 3, only containing A/C/G/T
o The function returns a string:
■ If any vector element is not length 3 or contains a character that is none of A, C, G, or T, return "Invalid
Sequence"
■ It returns the combined DNA sequence between the start and stop codons, EXCLUSIVELY.
■ If there is no start codon, it returns the empty string, "".
■ If there is no stop codon, it returns the entire remainder of the string after the start codon.
Transcribed Image Text:DNA sequences are a series of four letters: A, C, G, and T. When our body is reading these sequences, it reads them in sets of three, which are referred to as codons. Each codon tells your body to do one of three things: 1. Start reading, 2. Add a molecule to the sequence, 3. Stop reading. The START codon is ATG, and the STOP codons are either TAA, TAG, or TGA; any of those three will stop it. Every other combination of A/C/G/T will add a different molecule to the sequence. Write a function dnaRead which takes a vector of strings, each of length 3, as the parameter and returns the DNA sequence between the start and stop codons, with the following qualities: • Function Specifications: o The function name: dna Read o The function parameters in this order: ▪ vector<string> dna: a vector of strings each of length 3, only containing A/C/G/T o The function returns a string: ■ If any vector element is not length 3 or contains a character that is none of A, C, G, or T, return "Invalid Sequence" ■ It returns the combined DNA sequence between the start and stop codons, EXCLUSIVELY. ■ If there is no start codon, it returns the empty string, "". ■ If there is no stop codon, it returns the entire remainder of the string after the start codon.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education