pal.tree
Class CladeSystem

java.lang.Object
  extended by pal.tree.CladeSystem

public class CladeSystem
extends java.lang.Object

data structure for a set of splits

Version:
$Id: CladeSystem.java,v 1.1 2002/06/03 09:17:52 alexi Exp $
Author:
Alexei Drummond

Constructor Summary
CladeSystem(IdGroup idGroup, int size)
           
 
Method Summary
static void calculateCladeProbabilities(Tree tree, CladeSystem[] cladeSystems)
           
static void getClade(IdGroup idGroup, Node internalNode, boolean[] clade)
          get clade for internal node
 boolean[] getClade(int i)
          get clade
 boolean[][] getCladeArray()
          get clade array
 int getCladeCount()
          get number of clades
static CladeSystem getClades(IdGroup idGroup, Tree tree)
          creates a clade system from a tree (using a pre-specified order of sequences)
static CladeSystem getClades(Tree tree)
          creates a clade system from a tree (using tree-induced order of sequences)
static CladeSystem[] getCladeSystems(Tree[] trees)
           
 IdGroup getIdGroup()
          get idGroup
 int getLabelCount()
          get number of labels
 boolean hasClade(boolean[] clade)
          + test whether a clade is contained in this clade system (assuming the same leaf order)
static boolean isSame(boolean[] s1, boolean[] s2)
          checks whether two clades are identical (assuming they are of the same length and use the same leaf order)
 java.lang.String toString()
          print clade system
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CladeSystem

public CladeSystem(IdGroup idGroup,
                   int size)
Parameters:
idGroup - sequence labels
size - number of clades
Method Detail

getCladeCount

public int getCladeCount()
get number of clades


getLabelCount

public int getLabelCount()
get number of labels


getCladeArray

public boolean[][] getCladeArray()
get clade array


getClade

public boolean[] getClade(int i)
get clade


getIdGroup

public IdGroup getIdGroup()
get idGroup


hasClade

public boolean hasClade(boolean[] clade)
+ test whether a clade is contained in this clade system (assuming the same leaf order)

Parameters:
clade - clade

toString

public java.lang.String toString()
print clade system

Overrides:
toString in class java.lang.Object

getCladeSystems

public static CladeSystem[] getCladeSystems(Tree[] trees)
Returns:
all clade systems for a group of trees.

calculateCladeProbabilities

public static void calculateCladeProbabilities(Tree tree,
                                               CladeSystem[] cladeSystems)

getClades

public static CladeSystem getClades(IdGroup idGroup,
                                    Tree tree)
creates a clade system from a tree (using a pre-specified order of sequences)

Parameters:
idGroup - sequence order for the matrix
tree -

getClades

public static CladeSystem getClades(Tree tree)
creates a clade system from a tree (using tree-induced order of sequences)

Parameters:
tree -

getClade

public static void getClade(IdGroup idGroup,
                            Node internalNode,
                            boolean[] clade)
get clade for internal node

Parameters:
idGroup - order of labels
internalNode - Node
boolean[] - clade

isSame

public static boolean isSame(boolean[] s1,
                             boolean[] s2)
checks whether two clades are identical (assuming they are of the same length and use the same leaf order)

Parameters:
s1 - clade 1
s2 - clade 2