public final class TreeTool
extends java.lang.Object
Constructor and Description |
---|
TreeTool() |
Modifier and Type | Method and Description |
---|---|
static Tree |
createNeighbourJoiningTree(DistanceMatrix dm)
Neighbour-joining tree construction based on a distance matrix
|
static Tree |
createNeighbourJoiningTree(double[][] dm,
java.lang.String[] otuNames)
Neighbour-joining tree construction based on a distance matrix
|
static Tree |
createUPGMA(DistanceMatrix dm)
UPGMA tree construction based on a distance matrix
|
static Tree |
createUPGMATree(double[][] dm,
java.lang.String[] otuNames)
UPGMA tree construction based on a distance matrix
|
static Tree |
getMidPointRooted(Tree t)
Root a tree around it's midpoint.
|
static Tree |
getRooted(Tree t,
java.lang.String[] outgroupMembers)
Root a tree by an outgroup.
|
static Tree |
getUnrooted(Tree t)
Unroot a tree (makes the base of the tree a trification).
|
static Tree |
readTree(java.io.Reader r)
Read a tree from an input source.
|
public static final Tree readTree(java.io.Reader r) throws java.io.IOException
r
- A reader object (is not closed)java.io.IOException
- if there was a problempublic static final Tree createNeighbourJoiningTree(DistanceMatrix dm)
dm
- The related DistanceMatrix objectpublic static final Tree createUPGMA(DistanceMatrix dm)
dm
- The related DistanceMatrix objectpublic static final Tree createNeighbourJoiningTree(double[][] dm, java.lang.String[] otuNames)
dm
- A matrix of doubles that forms the distance matrix. It is assumed this matrix is perfectly square and the diagonals matchotuNames
- The list of operational taxonimic units that match the column/rows of the distance matrix.public static final Tree createUPGMATree(double[][] dm, java.lang.String[] otuNames)
dm
- A matrix of doubles that forms the distance matrix. It is assumed this matrix is perfectly square and the diagonals matchotuNames
- The list of operational taxonimic units that match the column/rows of the distance matrix.public static final Tree getUnrooted(Tree t)
t
- The rooted (or unrooted) treeTreeManipulator
public static final Tree getMidPointRooted(Tree t)
t
- The unrooted (or rooted) treeTreeManipulator
public static final Tree getRooted(Tree t, java.lang.String[] outgroupMembers)
t
- The unrooted (or rooted) treeoutgroupMembers
- The names of the outgroup members (must be at least one). If there are more than one outgroup than the clade that contains all members is used as the outgroup. In some case poorly choosen outgroup members can result in multiple ways of rooting. If for some reason this is what is wanted see the TreeManipulator class for more powerful options.TreeManipulator