All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface mesquite.lib.Tree

public abstract interface Tree
extends mesquite.lib.Listable
This interface matches the readable methods of MesquiteTree, and was created so that translator classes could be written that could access tree structures from other programs. Most calculations are passed trees under the guise of interface Tree, which allows these calculations to be used on tree structures other than MesquiteTree, and which ensures they will not modify the tree. Some modules that need to modify tree structures check to see whether the passed Tree is an instance of AdjustableTree or MesquiteTree. The change to using interfaces (from the previous system which just passed MesquiteTree under the name Tree) was done August 2000, and the change has not fully settled in yet.


Variable Index

 o BY_NAMES
writing mode -- puts full taxon name in tree descriptions
 o BY_NUMBERS
writing mode -- puts number of taxon in tree descriptions
 o BY_TABLE
writing mode -- puts label from translation table, if available, in tree descriptions

Method Index

 o anySelected()
 o anySelectedInClade(int)
Returns whether there are any selected nodes in the clade
 o branchingAncestor(int)
Returns the closest ancestor that has more than one daughter.
 o branchingDescendant(int)
Returns the closest descendant that has more than one daughter, or is terminal.
 o branchLengthUnassigned(int)
 o cloneTree()
 o daughterOf(int, int)
Returns true if branchD is an immediate daughter of branchA
 o daughtersOfNode(int)
Returns the array of daughters of a node.
 o depthToAncestor(int, int)
Returns depth of second branch below first; -1 if not ancestral.
 o descendantOf(int, int)
Returns true iff first branch is a descendant of second branch.
 o dispose()
 o firstDaughterOfNode(int)
Returns the first (left-most) daughter of node.
 o firstDaughterOfNodeUR(int, int)
Returns the first (left-most) daughter of node in an UNROOTED sense where the node is treated as descendant from anc.
 o getAssociatedBit(NameReference, int)
 o getAssociatedBits(int)
 o getAssociatedDouble(NameReference, int)
 o getAssociatedDoubles(int)
 o getAssociatedLong(NameReference, int)
 o getAssociatedLongs(int)
 o getAssociatedObject(NameReference, int)
 o getAssociatedObjects(int)
 o getBranchLength(int)
Returns the branch length of the node.
 o getBranchLength(int, double)
Returns the branch length of the node.
 o getFirstSelected(int)
Gets the first node selected in clade of node node
 o getID()
 o getNodeLabel(int)
 o getNumberAssociatedBits()
 o getNumberAssociatedDoubles()
 o getNumberAssociatedLongs()
 o getNumberAssociatedObjects()
 o getNumNodeSpaces()
Returns the number of node spaces available in storage arrays within tree object.
 o getNumTaxa()
Returns the number of terminal taxa in the Taxa to which the tree refers.
 o getRoot()
 o getRooted()
 o getSelected(int)
 o getSubRoot()
 o getTaxa()
 o getTerminalTaxa(int)
Returns list of terminal taxa of clade of node.
 o getVersionNumber()
 o getWhichAssociatedBits(NameReference)
 o getWhichAssociatedDouble(NameReference)
 o getWhichAssociatedLong(NameReference)
 o getWhichAssociatedObject(NameReference)
 o grandmotherOfNode(int)
Returns the node's mother's mother.
 o hasBranchLengths()
Returns true if tree has branch lengths.
 o hasNodeLabels()
 o hasPolytomies(int)
Returns whether clade has polytomies.
 o indexedDaughterOfNode(int, int)
Returns the indexTH daughter of node.
 o isDefined()
 o isLocked()
Returns false if tree is null, has no nodes, or is locked.
 o lastDaughterOfNode(int)
Returns the right-most daughter of node.
 o lastDaughterOfNodeUR(int, int)
Returns the first (left-most) daughter of node in an UNROOTED sense where the node is treated as descendant from anc.
 o leftmostTerminalOfNode(int)
Returns the left-most terminal that is descendant from node.
 o makeAllRootings(int, TreeVector)
Puts into TreeVector trees from each rerooting within the clade of the node passed
 o motherOfNode(int)
Returns the immediate ancestor of node (mother) if node is non-reticulate.
 o mrca(int, int)
