Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Goals for this assignment 1. 2. Write an object-oriented program using a class. Practice modular programming by using well-defined functions. Build a class to represent
Goals for this assignment 1. 2. Write an object-oriented program using a class. Practice modular programming by using well-defined functions. Build a class to represent a DNA strand and the operations that can be performed on that strand. A strand should be represented in the class as a string. The operations you will need to support on the strand include: Produce a reverse strand: create a new strand that is the reverse of the original strand. Produce a complement of a strand: create a new strand that is the complement of the original strand. . Read a strand from a stream. . Display a strand to a stream Calculate the P-stat of two strands You may add other operations as necessary. The p-distance between two DNA strings (s1, s2) is the proportion of corresponding bases that differ between the two strings For example, if .S1 is: AAAACCCGGT . S2 is: AAACCCGGGT Then the p-distance, denoted p(s1,s2) is 2/10 or 0.2. The differing bases are the 4th and 7th ones. Driver The driver for this project must: 1. t two DNA strands from a file, DNA.txt. The file may contain more than two strands but you Read the firs will only read the first two. This file will have one DNA strand per line. All strands in this file will be the same length 2. Read one DNA strand from the keyboard. This strand must be the same length as the strands in the file 3. Display all three strands to the screen. 4. Display the reverse of all three strands to the screen. 5. Display the reverse of the reverse of all three strands to the screen (this should produce the original strands) Display the reverse complement of all three strands to the screen. Calculate the P-Stat between the keyboard strand and each file strand. Display the keyboard strand and the file strand most similar to the keyboard strand as well as the P-stat for these two strands. If both file strand produce the same P-Stat, display the first strand in the file. 6. 7. Notes on design: You are to use object-oriented design using one class. . For the class you will need a h and a cpp. You will also need a driver (named 02 DNAClasses.cpp) containing the main function. Your project must have at least 3 files in total. Error Handling If the file is invalid in anyway, print an error message and terminate. For example: o The file contains only zero or one strand o The file contains strands of different lengths The file contains an invalid strand (a base other than AT, c, or G is found. If the user provides a DNA strand of the wrong length at the keyboard or provides a strand with an invalid base, continue asking for the DNA strand until a correct, usable strand is provided . Sample File: CAT Sample Output PACIEIC DNA-O-MATIC DNA (length-3): CAT Original So: AA S1: CAT Reverse S0: AAA s1: TAC S2: TAC Reverse Reverse SO: AAA SI: CAT S2: CAT Reverse Complenent So: TTT S1: ATG S2: ATO Most Similar Keyboard: CAT File CAT P-stat 0.00
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started