|
FORESTER 1.9 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--forester.tree.Tree
Field Summary | |
(package private) static int |
MAX_LENGTH
|
(package private) static long |
serialVersionUID
|
Constructor Summary | |
Tree()
Default Tree constructor. |
|
Tree(java.lang.String nh_string)
Tree constructor which constructs a Tree from String nh_string. |
Method Summary | |
(package private) void |
addNodeAndConnect(java.lang.String s1,
java.lang.String s2)
|
void |
adjustNodeCount(boolean considerCollapsedNodes)
(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. |
double |
calculateRealHeight()
Calculates the real height of this (rooted) Tree -- the longest distance from root to external node. |
void |
collapseToDeepestAnotNodes()
Collapses this Tree's deepest Nodes anotated with either a sequence name or a species name. |
void |
copyBranchLengthValuesFrom(Tree t)
Modifies this Tree with the branch lenghts of Tree t. |
Tree |
copyTree()
Returns a deep copy of this Tree. |
void |
delete()
Deletes this Tree. |
java.util.Vector |
find(java.lang.String name,
java.lang.String species,
java.lang.String ec,
int taxonomy_id)
Returns a Vector of references to Nodes which match in sequence name AND species AND EC number AND taxonomy ID. |
void |
findExtremeLnL()
Finds the highest of all log likelihood value associated with branches of this Tree. |
java.util.Vector |
findInNameSpecECid(java.lang.String query)
Returns a Vector of references to Nodes which match in sequence name OR species OR EC number OR taxonomy ID. |
java.lang.String[] |
getAllExternalSeqNames()
Returns the sequence names of all external Nodes of this Tree as array of Strings. |
Node |
getExtNode0()
Returns the first external Node. |
double |
getHighestLnL()
Returns the highest log likelihood value associated with branches of this Tree (double). |
double |
getLowestLnL()
Returns the lowest log likelihood value associated with branches of this Tree (double). |
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. |
Node |
getNode(java.lang.String seqname)
Returns a Node of this Tree which has a matching sequence name seqname. |
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 |
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 |
getOrthologs(Node n)
Returns all orthologs of the external Node n of this Tree. |
double |
getRealHeight()
Returns the real height of this Tree - the longest distance from root to external node. |
Node |
getRoot()
Returns the root Node of this Tree. |
java.util.Vector |
getStrictlySrelatedNodes(Node n)
Returns all Nodes which are connected to external Node n of this Tree by a path containing only speciation events. |
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 |
isCompletelyBinary()
Returns whether this is a completely binary tree (i.e. |
boolean |
isEmpty()
Checks whether a Tree object is deleted (or empty). |
boolean |
isRooted()
Returns true is this Tree is rooted. |
void |
levelOrderReID(int i)
Resets the ID numbers of the Nodes of this Tree in level order, starting with i (for the root). |
void |
moveBranchLenghtsToBootstrap()
Moves the values in the branch length field to the bootstrap field, for each Node of this Tree. |
void |
orderAppearance(boolean order)
Arranges the order of childern for each node of this Tree in such a way that either the branch with more children is on top (right) or on bottom (left), dependent on the value of boolean order. |
int |
preorderReID(int i)
Resets the ID numbers 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 System.out. |
void |
recalculateAndReset()
Recalculates and resets parameters of this Tree: highest and lowest lnL real height sum of ext Nodes To be used after Tree has been modified. |
void |
removeExtNode(Node n)
Removes external Node n from this Tree. |
void |
reRoot(Branch b)
Places the root of this Tree on Branch b. |
void |
reRoot(int id)
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 |
reRootSkeleton(Branch b)
Places the root of this Tree on Branch b. |
void |
reRootSkeleton(Node n)
Places the root of this Tree on the parent branch Node n. |
void |
setAllNodesToNotCollapse()
Sets all Nodes of this Tree to not-collapsed. |
void |
setExtNodes(int i)
Sets the sum of external Nodes of this Tree (int). |
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 |
setRealHeight(double d)
Sets the real height of this Tree - the longest distance from root to external node. |
(package private) void |
setRoot(Node n)
|
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 |
|
Field Detail |
static final int MAX_LENGTH
static final long serialVersionUID
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 Tree copyTree()
(The resulting Tree has its references in the external nodes corrected, if they are lacking/ obsolete in this.)
(Last modified: 06/11/01)
public void delete()
public Tree subTree(int id)
id
- ID (int) of Nodepublic void unRootAndTrifurcate()
public void unRoot()
public void removeExtNode(Node n)
n
- Node to removepublic void swapChildren(int id)
id
- ID (int) of Nodepublic void swapChildren(Node node)
(Last modified: 06/13/01)
node
- a Node of this Treepublic void orderAppearance(boolean order)
(Last modified: 06/13/01)
order
- decides in which direction to orderpublic void setAllNodesToNotCollapse()
In most cases methods adjustNodeCount(false) and recalculateAndReset() need to be called after this method has been called.
(Last modified: 07/03/01)
public void collapseToDeepestAnotNodes()
(Last modified: 07/03/01)
public void reRoot(int id) throws java.lang.Exception
(Last modified: 10/01/01)
id
- ID (int) of Node of this Treepublic void reRoot(Node n) throws java.lang.Exception
If the resulting reRooted Tree is to be used any further, in most cases the following three methods have to be called on the resulting Tree:
(Last modified: 10/01/01)
n
- Node of this Treepublic void reRoot(Branch b) throws java.lang.Exception
(Last modified: 10/01/01)
n1
- Node of Node of this Tree
n2 Node of Node of this Treepublic void reRootSkeleton(Node n) throws java.lang.Exception
This method only considers the "skeleton" of the Tree: It ignores everything except the topology and branch lenghts. It also does not deal properly with multifurcated tree! DO NOT USE.
This is ONLY to be used by methods in class SDIunrooted (in forester/tools)!
(Last modified: 10/01/01)
n
- Node of this Treepublic void reRootSkeleton(Branch b) throws java.lang.Exception
This method only considers the "skeleton" of the Tree: It ignores everything except the topology and branch lenghts. It also does not deal properly with multifurcated tree! DO NOT USE.
This is ONLY to be used by methods in class SDIunrooted (in forester/tools)!
(Last modified: 10/01/01)
n1
- Node of Node of this Tree
n2 Node of Node of this Treepublic java.util.Vector getOrthologs(Node n)
(Last modified: 11/22/00)
n
- external Node whose orthologs are to be returnedpublic java.util.Vector getStrictlySrelatedNodes(Node n)
Returns null if this Tree is empty or if n is internal.
(Last modified: 11/22/00)
n
- external Node whose strictly speciation related Nodes are to be
returnedpublic Node getNode(java.lang.String seqname) throws java.lang.Exception
(Last modifed: 12/03/00)
seqname
- Sequence name (String) of Node to findpublic Node getNode(int id)
(Last modified: 11/20/00)
id
- ID number (int) of the Node to findpublic java.util.Vector find(java.lang.String name, java.lang.String species, java.lang.String ec, int taxonomy_id) throws java.lang.Exception
(Last modified: 07/30/01)
name
- sequence name to match
species species name to match
ec EC number to match
taxonomy_id taxonomy ID to matchpublic java.util.Vector findInNameSpecECid(java.lang.String query) throws java.lang.Exception
(Last modified: 07/30/01)
query
- to String to matchpublic java.util.Vector getNodes(java.lang.String seqname) throws java.lang.Exception
(Last modified: 07/29/01)
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 java.lang.String[] getAllExternalSeqNames()
(Last modified: 11/13/00)
public double calculateRealHeight()
Takes into account collapsed Nodes.
(Last modified: 01/18/01)
public void findExtremeLnL()
(Last modifed: 11/18/00)
getHighestLnL()
public void copyBranchLengthValuesFrom(Tree t) throws java.lang.Exception
(Last modified: 05/22/01)
t
- the Tree to copy the branch lenghts frompublic void moveBranchLenghtsToBootstrap()
public boolean isEmpty()
public boolean isCompletelyBinary()
(Last modifed: 05/26/01)
public boolean areBranchLenghtsBootstraps()
public void levelOrderReID(int i)
(Last modified: 11/20/00)
i
- the starting value (int)public int preorderReID(int i)
(Last modified: 11/20/00)
i
- the starting value (int)public Node getRoot()
void setRoot(Node n)
public boolean isRooted()
public void setRooted(boolean b)
public double getHighestLnL()
findExtremeLnL()
public double getLowestLnL()
findExtremeLnL()
public double getRealHeight()
calculateRealHeight()
,
setRealHeight(double)
public void setRealHeight(double d)
the
- real height of this TreecalculateRealHeight()
public int getNumberOfDuplications()
public void setNumberOfDuplications(int i)
clean_nh
- set to true for clean NH formatpublic Node getExtNode0()
public int getNumberOfExtNodes()
public void setExtNodes(int i)
public void allowMoreThanBinaryNodesInNHoutput(boolean b)
public java.lang.String getName()
public void setName(java.lang.String s)
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 void printExtNodes()
public void printAllNodes()
public void setIndicatorsToZero()
public void hashIDs()
public void recalculateAndReset()
(Last modified: 11/18/00)
public void adjustNodeCount(boolean considerCollapsedNodes)
(Last modifed 06/28/00)
considerCollapsedNodes
- set to true to take into account
collapsed nodes (collapsed nodes
have 1 child).void addNodeAndConnect(java.lang.String s1, java.lang.String s2) throws java.lang.Exception
|
FORESTER 1.9 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |