|
forester v1.3 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--forester.tree.Tree
Constructor Summary | |
Tree()
Default Tree constructor. |
|
Tree(java.lang.String nh_string)
Tree constructor. |
Method Summary | |
void |
adjustNodeCount()
(Re)counts the number of children for each Node of this Tree. |
void |
allowMoreThanBinaryNodesInNHoutput(boolean b)
Sets whether to allow more than binary Nodes in New Hampshire (NH) output. |
boolean |
areBranchLenghtsBootstraps()
Checks whether the branch length values actually are bootstrap values All external Nodes must have the same, >0, divisible by 10 branch length. |
void |
calculateNumberOfBranches()
Calculates to number of branches of this Tree. |
Tree |
copyBranchLengthValuesFrom(Tree tree2)
Returns a Tree which is a copy of this Tree, except it has the branch lenghts of tree2. |
Tree |
copyTree()
Returns a deep copy of this Tree. |
void |
delete()
Deletes this Tree. |
void |
findHighestLnL()
Finds the highest of all log likelihood value associated with branches of this Tree. |
void |
findLowestLnL()
Finds the lowest of all log likelihood value associated with branches of this Tree. |
Tree[] |
fuseToAllBranches(Tree t2)
Returns an array of references to Trees which are the result of fusing Tree t2 to all possible branches of this Tree. |
Tree |
fuseTrees(int id,
double d,
double r,
Tree t)
Returns a Tree which is the result of fusing a rooted Tree to this Tree. |
Tree |
fuseTrees(int id,
double d,
double r,
Tree t,
Node n)
Returns a Tree which is the result of fusing a rooted Tree to this Tree. |
Tree |
fuseTrees(int id,
double d,
Tree t)
Returns a Tree which is the result of fusing a rooted Tree to this Tree. |
Tree |
fuseTrees(int id,
double d,
Tree t,
Node n)
Returns a Tree which is the result of fusing a rooted Tree to this Tree. |
Tree |
fuseTrees(int id,
Tree t)
Returns a Tree which is the result of fusing a rooted Tree to this Tree. |
Tree |
fuseTrees(int id,
Tree t,
Node n)
Returns a Tree which is the result of fusing a rooted Tree to this Tree. |
Node |
getExtNode0()
Returns the first external Node. |
double |
getHighestLnL()
Returns the highest log likelihood value associated with branches of this Tree (double). |
Node |
getLastCommonAncestor(int id1,
int id2)
Finds the last common ancestor Node of two Nodes specified by their IDs id1 and id2. |
Node |
getLastCommonAncestor(java.lang.String seqname1,
java.lang.String seqname2)
Finds the last common ancestor Node of two Nodes specified by their sequence names seqname1 and seqname2. |
double |
getLongestDistance()
Returns the longest distance of this Tree (double). |
double |
getLowestLnL()
Returns the lowest log likelihood value associated with branches of this Tree (double). |
int |
getMostBranchesPerExtNode()
Returns the maximum number of branches per external Node (int). |
java.lang.String |
getName()
Returns the name of this Tree. |
Node |
getNode(int id)
Finds the Node of this Tree which has a matching ID number. |
java.util.Vector |
getNodes(java.lang.String seqname)
Returns a Vector with references to all Nodes of this Tree which have a matching sequence name. |
java.util.Vector |
getNodesWithMatchingSpecies(java.lang.String specname)
Returns a Vector with references to all Nodes of this Tree which have a matching species name. |
int |
getNumberOfBranches()
Returns the total number of branches of this Tree (int). |
int |
getNumberOfDuplications()
Returns the number of duplications of this Tree (int). |
int |
getNumberOfExtNodes()
Returns the sum of external Nodes of this Tree (int). |
java.util.Vector |
getPath(Node node1,
Node node2,
boolean ret_pseudo_nodes)
Returns a Vector containing the Node IDs of all Nodes which are between two external Nodes (node2 and node1). |
Node |
getRoot()
Returns the root Node of this Tree. |
java.util.Vector |
getSiblings(Node n)
Returns a Vector of references to all external siblings and nieces of a external Node n. |
void |
hashIDs()
Hashes the ID number of each Node of this Tree to its corresonding Node, in order to make method getNode( id ) run in constant time. |
boolean |
isEmpty()
Checks whether a Tree object is deleted (or empty). |
boolean |
isRooted()
Returns true is this Tree is rooted. |
void |
moveBranchLenghtsToBootstrap()
Moves the values in the branch length field to the bootstrap field, for each Node of this Tree. |
int |
preorderReID(int i)
Resets the ID values of the Nodes of this Tree in preorder, starting with i. |
void |
printAllNodes()
Prints descriptions of all Nodes of this Tree to the console. |
void |
printExtNodes()
Prints descriptions of all external Nodes of this Tree to the console. |
void |
recalculateAndReset()
Recalculates and resets parameters of this Tree: most-branches-per-external-Node, highest and lowest lnL, longest distance, number of branches, sum of ext Nodes, deletes data of root Node if this Tree is unrooted. |
void |
removeExtNode(Node n)
Removes external Node from this Tree. |
void |
reRoot(int id)
Places the root of this Tree on the parent branch of the Node with a corresponding ID. |
void |
reRoot(int id,
java.lang.String s)
Places the root of this Tree on the parent branch of the Node with a corresponding ID. |
void |
reRoot(Node n)
Places the root of this Tree on the parent branch Node n. |
void |
reRoot(Node n,
java.lang.String s)
Places the root of this Tree on the parent branch Node n. |
void |
setIndicatorsToZero()
Sets the indicators of all Nodes of this Tree to 0. |
void |
setName(java.lang.String s)
Sets the name of this Tree to s. |
void |
setNumberOfDuplications(int i)
Sets the number of duplications of this Tree (int). |
void |
setRooted(boolean b)
Sets whether this Tree is rooted or not. |
Tree |
subTree(int id)
Returns the subtree of this Tree which has the Node with ID id as its root Node. |
void |
swapChildren(int id)
Swaps the the two childern of a Node with ID id of this Tree. |
void |
swapChildren(Node node)
Swaps the the two childern of a Node node of this Tree. |
java.lang.String |
toNewHampshire(boolean clean_nh)
Converts this Tree to a New Hampshire (String) representation. |
java.lang.String |
toNewHampshireX()
Converts this Tree to a New Hampshire X (String) representation. |
java.lang.String |
toString()
Converts this Tree to a New Hampshire X (String) representation. |
void |
unRoot()
Removes the root Node this Tree. |
void |
unRootAndTrifurcate()
Removes the root Node of this Tree and makes at least a trifurcation at its basal node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Tree()
public Tree(java.lang.String nh_string) throws java.lang.Exception
nh_string
- String in New Hampshire (NH) or New Hampshire X (NHX) formatMethod Detail |
public boolean isEmpty()
public void delete()
public void removeExtNode(Node n)
n
- Node to removepublic java.util.Vector getNodes(java.lang.String seqname) throws java.lang.Exception
seqname
- Sequence name (String) of Nodes to findgetNodesWithMatchingSpecies(String)
public java.util.Vector getNodesWithMatchingSpecies(java.lang.String specname) throws java.lang.Exception
specname
- species name (String) of Nodes to findgetNodes(String)
public Node getNode(int id)
id
- ID number (int) of the Node to findpublic void swapChildren(int id)
id
- ID (int) of Nodepublic void swapChildren(Node node)
node
- a Node of this Treepublic Tree subTree(int id) throws java.lang.Exception
id
- ID (int) of Nodepublic void reRoot(int id) throws java.lang.Exception
id
- ID (int) of Node of this Treepublic void reRoot(Node n) throws java.lang.Exception
n
- Node of this Treepublic void reRoot(int id, java.lang.String s) throws java.lang.Exception
id
- ID (int) of Node of this Trees
- String describing new Nodepublic void reRoot(Node n, java.lang.String s) throws java.lang.Exception
n
- Node of this Trees
- String describing new Nodepublic Tree copyBranchLengthValuesFrom(Tree tree2) throws java.lang.Exception
tree2
- the Tree to copy the branch lenghts frompublic void recalculateAndReset()
public Tree copyTree()
public void unRootAndTrifurcate()
public void unRoot()
public Tree fuseTrees(int id, double d, double r, Tree t, Node n) throws java.lang.Exception
id
- ID (int) of the Node of this Tree of whose parent branch
to fuse tod
- distance to parent (double) of newly introduced Noder
- distance to parent (double) of Tree to fuse to this Treet
- Tree to fuse to this Treen
- the newly introduced Nodepublic Tree fuseTrees(int id, double d, Tree t, Node n) throws java.lang.Exception
id
- ID (int) of the Node of this Tree of whose parent branch
to fuse tod
- distance to parent (double) of newly introduced Nodet
- Tree to fuse to this Treen
- the newly introduced Nodepublic Tree fuseTrees(int id, Tree t, Node n) throws java.lang.Exception
id
- ID (int) of the Node of this Tree of whose parent branch
to fuse tot
- Tree to fuse to this Treen
- the newly introduced Nodepublic Tree fuseTrees(int id, double d, double r, Tree t) throws java.lang.Exception
id
- ID (int) of the Node of this Tree of whose parent branch
to fuse tod
- distance to parent (double) of newly introduced Noder
- distance to parent (double) of Tree to fuse to this Treet
- Tree to fuse to this Treepublic Tree fuseTrees(int id, double d, Tree t) throws java.lang.Exception
id
- ID (int) of the Node of this Tree of whose parent branch
to fuse tod
- distance to parent (double) of newly introduced Nodet
- Tree to fuse to this Treepublic Tree fuseTrees(int id, Tree t) throws java.lang.Exception
id
- ID (int) of the Node of this Tree of whose parent branch
to fuse tot
- Tree to fuse to this Treepublic Tree[] fuseToAllBranches(Tree t2) throws java.lang.Exception
t2
- the Tree to fuse to all branches of this Treepublic Node getRoot()
public boolean isRooted()
public void setRooted(boolean b)
public double getHighestLnL()
findHighestLnL()
public double getLowestLnL()
findLowestLnL()
public double getLongestDistance()
public int getNumberOfBranches()
calculateNumberOfBranches()
public int getNumberOfDuplications()
public void setNumberOfDuplications(int i)
clean_nh
- set to true for clean NH formatpublic Node getExtNode0()
public int getMostBranchesPerExtNode()
public int getNumberOfExtNodes()
public void allowMoreThanBinaryNodesInNHoutput(boolean b)
public java.lang.String getName()
public void setName(java.lang.String s)
public void printExtNodes()
public void printAllNodes()
public void setIndicatorsToZero()
public void findLowestLnL()
getLowestLnL()
public void findHighestLnL()
getHighestLnL()
public void calculateNumberOfBranches()
getNumberOfBranches()
public void moveBranchLenghtsToBootstrap() throws java.lang.Exception
public boolean areBranchLenghtsBootstraps()
public java.lang.String toString()
toString
in class java.lang.Object
toNewHampshireX()
public java.lang.String toNewHampshire(boolean clean_nh)
clean_nh
- set to true for clean NH formatpublic java.lang.String toNewHampshireX()
public java.util.Vector getPath(Node node1, Node node2, boolean ret_pseudo_nodes) throws java.lang.Exception
public java.util.Vector getSiblings(Node n) throws java.lang.Exception
public Node getLastCommonAncestor(java.lang.String seqname1, java.lang.String seqname2) throws java.lang.Exception
public Node getLastCommonAncestor(int id1, int id2) throws java.lang.Exception
public void adjustNodeCount()
public int preorderReID(int i)
i
- the starting value (int)public void hashIDs()
|
forester v1.3 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |