public class TreeManipulator extends java.lang.Object implements UnrootedTreeInterface.Instructee, RootedTreeInterface.Instructee
Modifier and Type | Class and Description |
---|---|
static interface |
TreeManipulator.BranchAccess
The branch access objects allow specific operations on a particular branch (refered to as connections
internally to confuse and bewilder)
|
static class |
TreeManipulator.PALBranchWrapper |
static class |
TreeManipulator.PALNodeWrapper |
Modifier and Type | Field and Description |
---|---|
static int |
EXPAND_CONSTRUCTION
Construct tree, but convert general multifications to a series of bifications
|
static int |
MIMIC_CONSTRUCTION
Construct tree with same multification as original
|
static int |
REDUCE_CONSTRUCTION
Construct tree, but convert bificating nodes that appear as multifications (due to very short branchlengths) to multifications
|
Constructor and Description |
---|
TreeManipulator(Node base)
Units will be Units.UNKNOWN
|
TreeManipulator(Node base,
int units)
Construct a TreeManipulator based around a normal tree
|
TreeManipulator(Node base,
int units,
int constructionMode)
Construct a TreeManipulator based around a normal tree
|
TreeManipulator(RootedTreeInterface.Instructee base,
int units,
int constructionMode) |
TreeManipulator(Tree base)
Construct a TreeManipulator based around a normal tree
|
TreeManipulator(Tree base,
int constructionMode)
Construct a TreeManipulator based around a normal tree
|
TreeManipulator(UnrootedTreeInterface.Instructee base,
int units,
int constructionMode) |
Modifier and Type | Method and Description |
---|---|
Node[] |
getAllRootedBy(java.lang.String[] outgroupNames) |
static Tree[] |
getAllRootingsBy(Tree base,
java.lang.String[] outgroupNames)
Roots a tree by an outgroup
|
Tree[] |
getAllTreesRootedBy(java.lang.String[] outgroupNames) |
Node |
getAsInputRooting()
A method for recovering the input (construction) tree (with the EXPANSION/MIMIC/REDUCED differences)
|
Tree |
getAsInputRootingTree()
A method for recovering the input (construction) tree (with the EXPANSION/MIMIC/REDUCED differences)
|
TreeManipulator.BranchAccess[] |
getBranchAccess()
Obtain access to individual branches
|
Node |
getDefaultRoot() |
Tree |
getDefaultRootTree() |
Tree[] |
getEveryRoot() |
static Tree[] |
getEveryRoot(Tree base)
Obtains every rooting of a base tree
|
TreeIterator |
getEveryRootIterator() |
static TreeIterator |
getEveryRootIterator(Tree base)
Obtains every rooting of a base tree
|
Node |
getMidPointRooted() |
static Tree |
getMidpointRooted(Tree base)
Returns the mid point rooting of a tree.
|
Tree |
getMidPointRootedTree() |
Node |
getRootedAbove(Node base) |
Node |
getRootedBy(java.lang.String[] outgroupNames) |
Node |
getRootedBy(java.lang.String[] outgroupNames,
double ingroupBranchLength) |
static Tree |
getRootedBy(Tree base,
java.lang.String[] outgroupNames)
Roots a tree by an outgroup
|
static Tree |
getRootedBy(Tree base,
java.lang.String[] outgroupNames,
double ingroupBranchLength)
Roots a tree by an outgroup
|
Tree |
getTreeRootedAbove(Node n) |
Tree |
getTreeRootedBy(java.lang.String[] outgroupNames) |
Tree |
getTreeRootedBy(java.lang.String[] outgroupNames,
double ingroupBranchLength) |
Node |
getUnrooted()
return unrooted node
|
static Tree |
getUnrooted(Tree base)
Unroots a tree
|
Tree |
getUnrootedTree()
return unrooted node
|
void |
instruct(RootedTreeInterface treeInterface) |
void |
instruct(UnrootedTreeInterface treeInterface) |
void |
instructRootedBy(RootedTreeInterface rootedInterface,
java.lang.String[] outgroupNames) |
public static final int MIMIC_CONSTRUCTION
public static final int EXPAND_CONSTRUCTION
public static final int REDUCE_CONSTRUCTION
public TreeManipulator(Tree base, int constructionMode)
base
- The base tree, which can be rooted or unrooted (will be treated as unrooted either way)constructionMode
- the way in which the internal tree representation is constructedpublic TreeManipulator(Tree base)
base
- The base tree, which can be rooted or unrooted (will be treated as unrooted either way)public TreeManipulator(Node base)
public TreeManipulator(Node base, int units)
base
- The base tree, which can be rooted or unrooted (will be treated as unrooted either way)units,
- the units of generated trees. Not really of concern if only Node trees builtpublic TreeManipulator(Node base, int units, int constructionMode)
base
- The base tree, which can be rooted or unrooted (will be treated as unrooted either way)units,
- the units of generated trees. Not really of concern if only Node trees builtpublic TreeManipulator(UnrootedTreeInterface.Instructee base, int units, int constructionMode)
public TreeManipulator(RootedTreeInterface.Instructee base, int units, int constructionMode)
public Node getMidPointRooted()
public Node getDefaultRoot()
public Node getAsInputRooting()
public Tree getAsInputRootingTree()
public Tree getDefaultRootTree()
public Tree getMidPointRootedTree()
public Node getUnrooted()
public Tree getUnrootedTree()
public Node getRootedBy(java.lang.String[] outgroupNames)
outgroupNames
- the names of the members of the outgroupIllegalArgument
- exception if outgroup names does not contain any valid node namespublic void instructRootedBy(RootedTreeInterface rootedInterface, java.lang.String[] outgroupNames)
outgroupNames
- the names of the members of the outgroupIllegalArgument
- exception if outgroup names does not contain any valid node namespublic Node getRootedBy(java.lang.String[] outgroupNames, double ingroupBranchLength)
outgroupNames
- the names of the members of the outgroupingroupBranchLength
- the maximum length of the branch leading to the ingroup cladeIllegalArgument
- exception if outgroup names does not contain any valid node namespublic Node[] getAllRootedBy(java.lang.String[] outgroupNames)
outgroupNames
- the names of the members of the outgroupIllegalArgument
- exception if outgroup names does not contain any valid node namespublic Tree getTreeRootedBy(java.lang.String[] outgroupNames)
outgroupNames
- the names of the members of the outgrouppublic Tree getTreeRootedBy(java.lang.String[] outgroupNames, double ingroupBranchLength)
outgroupNames
- the names of the members of the outgroupingroupBranchLength
- the maximum length of the branch leading to the ingroup cladepublic Tree[] getAllTreesRootedBy(java.lang.String[] outgroupNames)
outgroupNames
- the names of the members of the outgrouppublic TreeIterator getEveryRootIterator()
public void instruct(UnrootedTreeInterface treeInterface)
instruct
in interface UnrootedTreeInterface.Instructee
public void instruct(RootedTreeInterface treeInterface)
instruct
in interface RootedTreeInterface.Instructee
public TreeManipulator.BranchAccess[] getBranchAccess()
public Tree[] getEveryRoot()
public Node getRootedAbove(Node base)
Node
- n, a node from the original base tree that this TreeManipulator was
constructed onIllegal
- argument exception if input node was not in original base treepublic Tree getTreeRootedAbove(Node n)
Node
- n, a node from the original base tree that this TreeManipulator was
constructed onIllegal
- argument exception if input node was not in original base treepublic static final Tree getUnrooted(Tree base)
base
- The input tree that may or may not be unrootedpublic static final Tree getMidpointRooted(Tree base)
base
- The input tree that may or may not be unrootedhttp://www.mun.ca/biology/scarr/Panda_midpoint_rooting.htm
public static final Tree[] getEveryRoot(Tree base)
base
- The input tree that may or may not be unrootedpublic static final TreeIterator getEveryRootIterator(Tree base)
base
- The input tree that may or may not be unrootedpublic static final Tree getRootedBy(Tree base, java.lang.String[] outgroupNames)
base
- The input tree that may or may not be unrootedoutgroupNames
- The names of the members of the outgroup. Names not matching taxa in the tree are ignored. The node that is the MCRA of
members of the outgroup will influence the rooting.java.lang.IllegalArgumentException
- if no members of the tree appear in the outgrouppublic static final Tree getRootedBy(Tree base, java.lang.String[] outgroupNames, double ingroupBranchLength)
base
- The input tree that may or may not be unrootedoutgroupNames
- The names of the members of the outgroup. Names not matching taxa in the tree are ignored. The node that is the MCRA of
members of the outgroup will influence the rooting.java.lang.IllegalArgumentException
- if no members of the tree appear in the outgrouppublic static final Tree[] getAllRootingsBy(Tree base, java.lang.String[] outgroupNames)
base
- The input tree that may or may not be unrootedingroupBranchLength
- the maximum length of the branch leading to the ingroup cladeoutgroupNames
- The names of the members of the outgroup. Names not matching taxa in the tree are ignored. The node that is the MCRA of
members of the outgroup will influence the rooting.java.lang.IllegalArgumentException
- if no members of the tree appear in the outgroup