Question: write a C++ program that reads a FASTA file and stores its information into a STL container ( A vector ). The program then asks

write a C++ program that reads a FASTA file and stores its information into a STL container ( A vector ). The program then asks the user to select a number for a sequence in the file and then it will display the content of the description line with (">") and subsequently the actual sequence. The requirements are the following:

The program will ask the user to input the name of the FASTA file

Use an STL container to store the sequences. Hint: A vector of vectors is a good choice.

The vectors inside the container should have 2 string elements, one for the description line and one for the sequence line

The program will then ask the user to input a sequence number and the program should display the actual description line and then in a separate line the actual sequence

The program should also tell the user the length of the sequence (number of characters) as well as the total number of sequences in the alignment

The program should make sure that the length of all the sequences is the same. If not, then it should complain giving an error message and provide the number of the first sequence that is not compatible with the previous ones

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!