COSC 348: Lab08

Overview: Phylogeny inference lab 2/3

This is practice building parts that you will need for the assignment.

IMPORTANT: Submit the code you've developed for this lab (worth 1% of your final mark).


Add the Fitch algorithm

Add the Fitch algorithm to your classes. Each OTU will need some characters. Add the character matrix to Phylogeny.

To keep it simple, write your Fitch algorithm method to take a character Top_of_head as its argument, and work on just that character. Top_of_head = "0" when it is "depressed", "1" when it is "flat" and "2" when it is "crested". Here are the code values of this character for 29 Caminalcules: 120011000002000010110100110010.

Revise bitwise operations

Find your Java textbook or other Java documentation and review the bitwise operators |, &, and <<. Suppose we wanted to represent a subset of the integers 0..30 by an integer, where k is in the set if and only if bit k of the integer is 1 (counting the least significant bit as bit 0).

  1. What operator would you use for set union?
  2. What operator would you use for set intersection?
  3. How would you make the set {3,8,14}?

Here's a nasty problem for Java programmers: you have to return two pieces of information from each call to the Fitch algorithm. How do you do that? Considering the existence of modern processors like the SPARC T2000 which can do 64 things at once, why wouldn't you want to do this by stuffing things into OTU_Nodes and HTU_Nodes?



Cosc348 home
Cosc348 labs