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. 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 Example of the sequence is the file 1.txt: AAGGTAAGTTTAGAATATAAAAGGTGAGTTAAATAGAATAGGTTAAAATTAAAGGAGATCAGATCAGATCAGATCTATCTATCTATCTATCTATCAGAAAAGAGTAAATAGTTAAAGAGTAAGATATTGAATTAATGGAAAATATTGTTGGGGAAAGGAGGGATAGAAGG Implement/modify the following functions: 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& nameIndividuals, vector>& STRcounts) Update the function documentation accordingly. 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. 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: sequence1.txt small.txt 1 Expected output: Error in reading DNA sequence from the file: sequence1.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 Alice Bob Charlie ---------------------------------------- AGATC 2 4 3 AATG 8 1 2 TATC 3 5 5 Counts of the STRs in the DNA sequence is: 4 1 5 Found Match: Bob Example input 4: 13.txt large.txt 0 Expected output: Counts of the STRs in the DNA sequence is: 21 45 36 7 10 33 31 35 No Match Found!
In this final submission, you will build on checkpoint B to load the
name,AGATC,AATG,TATC
Alice,2,8,3
Bob,4,1,5
Charlie,3,2,5
Example of the sequence is the file 1.txt:
AAGGTAAGTTTAGAATATAAAAGGTGAGTTAAATAGAATAGGTTAAAATTAAAGGAGATCAGATCAGATCAGATCTATCTATCTATCTATCTATCAGAAAAGAGTAAATAGTTAAAGAGTAAGATATTGAATTAATGGAAAATATTGTTGGGGAAAGGAGGGATAGAAGG
Implement/modify the following functions:
- 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,
Update the function documentation accordingly.
-
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.
-
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:
sequence1.txt small.txt 1
Expected output:
Error in reading DNA sequence from the file: sequence1.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 Alice Bob Charlie
----------------------------------------
AGATC 2 4 3
AATG 8 1 2
TATC 3 5 5
Counts of the STRs in the DNA sequence is: 4 1 5
Found Match: Bob
Example input 4:
13.txt large.txt 0
Expected output:
Counts of the STRs in the DNA sequence is: 21 45 36 7 10 33 31 35
No Match Found!
Step by step
Solved in 4 steps with 4 images