Package pal.treesearch
Class FreeBranch
java.lang.Object
pal.treesearch.FreeBranch
- All Implemented Interfaces:
GeneralOptimisable
,RootAccess
-
Constructor Summary
ConstructorsConstructorDescriptionFreeBranch
(Node n, FreeNode parent, GeneralConstructionTool tool, GeneralConstraintGroupManager.Store store) Continuing recurison constructor for a given treeFreeBranch
(Node n, GeneralConstructionTool tool, GeneralConstraintGroupManager.Store store) The starting constructor for building from a given treeFreeBranch
(FreeNode left, FreeNode right, double branchLength, GeneralConstructionTool tool) A generic constructor given two already defined left and right children -
Method Summary
Modifier and TypeMethodDescriptionattachTo
(FreeBranch attachmentPoint, FreeBranch[] store) buildPALNodeBase
(FreeNode caller) buildPALNodeES
(FreeNode caller) double
double
calculateSiteDetails
(UnconstrainedLikelihoodModel.External calculator, GeneralConstructionTool tool) boolean
doNNI
(boolean leftSwapLeft, boolean rightSwapLeft) Does not reconstruct patternsfinal void
void
getAllComponents
(ArrayList store, Class componentType) void
getAllComponents
(ArrayList store, Class componentType, FreeNode caller) final double
final PatternInfo
void
getCenterPatternInfo
(GeneralConstructionTool tool, PatternInfo store) getExtendedConditionalProbabilities
(FreeNode caller, UnconstrainedLikelihoodModel.External externalCalculator, ConditionalProbabilityStore extendedStore, GeneralConstructionTool tool) final FreeNode
getLeft()
final PatternInfo
final int
final PatternInfo
getPatternInfo
(GeneralConstructionTool tool, FreeNode caller) final FreeNode
getRight()
final PatternInfo
boolean
hasConnection
(FreeBranch c, FreeNode caller) final void
mark()
Mark this node, or in other words store information on left and right nodes and branch length for later retreival (via undoToMark())double
optimise
(int optimisationType, UnivariateMinimum minimiser, GeneralConstructionTool tool, int fracDigits) void
setAnnotation
(Object annotation) final void
setBranchLength
(double x) void
Does nothing to fix up tree structurevoid
void
testLikelihood
(FreeNode caller, GeneralConstructionTool tool) void
toString()
final void
-
Constructor Details
-
FreeBranch
The starting constructor for building from a given tree- Parameters:
n
- The normal PAL node structure to base this tree ontool
- to aid in construction
-
FreeBranch
public FreeBranch(Node n, FreeNode parent, GeneralConstructionTool tool, GeneralConstraintGroupManager.Store store) Continuing recurison constructor for a given tree- Parameters:
n
- The PAL node structure to base sub tree onparent
- The parent node (sub tree in other direction)tool
- to aid in construction
-
FreeBranch
A generic constructor given two already defined left and right children- Parameters:
left
- The left noderight
- The right nodebranchLength
- The length of connectiontool
- to aid in construction
-
-
Method Details
-
setAnnotation
-
getLeft
- Returns:
- The "right" node of this connection.
-
getRight
- Returns:
- The "left" node of this connection.
-
mark
public final void mark()Mark this node, or in other words store information on left and right nodes and branch length for later retreival (via undoToMark()) -
getLeftPatternInfo
- Returns:
- The pattern info object for the left node leading to this connection
-
getRightPatternInfo
- Returns:
- The pattern info object for the right node leading to this connection
-
getPatternInfo
-
getCenterPatternInfo
- Returns:
- The pattern info across this connection (for use if this connection is the "root" of the likelihood calculation)
-
undoToMark
public final void undoToMark() -
toString
-
hasConnection
-
getLeftLeftBranch
- Returns:
- the "left" connection of the left node
-
getLeftRightBranch
- Returns:
- the "right" connection of the left node
-
getRightLeftBranch
- Returns:
- the "left" connection of the right node
-
getRightRightBranch
- Returns:
- the "right" connection of the left node
-
attachTo
- Returns:
- connection that by attaching to we would undo this operation, null if operation no successful
-
buildPALNodeBase
- Specified by:
buildPALNodeBase
in interfaceRootAccess
-
buildPALNodeES
- Specified by:
buildPALNodeES
in interfaceRootAccess
-
buildPALNodeBase
-
buildPALNodeES
-
setNodes
Does nothing to fix up tree structure -
swapNode
-
getLeftFlatConditionalProbabilities
public final ConditionalProbabilityStore getLeftFlatConditionalProbabilities(GeneralConstructionTool tool) -
getRightFlatConditionalProbabilities
public final ConditionalProbabilityStore getRightFlatConditionalProbabilities(GeneralConstructionTool tool) -
getBranchLength
public final double getBranchLength() -
setBranchLength
public final void setBranchLength(double x) -
toString
-
testLikelihood
- Specified by:
testLikelihood
in interfaceRootAccess
-
testLikelihood
-
getExtendedConditionalProbabilities
public ConditionalProbabilityStore getExtendedConditionalProbabilities(FreeNode caller, GeneralConstructionTool tool) -
getExtendedConditionalProbabilities
public ConditionalProbabilityStore getExtendedConditionalProbabilities(FreeNode caller, UnconstrainedLikelihoodModel.External externalCalculator, ConditionalProbabilityStore extendedStore, GeneralConstructionTool tool) -
getNumberOfOptimisationTypes
public final int getNumberOfOptimisationTypes()- Specified by:
getNumberOfOptimisationTypes
in interfaceGeneralOptimisable
-
optimise
public double optimise(int optimisationType, UnivariateMinimum minimiser, GeneralConstructionTool tool, int fracDigits) - Specified by:
optimise
in interfaceGeneralOptimisable
- Parameters:
minimiser
- The single dimensional minimisation tooltool
- The construction toolfracDigits
- the number of fractional digits to converge to- Returns:
- The optimised log likelihood, or >0 if not optimisation occured
-
getAllComponents
- Specified by:
getAllComponents
in interfaceRootAccess
-
getAllComponents
-
getCenterPatternInfo
-
getOther
-
doNNI
-
doNNI
public boolean doNNI(boolean leftSwapLeft, boolean rightSwapLeft) Does not reconstruct patterns -
calculateLogLikelihood
- Specified by:
calculateLogLikelihood
in interfaceRootAccess
-
calculateLogLikelihood2
-
calculateSiteDetails
public SiteDetails calculateSiteDetails(UnconstrainedLikelihoodModel.External calculator, GeneralConstructionTool tool)
-