|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjebl.evolution.trees.Utils
public final class Utils
A collection of utility functions for trees.
| Method Summary | |
|---|---|
static void |
assertAllTreesHaveTheSameTaxa(java.util.List<? extends Tree> trees)
Checks whether all of the trees passed in have the same taxa sets (ignoring order of taxa), and throws an IllegalArgumentException if this is not the case. |
static java.lang.String |
asText(Tree tree)
|
static java.lang.String[] |
asText(Tree tree,
int widthGuide)
|
static RootedTree |
copyTree(RootedTree treeToCopy)
This method creates an unattached copy of the given rooted tree such that changes to the copied tree do not affect the original tree. |
static java.util.Comparator<Node> |
createNodeDensityComparator(RootedTree tree)
|
static java.util.Comparator<Node> |
createNodeDensityMinNodeHeightComparator(RootedTree tree)
|
static java.lang.String |
DEBUGsubTreeRep(RootedTree tree,
Node node)
|
static int |
getExternalNodeCount(RootedTree tree,
Node node)
Return the number of external nodes under this node. |
static double |
getMinNodeHeight(RootedTree tree,
Node node)
|
static java.util.List<Node> |
getNodes(RootedTree tree,
Node node)
All nodes in subtree - parents before children (pre - order). |
static double |
getPathLength(Tree tree,
Node node1,
Node node2)
|
static boolean |
isBinary(RootedTree rootedTree)
|
static boolean |
isUltrametric(RootedTree rootedTree)
|
static Node |
leftNb(RootedTree tree,
Node node)
Left Neighbour of a tip (taxon). |
static int |
maxLevels(RootedTree tree)
|
static Node |
rightNb(RootedTree tree,
Node tipNode)
Right Neighbour of a tip (taxon). |
static RootedTree |
rootTheTree(Tree tree)
Return a rooted tree from any tree. |
static RootedTree |
rootTreeAtCenter(Tree tree)
Root any tree by locating the "center" of tree and adding a new root node at that point for any point on the tree x let D(x) = Max{distance between x and t : for all tips t} The "center" c is the point with the smallest distance, i.e. |
static double |
safeNodeHeight(RootedTree tree,
Node node)
|
static java.lang.String |
toNewick(RootedTree tree)
|
static java.lang.String |
toUniqueNewick(RootedTree tree)
Constructs a unique newick representation of a tree |
static java.lang.String |
toUniqueNewickByAttribute(RootedTree tree,
java.lang.String attribute)
Constructs a unique newick representation of a tree print only an attribute |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String toNewick(RootedTree tree)
tree -
public static java.lang.String toUniqueNewick(RootedTree tree)
tree -
public static java.lang.String toUniqueNewickByAttribute(RootedTree tree,
java.lang.String attribute)
tree -
public static double safeNodeHeight(RootedTree tree,
Node node)
public static int maxLevels(RootedTree tree)
public static java.lang.String asText(Tree tree)
public static java.lang.String[] asText(Tree tree,
int widthGuide)
public static RootedTree rootTheTree(Tree tree)
tree - to root
public static RootedTree rootTreeAtCenter(Tree tree)
tree - to root
public static double getPathLength(Tree tree,
Node node1,
Node node2)
tree - the treenode1 - node2 -
public static boolean isBinary(RootedTree rootedTree)
rootedTree - the rooted tree
public static boolean isUltrametric(RootedTree rootedTree)
rootedTree - the rooted tree
public static int getExternalNodeCount(RootedTree tree,
Node node)
tree - node -
public static java.util.List<Node> getNodes(RootedTree tree,
Node node)
tree - node -
public static Node rightNb(RootedTree tree,
Node tipNode)
tree - tipNode -
public static Node leftNb(RootedTree tree,
Node node)
tree - node -
public static double getMinNodeHeight(RootedTree tree,
Node node)
tree - node -
public static java.util.Comparator<Node> createNodeDensityComparator(RootedTree tree)
public static java.util.Comparator<Node> createNodeDensityMinNodeHeightComparator(RootedTree tree)
public static void assertAllTreesHaveTheSameTaxa(java.util.List<? extends Tree> trees)
throws java.lang.IllegalArgumentException
trees - Zero or more trees
java.lang.IllegalArgumentException - if not all of the trees have the same taxa
java.lang.NullPointerException - if trees is null
public static java.lang.String DEBUGsubTreeRep(RootedTree tree,
Node node)
public static RootedTree copyTree(RootedTree treeToCopy)
treeToCopy - the tree to copy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||