The names of the tree and DNA cost-matrix files should be command-line arguments to your program. Each tree file is formatted as follows: The first lines contains two positive integers n and m specifying the number of taxa and the number of characters per taxon, respectively, each of the next n lines specifies a leaf in the tree via that leaf's index, name, and object-by-character matrix data (as a string of length m over the DNA alphabet), and the final (n - 1) lines specify the internal nodes of the tree via that node's index and name, the index and linking-edge length to that node's first child-node, and the index and linking-branch length to that node's second child-node. The internal nodes will be listed in postorder, i.e, each node will be listed after its children-nodes are listed. Two examples of the tree given on page 3 of the Felsenstein (1992) class handout encoded in this format are given in files etree1.dat, etree2.dat, etree3.dat, etree4.dat, and etree5.dat. Each cost-matrix file will specify a 4 x 4 matrix on 4 lines (one per row), where the rows in order correspond to the symbols, A, G, C, and T. Two sample DNA cost-matrices are given in files cm1.dat and cm2.dat. Your program should print out intermediate values produced during your computation as specified in the following sample run typescript file.
You may assume that all all given files are formatted correctly..
You may find it easier to format numbers in columns using the methods given in MyNumberFormat.java.
and the following object-by-character matrix
| C1 | C2 | C3 | |
| A | A | G | G |
| B | A | C | A |
| C | A | C | C |
| D | T | G | A |
| E | T | G | G |
| F | T | G | G |
do the following:
Perform Fitch internal-vertex character state reconstruction using the algorithm given in the Swofford et al. (1996) class handout.
///////////////////////////////////////////////////////////////// // CS 4762 (Winter 2005), Assignment #3, Question #1 // // Program File Name: MPG.java // // Student Name: Todd Wareham // // Login Name: harold // // MUN #: 8008765 // /////////////////////////////////////////////////////////////////You do not have to develop your code on our CS departmental systems. However, as your code will be compiled and tested on our CS departmental systems as part of the assignment marking process, you should ensure that your code compiles and runs correctly on at least one of these systems.
Created: February 8, 2005
Last Modified: March 17, 2005