public class RootedTreeUtils
This class contains utility methods. These include:
1. gathering information about subtrees from a set of trees
2. comparing subtrees and clades.
All these methods assume rooted trees!
public static boolean containsSubtree(Node root, Node node)
root - the root of the tree in which search for a subtreenode - the subtree to search for.public static boolean containsClade(Node root, Node clade)
root - the root of the tree in which search for a subtreeclade - the hashtable of taxa.public static Node getSubtree(Node root, Node node)
public static Node getClade(Node root, Node clade)
public static boolean equal(Node node1, Node node2)
public static boolean sameTaxa(Node node1, Node node2)
public static int collectTaxa(Node root, java.util.Map<java.lang.String,java.lang.String> table)
Collects all of the names of the taxa in the tree into a hashtable.
root - the root node of the tree.table - a hashtable to hold the taxa names, may already hold some taxa names.public static boolean containsNovelTaxa(Node root, java.util.Map<java.lang.String,java.lang.String> taxa)
root - the root node of the tree.taxa - a hashtable holding taxa names.public static int subtreeCount(Node subtree, java.util.Vector<net.maizegenetics.taxa.tree.Tree> trees)
subtree - the subtree being searched for.trees - a vector of trees to search for the subtree in.public static double getMeanSubtreeHeight(Node subtree, java.util.Vector<net.maizegenetics.taxa.tree.Tree> trees)
subtree - the subtree being searched for.trees - a vector of trees to search for the subtree in.public static double getMeanCladeHeight(Node clade, java.util.Vector<net.maizegenetics.taxa.tree.Tree> trees)
clade - a node containing the clade being searched for.trees - a vector of trees to search for the clade in.public static int cladeCount(Node subtree, java.util.Vector<net.maizegenetics.taxa.tree.Tree> trees)
subtree - a subtree containing the taxaset being searched for.trees - a vector of trees to search for the clade in.public static void collectProportions(Tree tree, java.util.Vector<net.maizegenetics.taxa.tree.Tree> trees)