cs195z.support
Class PTreeVisualizer

java.lang.Object
  extended by cs195z.support.PTreeVisualizer

public class PTreeVisualizer
extends Object

Visualizer for testing PTreeAlgorithms methods. Also contains the generator for the mappings and matrices passed into the PTreeAlgorithms implementation. Requires forester-ATV.

Author:
apstewar

Constructor Summary
PTreeVisualizer()
           
 
Method Summary
static org.forester.phylogeny.Phylogeny convertTree(net.datastructures.LinkedBinaryTree<PSpeciesNode> tree)
          Converts an nds4 LinkedBinaryTree into an org.forester.phylogeny.Phylogeny
static void main(String[] args)
          Runs the visualizer.
static void treeHelper(net.datastructures.LinkedBinaryTree<PSpeciesNode> t, net.datastructures.Position<PSpeciesNode> n, org.forester.phylogeny.PhylogenyNode parent)
          Helper method for the preorder traversal recursion of convertTree()
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PTreeVisualizer

public PTreeVisualizer()
Method Detail

convertTree

public static org.forester.phylogeny.Phylogeny convertTree(net.datastructures.LinkedBinaryTree<PSpeciesNode> tree)
Converts an nds4 LinkedBinaryTree into an org.forester.phylogeny.Phylogeny

Parameters:
tree - is a net.datastructures.LinkedBinaryTree tree with PSpeciesNode elements
Returns:
the equivalent ATV phylogeny

treeHelper

public static void treeHelper(net.datastructures.LinkedBinaryTree<PSpeciesNode> t,
                              net.datastructures.Position<PSpeciesNode> n,
                              org.forester.phylogeny.PhylogenyNode parent)
Helper method for the preorder traversal recursion of convertTree()

Parameters:
t - = tree
n - = current node
parent -

main

public static void main(String[] args)
Runs the visualizer. Note that the arguments are as follows:

Parameters:
args[0] - "data" shows data set, "sankoff" runs Sankoff, "felsenstein" runs felsenstein, default is Sankoff
args[1] - selects data set from {"WINGED", "DNA"}