Returns most recent common ancestor of two branches.
 o nextAroundUR(int, int)
Returns the next (clockwise) to node connected to anc.
 o nextSisterOfNode(int)
Returns the node's sister immediately to the right.
 o nextSisterOfNodeUR(int, int, int)
Returns the node's sister immediately to the right in an UNROOTED sense where the node is treated as descendant from anc, which is descendant from ancAnc.
 o nodeExists(int)
Returns true if N is a valid node designation in tree.
 o nodeHasLabel(int)
 o nodeInTraversal(int)
Returns indexTH node in tree traversal
 o nodeInTraversal(int, int)
Returns indexTH node in traversal through clade
 o nodeInTree(int)
Returns whether node is part of tree.
 o nodeIsFirstDaughter(int)
Returns true if node is the first (leftmost) daughter of its mother.
 o nodeIsHard(int)
Returns true if the node has one descendant, two, or is a hard polytomy.
 o nodeIsInternal(int)
Returns true if node is an internal node.
 o nodeIsPolytomous(int)
Returns true if the node is polytomous (has more than two daughters).
 o nodeIsSoft(int)
Returns true if the node is a soft polytomy.
 o nodeIsTerminal(int)
Returns true if node is a terminal node.
 o nodeOfBranchUR(int, int)
Returns what node number in Mesquite's standard rooted sense corresponds to the anc-node branch.
 o nodeOfTaxonNumber(int)
Returns the terminal node corresponding to the given taxon number; 0 if the taxon is not part of the tree.
 o nodesAreSisters(int, int)
Returns true if branch1 and branch2 are sisters by their mother (i.e., primary parent).
 o numberOfDaughtersOfNode(int)
Returns the number of daughters of the node.
 o numberOfInternalsInClade(int)
Returns number of internal nodes in clade.
 o numberOfNodesInClade(int)
Returns number of total nodes (internal and external) in clade.
 o numberOfParentsOfNode(int)
Returns the number of parents of node.
 o numberOfTerminalsInClade(int)
Returns number of terminal taxa in clade.
 o numberSelectedInClade(int)
Returns the number of nodes selected in the clade
 o parentOfNode(int, int)
Returns the indexTH parent of node.
 o parentsOfNode(int)
Returns the array of parents of node.
 o previousSisterOfNode(int)
Returns the node's sister immediately to the left.
 o rightmostTerminalOfNode(int)
Returns the right-most terminal that is descendant from node.
 o tallestPathAboveNode(int)
 o tallestPathAboveNode(int, double)
 o tallestPathAboveNodeUR(int, int)
 o tallestPathAboveNodeUR(int, int, double)
returns total of branchlengths from node up to tallest terminal
 o taxonInTree(int)
Returns whether taxon is part of tree.
 o taxonNumberOfNode(int)
Returns the taxon number of the node.
 o whichDaughter(int)
