mesquite.lib
Interface AdjustableTree

All Superinterfaces:
Listable, Tree
All Known Implementing Classes:
MesquiteTree

public interface AdjustableTree
extends Tree

This interface matches some of the basic tree changing methods of MesquiteTree. It was created (Aug. 2000) to allow methods to use the interface, in case tree structures from other programs needed to be used. Currently, though, AdjustableTree is not much used directly in Mesquite.


Field Summary
 
Fields inherited from interface mesquite.lib.Tree
BY_NAMES, BY_NUMBERS, BY_TABLE
 
Method Summary
 boolean collapseAllBranches(int node, boolean below, boolean notify)
          Collapses all internal branches within clade above node, to yield bush.
 boolean collapseBranch(int node, boolean notify)
          Collapses branch to yield polytomy.
 boolean deleteClade(int node, boolean notify)
          Excise node and clade above it from tree, zeroing information at each node in clade.
 int graftClade(int fromN, int toN, boolean notify)
          Attach node fromN (and any clade to attached to it) along node toN.
 boolean graftTaxon(int taxon, int toN, boolean notify)
          Attach terminal taxon to tree along given branch.
 int insertNode(int node, boolean notify)
          Inserts a new node on the branch represented by "node", and returns the number of the inserted node
 boolean interchangeBranches(int node, int otherNode, boolean notify)
          Interchanges two branches of tree.
 boolean moveBranch(int branchFrom, int branchTo, boolean notify)
          Move branch so as to excise branchFrom from its current position, and attach it to branch beneath node branchTo.
 boolean randomlyRotateDescendants(int node, java.util.Random rng, boolean notify)
          Randomly rotate branches of tree.
 boolean reroot(int atNode, int cladeRoot, boolean notify)
          reroot the clade below node atNode.
 void setAllBranchLengths(double length, boolean notify)
          Sets the branch length of node.
 void setBranchLength(int node, double length, boolean notify)
          Sets the branch length of node.
 void setBranchLength(int node, int length, boolean notify)
          Sets the branch length of node (stored as a double internally).
 void setName(java.lang.String name)
          Sets the name of the tree.
 void setNodeLabel(java.lang.String s, int node)
          Sets the node label to the passed string (doesn't copy string; just uses reference)
 void setParentOfNode(int node, int par, boolean notify)
          Sets par to be an additional parent of node.
 void setPolytomiesAssumption(int assumption, boolean notify)
          Sets whether polytomies are to be assumed soft; 0= hard; 1 = soft; 2 = use default.
 void setRooted(boolean rooted, boolean notify)
          Sets whether tree is rooted.
 void setSelected(int node, boolean selected)
           
 void setToDefaultBush(int numTaxa, boolean notify)
          Sets the tree to be a default bush.
 void setToDefaultLadder(int numTaxa, boolean notify)
          Sets the tree to be a default ladder.
 void setTreeVector(TreeVector treeVector)
          Sets the tree vector to which the tree belongs.
 boolean snipClade(int node, boolean notify)
          Excise node and clade above it from tree but leave the clade intact, in case it is to be attached elsewhere.
 void snipReticulations(int node)
          An indelicate quick way to delete all reticulations (extra parents) from a node.
 void splitTerminal(int taxonNum, int newNumber, boolean notify)
          Branches a terminal node off taxon number taxonNum, and assigns it taxon newNumber
 int sproutDaughter(int node, boolean notify)
          Sprouts a new daughter from node and returns it.
 
Methods inherited from interface mesquite.lib.Tree
allLengthsAssigned, anySelected, anySelectedInClade, branchingAncestor, branchingDescendant, branchLengthUnassigned, branchLengthUnassigned, cloneTree, daughterOf, daughtersOfNode, deepestPath, depthToAncestor, descendantOf, dispose, distanceToRoot, equalsTopology, firstDaughterOfNode, firstDaughterOfNode, firstDaughterOfNodeUR, firstInPostorder, getAssociatedBit, getAssociatedBits, getAssociatedDouble, getAssociatedDoubles, getAssociatedLong, getAssociatedLongs, getAssociatedObject, getAssociatedObjects, getBranchLength, getBranchLength, getBranchLength, getBranchLength, getFirstSelected, getID, getNodeLabel, getNumberAssociatedBits, getNumberAssociatedDoubles, getNumberAssociatedLongs, getNumberAssociatedObjects, getNumNodeSpaces, getNumTaxa, getPolytomiesAssumption, getRoot, getRoot, getRooted, getSelected, getSubRoot, getTaxa, getTerminalTaxa, getTerminalTaxaAsBits, getTerminalTaxaComplement, getTerminalTaxaComplement, getTerminalTaxaComplement, getVersionNumber, getWhichAssociatedBits, getWhichAssociatedDouble, getWhichAssociatedLong, getWhichAssociatedObject, grandmotherOfNode, hasBranchLengths, hasName, hasNodeLabels, hasPolytomies, hasReticulations, hasSoftPolytomies, hasUnbranchedInternals, indexedDaughterOfNode, isClade, isConvex, isConvex, isDefined, isLocked, lastDaughterOfNode, lastDaughterOfNode, lastDaughterOfNodeUR, leftmostTerminalOfNode, makeAllRootings, mostStepsAboveNode, motherOfNode, motherOfNode, mrca, mrca, mrca, mrca, mrcaTaxons, nextAroundUR, nextInPostorder, nextInPreorder, nextSisterOfNode, nextSisterOfNode, nextSisterOfNodeUR, nodeExists, nodeHasLabel, nodeInTraversal, nodeInTraversal, nodeInTree, nodeIsFirstDaughter, nodeIsHard, nodeIsInternal, nodeIsPolytomous, nodeIsSoft, nodeIsTerminal, nodeIsUnbranchedInternal, nodeOfBranchUR, nodeOfTaxonNumber, nodesAreSisters, numberOfDaughtersOfNode, numberOfInternalsInClade, numberOfNodesInClade, numberOfParentsOfNode, numberOfTerminalsInClade, numberSelectedInClade, parentOfNode, parentsOfNode, previousSisterOfNode, previousSisterOfNode, rightmostTerminalOfNode, rootIsReal, rootIsReal, setToClone, tallestNode, tallestNode, tallestPathAboveNode, tallestPathAboveNode, tallestPathAboveNodeUR, tallestPathAboveNodeUR, taxonInTree, taxonNumberOfNode, virtualDeleteTaxon, whichDaughter, whichDaughterDescendantOf, writeClade, writeTree, writeTree, writeTree, writeTree, writeTree, writeTreeByNames
 
Methods inherited from interface mesquite.lib.Listable
getName
 

Method Detail

setName

void setName(java.lang.String name)
Sets the name of the tree.


setSelected

void setSelected(int node,
                 boolean selected)

setTreeVector

void setTreeVector(TreeVector treeVector)
Sets the tree vector to which the tree belongs.


setRooted

void setRooted(boolean rooted,
               boolean notify)
Sets whether tree is rooted.


setPolytomiesAssumption

void setPolytomiesAssumption(int assumption,
                             boolean notify)
Sets whether polytomies are to be assumed soft; 0= hard; 1 = soft; 2 = use default.


setParentOfNode

void setParentOfNode(int node,
                     int par,
                     boolean notify)
Sets par to be an additional parent of node. Used to make reticulations. Currently there is no way to subtract parents, nor to rearrange trees that contain reticulations.


snipReticulations

void snipReticulations(int node)
An indelicate quick way to delete all reticulations (extra parents) from a node.


setAllBranchLengths

void setAllBranchLengths(double length,
                         boolean notify)
Sets the branch length of node.


setBranchLength

void setBranchLength(int node,
                     int length,
                     boolean notify)
Sets the branch length of node (stored as a double internally).


setBranchLength

void setBranchLength(int node,
                     double length,
                     boolean notify)
Sets the branch length of node.


setToDefaultBush

void setToDefaultBush(int numTaxa,
                      boolean notify)
Sets the tree to be a default bush.


setToDefaultLadder

void setToDefaultLadder(int numTaxa,
                        boolean notify)
Sets the tree to be a default ladder.


setNodeLabel

void setNodeLabel(java.lang.String s,
                  int node)
Sets the node label to the passed string (doesn't copy string; just uses reference)


splitTerminal

void splitTerminal(int taxonNum,
                   int newNumber,
                   boolean notify)
Branches a terminal node off taxon number taxonNum, and assigns it taxon newNumber


sproutDaughter

int sproutDaughter(int node,
                   boolean notify)
Sprouts a new daughter from node and returns it.


interchangeBranches

boolean interchangeBranches(int node,
                            int otherNode,
                            boolean notify)
Interchanges two branches of tree.


randomlyRotateDescendants

boolean randomlyRotateDescendants(int node,
                                  java.util.Random rng,
                                  boolean notify)
Randomly rotate branches of tree.


collapseBranch

boolean collapseBranch(int node,
                       boolean notify)
Collapses branch to yield polytomy.


collapseAllBranches

boolean collapseAllBranches(int node,
                            boolean below,
                            boolean notify)
Collapses all internal branches within clade above node, to yield bush.


deleteClade

boolean deleteClade(int node,
                    boolean notify)
Excise node and clade above it from tree, zeroing information at each node in clade.


snipClade

boolean snipClade(int node,
                  boolean notify)
Excise node and clade above it from tree but leave the clade intact, in case it is to be attached elsewhere.


graftTaxon

boolean graftTaxon(int taxon,
                   int toN,
                   boolean notify)
Attach terminal taxon to tree along given branch.


graftClade

int graftClade(int fromN,
               int toN,
               boolean notify)
Attach node fromN (and any clade to attached to it) along node toN. Returns the new node created to attach fromN


moveBranch

boolean moveBranch(int branchFrom,
                   int branchTo,
                   boolean notify)
Move branch so as to excise branchFrom from its current position, and attach it to branch beneath node branchTo. If successful, rename as given (to ensure renamed before notified).


insertNode

int insertNode(int node,
               boolean notify)
Inserts a new node on the branch represented by "node", and returns the number of the inserted node


reroot

boolean reroot(int atNode,
               int cladeRoot,
               boolean notify)
reroot the clade below node atNode.