Package pal.tree
Class TreeTool
java.lang.Object
pal.tree.TreeTool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final Tree
createNeighbourJoiningTree
(double[][] dm, String[] otuNames) Neighbour-joining tree construction based on a distance matrixstatic final Tree
Neighbour-joining tree construction based on a distance matrixstatic final Tree
UPGMA tree construction based on a distance matrixstatic final Tree
createUPGMATree
(double[][] dm, String[] otuNames) UPGMA tree construction based on a distance matrixstatic final Tree
Root a tree around it's midpoint.static final Tree
Root a tree by an outgroup.static final Tree
getUnrooted
(Tree t) Unroot a tree (makes the base of the tree a trification).static final Tree
Read a tree from an input source.
-
Constructor Details
-
TreeTool
public TreeTool()
-
-
Method Details
-
readTree
Read a tree from an input source. Currently only understands the Newick format- Parameters:
r
- A reader object (is not closed)- Returns:
- A tree
- Throws:
IOException
- if there was a problem
-
createNeighbourJoiningTree
Neighbour-joining tree construction based on a distance matrix- Parameters:
dm
- The related DistanceMatrix object- Returns:
- A tree formed by the neighbour-joining process using the input distance matrix
-
createUPGMA
UPGMA tree construction based on a distance matrix- Parameters:
dm
- The related DistanceMatrix object- Returns:
- A tree formed by the UPGMA process using the input distance matrix
-
createNeighbourJoiningTree
Neighbour-joining tree construction based on a distance matrix- Parameters:
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.- Returns:
- A tree formed by the neighbour-joining process using the input distance matrix
-
createUPGMATree
UPGMA tree construction based on a distance matrix- Parameters:
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.- Returns:
- A tree formed by the neighbour-joining process using the input distance matrix
-
getUnrooted
Unroot a tree (makes the base of the tree a trification). Total Branch lengths are conserved- Parameters:
t
- The rooted (or unrooted) tree- Returns:
- An unrooted tree
-
getMidPointRooted
Root a tree around it's midpoint. Total Branch lengths are conserved- Parameters:
t
- The unrooted (or rooted) tree- Returns:
- A rooted tree
-
getRooted
Root a tree by an outgroup. Total Branch lengths are conserved- Parameters:
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.- Returns:
- A rooted tree
-