Returns the index of the node among its sisters (i.e., if it is the first daughter of its mother, the second , third, etc.
 o whichDaughterDescendantOf(int, int)
Returns if branchD is descendant of branchA, then which daughter of branchA does it descend from? Returns 0 if not descendant.
 o writeTree()
 o writeTree(int)
 o writeTree(int, boolean)
 o writeTree(int, boolean, boolean, boolean, boolean, String)

Variables

 o BY_NAMES
 public static final int BY_NAMES
writing mode -- puts full taxon name in tree descriptions

 o BY_NUMBERS
 public static final int BY_NUMBERS
writing mode -- puts number of taxon in tree descriptions

 o BY_TABLE
 public static final int BY_TABLE
writing mode -- puts label from translation table, if available, in tree descriptions

Methods

 o cloneTree
 public abstract mesquite.lib.MesquiteTree cloneTree()
 o isDefined
 public abstract boolean isDefined()
 o isLocked
 public abstract boolean isLocked()
Returns false if tree is null, has no nodes, or is locked.

 o getID
 public abstract long getID()
 o getVersionNumber
 public abstract long getVersionNumber()
 o getTaxa
 public abstract mesquite.lib.Taxa getTaxa()
 o getRoot
 public abstract int getRoot()
 o getSubRoot
 public abstract int getSubRoot()
 o getRooted
 public abstract boolean getRooted()
 o getNumTaxa
 public abstract int getNumTaxa()
Returns the number of terminal taxa in the Taxa to which the tree refers. This is not necessarily the number of terminal taxa in the tree itself (for that, call numberOfTerminalsInClade(root)).

 o getNumNodeSpaces
 public abstract int getNumNodeSpaces()
Returns the number of node spaces available in storage arrays within tree object.

 o nodeExists
 public abstract boolean nodeExists(int node)
Returns true if N is a valid node designation in tree.

 o nodeInTree
 public abstract boolean nodeInTree(int sought)
Returns whether node is part of tree. Differs from nodeExists by doing full recursion (more reliable, slower).

 o nodeIsInternal
 public abstract boolean nodeIsInternal(int node)
Returns true if node is an internal node.

 o nodeIsTerminal
 public abstract boolean nodeIsTerminal(int node)
Returns true if node is a terminal node.

 o taxonInTree
 public abstract boolean taxonInTree(int taxonNum)
Returns whether taxon is part of tree.

 o taxonNumberOfNode
 public abstract int taxonNumberOfNode(int node)
Returns the taxon number of the node. This is -1 if the node is internal, the taxon number if terminal.

 o nodeOfTaxonNumber
 public abstract int nodeOfTaxonNumber(int taxonNum)
Returns the terminal node corresponding to the given taxon number; 0 if the taxon is not part of the tree.

 o motherOfNode
 public abstract int motherOfNode(int node)
Returns the immediate ancestor of node (mother) if node is non-reticulate. If node is reticulate, returns the first (primary) parent.

 o grandmotherOfNode
 public abstract int grandmotherOfNode(int node)
Returns the node's mother's mother.

 o numberOfParentsOfNode
 public abstract int numberOfParentsOfNode(int node)
Returns the number of parents of node.

 o parentOfNode
 public abstract int parentOfNode(int node,
                                  int index)
Returns the indexTH parent of node.

 o parentsOfNode
 public abstract int[] parentsOfNode(int node)
Returns the array of parents of node. If node is not reticulate, the array returned contains only the mother node.

 o descendantOf
 public abstract boolean descendantOf(int branchD,
                                      int branchA)
Returns true iff first branch is a descendant of second branch.

 o depthToAncestor
 public abstract int depthToAncestor(int branchD,
                                     int branchA)
Returns depth of second branch below first; -1 if not ancestral.

 o firstDaughterOfNode
 public abstract int firstDaughterOfNode(int node)
Returns the first (left-most) daughter of node.

 o lastDaughterOfNode
 public abstract int lastDaughterOfNode(int node)
Returns the right-most daughter of node.

 o daughtersOfNode
 public abstract int[] daughtersOfNode(int node)
Returns the array of daughters of a node. Normally it will be best to cycle through the daughters as shown in the recursion example in the documentation for the Tree class.

 o daughterOf
 public abstract boolean daughterOf(int branchD,
                                    int branchA)
Returns true if branchD is an immediate daughter of branchA

 o nodeIsFirstDaughter
 public abstract boolean nodeIsFirstDaughter(int node)
Returns true if node is the first (leftmost) daughter of its mother.

 o whichDaughter
 public abstract int whichDaughter(int node)
Returns the index of the node among its sisters (i.e., if it is the first daughter of its mother, the second , third, etc.

 o indexedDaughterOfNode
 public abstract int indexedDaughterOfNode(int node,
                                           int index)
Returns the indexTH daughter of node.

 o numberOfDaughtersOfNode
 public abstract int numberOfDaughtersOfNode(int node)
Returns the number of daughters of the node.

 o whichDaughterDescendantOf
 public abstract int whichDaughterDescendantOf(int branchD,
                                               int branchA)
Returns if branchD is descendant of branchA, then which daughter of branchA does it descend from? Returns 0 if not descendant.

 o nextSisterOfNode
 public abstract int nextSisterOfNode(int node)
Returns the node's sister immediately to the right. If the node has no sister to the right, returns 0 (which is not a valid node designation).

 o previousSisterOfNode
 public abstract int previousSisterOfNode(int node)
Returns the node's sister immediately to the left. If the node has no sister to the right, returns 0 (which is not a valid node designation).

 o nodesAreSisters
 public abstract boolean nodesAreSisters(int branch1,
                                         int branch2)
Returns true if branch1 and branch2 are sisters by their mother (i.e., primary parent). There is currently no method to return whether two nodes share at least one parent.

 o hasPolytomies
 public abstract boolean hasPolytomies(int node)
Returns whether clade has polytomies.

 o nodeIsPolytomous
 public abstract boolean nodeIsPolytomous(int node)
Returns true if the node is polytomous (has more than two daughters).

 o nodeIsHard
 public abstract boolean nodeIsHard(int node)
Returns true if the node has one descendant, two, or is a hard polytomy.

 o nodeIsSoft
 public abstract boolean nodeIsSoft(int node)
Returns true if the node is a soft polytomy.

 o numberOfNodesInClade
 public abstract int numberOfNodesInClade(int node)
Returns number of total nodes (internal and external) in clade.

 o numberOfTerminalsInClade
 public abstract int numberOfTerminalsInClade(int node)
Returns number of terminal taxa in clade.

 o numberOfInternalsInClade
 public abstract int numberOfInternalsInClade(int node)
Returns number of internal nodes in clade.

 o leftmostTerminalOfNode
 public abstract int leftmostTerminalOfNode(int node)
Returns the left-most terminal that is descendant from node.

 o rightmostTerminalOfNode
 public abstract int rightmostTerminalOfNode(int node)
Returns the right-most terminal that is descendant from node.

 o getTerminalTaxa
 public abstract int[] getTerminalTaxa(int node)
Returns list of terminal taxa of clade of node.

 o nodeInTraversal
 public abstract int nodeInTraversal(int index)
Returns indexTH node in tree traversal

 o nodeInTraversal
 public abstract int nodeInTraversal(int index,
                                     int cladeRoot)
Returns indexTH node in traversal through clade

 o mrca
 public abstract int mrca(int branchA,
                          int branchB)
Returns most recent common ancestor of two branches.

 o branchingAncestor
 public abstract int branchingAncestor(int node)
Returns the closest ancestor that has more than one daughter.

 o branchingDescendant
 public abstract int branchingDescendant(int node)
Returns the closest descendant that has more than one daughter, or is terminal.

 o nextAroundUR
 public abstract int nextAroundUR(int anc,
                                  int node)
Returns the next (clockwise) to node connected to anc. This is one of the UR procedures, designed to allow unrooted style traversal through the tree

 o firstDaughterOfNodeUR
 public abstract int firstDaughterOfNodeUR(int anc,
                                           int node)
Returns the first (left-most) daughter of node in an UNROOTED sense where the node is treated as descendant from anc. This is one of the UR procedures, designed to allow unrooted style traversal through the tree

 o nextSisterOfNodeUR
 public abstract int nextSisterOfNodeUR(int ancAnc,
                                        int anc,
                                        int node)
Returns the node's sister immediately to the right in an UNROOTED sense where the node is treated as descendant from anc, which is descendant from ancAnc. If the node has no sister to the right, returns 0 (which is not a valid node designation). This is one of the UR procedures, designed to allow unrooted style traversal through the tree

 o lastDaughterOfNodeUR
 public abstract int lastDaughterOfNodeUR(int anc,
                                          int node)
Returns the first (left-most) daughter of node in an UNROOTED sense where the node is treated as descendant from anc. This is one of the UR procedures, designed to allow unrooted style traversal through the tree

 o nodeOfBranchUR
 public abstract int nodeOfBranchUR(int anc,
                                    int node)
Returns what node number in Mesquite's standard rooted sense corresponds to the anc-node branch.

 o makeAllRootings
 public abstract void makeAllRootings(int cladeRoot,
                                      mesquite.lib.TreeVector trees)
Puts into TreeVector trees from each rerooting within the clade of the node passed

 o hasBranchLengths
 public abstract boolean hasBranchLengths()
Returns true if tree has branch lengths.

 o getBranchLength
 public abstract double getBranchLength(int node)
Returns the branch length of the node.

 o getBranchLength
 public abstract double getBranchLength(int node,
                                        double ifUnassigned)
Returns the branch length of the node. If the branch length is unassigned, pass back the double passed in

 o branchLengthUnassigned
 public abstract boolean branchLengthUnassigned(int node)
 o tallestPathAboveNode
 public abstract double tallestPathAboveNode(int node)
 o tallestPathAboveNodeUR
 public abstract double tallestPathAboveNodeUR(int anc,
                                               int node)
 o tallestPathAboveNode
 public abstract double tallestPathAboveNode(int node,
                                             double perUnassignedLength)
 o tallestPathAboveNodeUR
 public abstract double tallestPathAboveNodeUR(int anc,
                                               int node,
                                               double perUnassignedLength)
returns total of branchlengths from node up to tallest terminal

 o getSelected
 public abstract boolean getSelected(int node)
 o anySelected
 public abstract boolean anySelected()
 o numberSelectedInClade
 public abstract int numberSelectedInClade(int node)
Returns the number of nodes selected in the clade

 o anySelectedInClade
 public abstract boolean anySelectedInClade(int node)
Returns whether there are any selected nodes in the clade

 o getFirstSelected
 public abstract int getFirstSelected(int node)
Gets the first node selected in clade of node node

 o getNumberAssociatedBits
 public abstract int getNumberAssociatedBits()
 o getAssociatedBits
 public abstract mesquite.lib.Bits getAssociatedBits(int index)
 o getWhichAssociatedBits
 public abstract mesquite.lib.Bits getWhichAssociatedBits(mesquite.lib.NameReference nRef)
 o getAssociatedBit
 public abstract boolean getAssociatedBit(mesquite.lib.NameReference nRef,
                                          int index)
 o getNumberAssociatedLongs
 public abstract int getNumberAssociatedLongs()
 o getAssociatedLongs
 public abstract mesquite.lib.LongArray getAssociatedLongs(int index)
 o getWhichAssociatedLong
 public abstract mesquite.lib.LongArray getWhichAssociatedLong(mesquite.lib.NameReference nRef)
 o getAssociatedLong
 public abstract long getAssociatedLong(mesquite.lib.NameReference nRef,
                                        int index)
 o getNumberAssociatedDoubles
 public abstract int getNumberAssociatedDoubles()
 o getWhichAssociatedDouble
 public abstract mesquite.lib.DoubleArray getWhichAssociatedDouble(mesquite.lib.NameReference nRef)
 o getAssociatedDoubles
 public abstract mesquite.lib.DoubleArray getAssociatedDoubles(int index)
 o getAssociatedDouble
 public abstract double getAssociatedDouble(mesquite.lib.NameReference nRef,
                                            int index)
 o getNumberAssociatedObjects
 public abstract int getNumberAssociatedObjects()
 o getAssociatedObjects
 public abstract mesquite.lib.ObjectArray getAssociatedObjects(int index)
 o getWhichAssociatedObject
 public abstract mesquite.lib.ObjectArray getWhichAssociatedObject(mesquite.lib.NameReference nRef)
 o getAssociatedObject
 public abstract java.lang.Object getAssociatedObject(mesquite.lib.NameReference nRef,
                                                      int index)
 o writeTree
 public abstract java.lang.String writeTree()
 o writeTree
 public abstract java.lang.String writeTree(int byWhat)
 o writeTree
 public abstract java.lang.String writeTree(int byWhat,
                                            boolean associatedUseComments)
 o writeTree
 public abstract java.lang.String writeTree(int byWhat,
                                            boolean associatedUseComments,
                                            boolean includeBranchLengths,
                                            boolean includeNodeLabels,
                                            boolean zeroBased,
                                            java.lang.String delimiter)
 o hasNodeLabels
 public abstract boolean hasNodeLabels()
 o getNodeLabel
 public abstract java.lang.String getNodeLabel(int node)
 o nodeHasLabel
 public abstract boolean nodeHasLabel(int node)
 o dispose
 public abstract void dispose()

All Packages  Class Hierarchy  This Package  Previous  Next  Index