C++ help

profileARapSal
instructions.docx

Description: Computers are used in many different fields, including biology. The study of DNA sequencing makes extensive use of computers to reconstruct DNA genomes for different plants and animals. A popular method for discovering the genome is called “shotgunning.” In shotgunning copies of the entire genome DNA are broken up into smaller pieces and then those smaller pieces are analyzed and reassembled. The base pairs making up the sequence can be matched at the end of two samples and pasted together when they match. Possible base pairs are A, C, G, and T. Suppose we have a DNA sequence of

TAGGACTAGCATTAGACCAT

and another consisting of

TAGCATTAGACCATAACCATAGAGA

then we can see that the two sequences have an identical sequence consisting of

TAGCATTAGACCAT

Two subsequences are considered to be part of the same overall sequence if a certain number of base pairs are identical. Let that minimum number be six base pairs. If a match can be made on the minimum number of base pairs in two different fragments, then the fragments can be combined. For example, the two fragments used in the example can be combined into

TAGGACTAGCATTAGACCATAACCATAGAGA

since the end of the first fragment matches sufficient pairs in the second fragment. Note that the fragments do NOT have to be of the same length, but note that the fragments MUST be of the minimum length for matching to be of use. Smaller pairs are discarded without consideration because they cannot be positively matched.

In this machine problem we will reconstruct as much of the DNA sequence as possible from a file of sequenced fragments of DNA. Your program will:

1. Read the filename of a file of sequenced fragments of DNA (use the filename MP2data.bin).

2. Open the data file, read in the minimum number of base pairs required for combining base pairs

3. Read an unspecified number of fragments of varying size

4. Eliminate all fragments that cannot be used for pairing (smaller than the minimum number of base pairs used for combining fragments)

5. Match fragments and reassemble the fragments into larger fragments, where possible

6. Report the results, to include

a. The minimum number of pairs for matching

b. All remaining pairs after combining

c. The original number of fragments in the data file

d. The final number of fragments

e. The maximum and minimum fragment size, both read in and after combining fragments

There is a minimum number of base pairs, that when they match, are considered to be matching so that the fragments can be considered to be part of the same area of the full sample sequence

The data file will have the format

minimum number of base pairs to match

fragment

fragment

eof

Size will be an integer, fragments will be of type string, and the eof will be the system appended eof.