In this final submission, you will build on checkpoint B to load the database and DNA sequence from files. There will be two databases and several sequences that will be available for download below. An example of the database is the file small.txt: name, AGATC, AATG, TATC Alice, 2,8,3 Bob, 4, 1,5 Charlie, 3, 2,5 Note the difference in the format of the database from checkpoint B. An example of the sequence is the file 1.txt: AAGGTAAGTTTAGAATATAAAAGGTGAGTTAAATAGAATAGGTTAAAATTAAAGGAGATCAGATCAGATCAGATCTATCTATCTATCT You will implement/modify the following functions: 1. Modify the function readData, which will now take an additional parameter: a string representing the filename containing the database of individuals and their STR counts. It will also return a bool indicating if opening the file was successful or not: bool readData (string filename, vector & nameSTRS, vector & name Individuals, vector>& STRcounts) Update the function documentation accordingly. 2. Implement a new function getSequenceFromFile that takes two parameters: a string representing the sequence filename (such as 1. txt), and a string that will store the DNA sequence contained in the file. It will return a bool indicating if opening the file was successful or not. The function's prototype is not provided on purpose (you should be able to decipher it from the description). You must also write the complete function documentation. 3. Update the main () function to prompt the user for the filename of the sequence. If the file doesn't open, print an error message and return. Next, prompt the user for the filename of the database. If the file doesn't open, print an error message and return. See the sample output below for the format of the error messages. Next, prompt the user for an integer. If it is equal to 0, do not print the data (i.e. do not call the function printData), otherwise print it. The rest of the main () continues as before (displaying the counts for each STR read from the data in the provided DNA sequence and displaying the match, if there is one). Example input 1: sequencel.txt small.txt 1 Expected output: Error in reading DNA sequence from the file: sequencel.txt Example input 2: 1.txt db.txt 1 Expected output: Error in reading DB file: db.txt Example input 3: 1.txt small.txt 1 Expected output: name AGATC AATG TATC Alice 2 8 3 Example input 4: Bob 13.txt large.txt 0 4 1 5 Charlie Counts of the STRS in the DNA sequence is: 4 1 5 Found Match: Bob 3 2 5 Expected output: Counts of the STRS in the DNA sequence is: 21 45 36 7 10 33 31 35 No Match Found!

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 this final submission, you will build on checkpoint B to load the database and DNA sequence from files. There will be two
databases and several sequences that will be available for download below. An example of the database is the file
small.txt:
name, AGATC, AATG, TATC
Alice, 2,8,3
Bob, 4, 1,5
Charlie, 3, 2,5
Note the difference in the format of the database from checkpoint B.
An example of the sequence is the file 1.txt:
AAGGTAAGTTTAGAATATAAAAGGTGAGTTAAATAGAATAGGTTAAAATTAAAGGAGATCAGATCAGATCAGATCTATCTATCTATCT
You will implement/modify the following functions:
1. Modify the function readData, which will now take an additional parameter: a string representing the filename
containing the database of individuals and their STR counts. It will also return a bool indicating if opening the file was
successful or not:
bool readData (string filename, vector<string>& name STRS, vector<string>&
name Individuals, vector<vector<int>>& STRcounts)
Update the function documentation accordingly.
2. Implement a new function getSequenceFromFile that takes two parameters: a string representing the sequence
filename (such as 1. txt), and a string that will store the DNA sequence contained in the file. It will return a bool
indicating if opening the file was successful or not. The function's prototype is not provided on purpose (you should be
able to decipher it from the description). You must also write the complete function documentation.
3. Update the main () function to prompt the user for the filename of the sequence. If the file doesn't open, print an error
message and return. Next, prompt the user for the filename of the database. If the file doesn't open, print an error
message and return. See the sample output below for the format of the error messages. Next, prompt the user for an
integer. If it is equal to 0, do not print the data (i.e. do not call the function print Data), otherwise print it. The rest of
the main () continues as before (displaying the counts for each STR read from the data in the provided DNA
sequence and displaying the match, if there is one).
Example input 1:
sequencel.txt
small.txt 1
Expected output:
Error in reading DNA sequence from the file: sequencel.txt
Example input 2:
1.txt
db.txt 1
Expected output:
Error in reading DB file: db.txt
Example input 3:
1.txt
small.txt 1
Expected output:
name
AGATC
AATG
TATC
Alice
2
8
3
Example input 4:
Bob
13.txt
large.txt 0
4
1
5
Charlie
Counts of the STRS in the DNA sequence is: 4 1 5
Found Match: Bob.
3
2
5
Expected output:
Counts of the STRS in the DNA sequence is: 21 45 36 7 10 33 31 35
No Match Found!
Transcribed Image Text:In this final submission, you will build on checkpoint B to load the database and DNA sequence from files. There will be two databases and several sequences that will be available for download below. An example of the database is the file small.txt: name, AGATC, AATG, TATC Alice, 2,8,3 Bob, 4, 1,5 Charlie, 3, 2,5 Note the difference in the format of the database from checkpoint B. An example of the sequence is the file 1.txt: AAGGTAAGTTTAGAATATAAAAGGTGAGTTAAATAGAATAGGTTAAAATTAAAGGAGATCAGATCAGATCAGATCTATCTATCTATCT You will implement/modify the following functions: 1. Modify the function readData, which will now take an additional parameter: a string representing the filename containing the database of individuals and their STR counts. It will also return a bool indicating if opening the file was successful or not: bool readData (string filename, vector<string>& name STRS, vector<string>& name Individuals, vector<vector<int>>& STRcounts) Update the function documentation accordingly. 2. Implement a new function getSequenceFromFile that takes two parameters: a string representing the sequence filename (such as 1. txt), and a string that will store the DNA sequence contained in the file. It will return a bool indicating if opening the file was successful or not. The function's prototype is not provided on purpose (you should be able to decipher it from the description). You must also write the complete function documentation. 3. Update the main () function to prompt the user for the filename of the sequence. If the file doesn't open, print an error message and return. Next, prompt the user for the filename of the database. If the file doesn't open, print an error message and return. See the sample output below for the format of the error messages. Next, prompt the user for an integer. If it is equal to 0, do not print the data (i.e. do not call the function print Data), otherwise print it. The rest of the main () continues as before (displaying the counts for each STR read from the data in the provided DNA sequence and displaying the match, if there is one). Example input 1: sequencel.txt small.txt 1 Expected output: Error in reading DNA sequence from the file: sequencel.txt Example input 2: 1.txt db.txt 1 Expected output: Error in reading DB file: db.txt Example input 3: 1.txt small.txt 1 Expected output: name AGATC AATG TATC Alice 2 8 3 Example input 4: Bob 13.txt large.txt 0 4 1 5 Charlie Counts of the STRS in the DNA sequence is: 4 1 5 Found Match: Bob. 3 2 5 Expected output: Counts of the STRS in the DNA sequence is: 21 45 36 7 10 33 31 35 No Match Found!
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Linux
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.
Similar questions
  • SEE MORE QUESTIONS
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