Package pal.treesearch
Class UnrootedMLSearcher
- java.lang.Object
-
- pal.treesearch.UnrootedMLSearcher
-
- All Implemented Interfaces:
Markable
,StateProvider
,UnrootedTreeInterface.Instructee
public class UnrootedMLSearcher extends java.lang.Object implements Markable, StateProvider, UnrootedTreeInterface.Instructee
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UnrootedMLSearcher.StateObject
-
Constructor Summary
Constructors Constructor Description UnrootedMLSearcher(Alignment alignment, SubstitutionModel model)
Build an unconstrained optimiser based on a randomly generated tree.UnrootedMLSearcher(Alignment alignment, SubstitutionModel model, LHCalculator.Factory calcFactory)
UnrootedMLSearcher(Node root)
Create a searcher based on a given tree, that has no alignment , or model, specified (useful as backbone tree for attaching new nodes)UnrootedMLSearcher(Node root, Alignment alignment, SubstitutionModel model)
UnrootedMLSearcher(Node root, Alignment alignment, SubstitutionModel model, LHCalculator.Factory calcFactory)
UnrootedMLSearcher(Node root, SubstitutionModel model)
Create a searcher based on a given tree, that has no alignment specified (useful as backbone tree for attaching new nodes)UnrootedMLSearcher(Tree t, Alignment alignment, SubstitutionModel model)
-
Method Summary
-
-
-
Constructor Detail
-
UnrootedMLSearcher
public UnrootedMLSearcher(Alignment alignment, SubstitutionModel model)
Build an unconstrained optimiser based on a randomly generated tree.- Parameters:
alignment
- the alignment used to represent each OTUmodel
- the substitution model that is used for calcuation. If optimisation on the model occurs than this model will be altered
-
UnrootedMLSearcher
public UnrootedMLSearcher(Alignment alignment, SubstitutionModel model, LHCalculator.Factory calcFactory)
-
UnrootedMLSearcher
public UnrootedMLSearcher(Tree t, Alignment alignment, SubstitutionModel model)
-
UnrootedMLSearcher
public UnrootedMLSearcher(Node root, Alignment alignment, SubstitutionModel model)
-
UnrootedMLSearcher
public UnrootedMLSearcher(Node root, SubstitutionModel model)
Create a searcher based on a given tree, that has no alignment specified (useful as backbone tree for attaching new nodes)- Parameters:
root
- the root of the tree to base things on (doesn't matter if it's rooted)model
- the substitution model to be used
-
UnrootedMLSearcher
public UnrootedMLSearcher(Node root)
Create a searcher based on a given tree, that has no alignment , or model, specified (useful as backbone tree for attaching new nodes)- Parameters:
root
- the root of the tree to base things on (doesn't matter if it's rooted)
-
UnrootedMLSearcher
public UnrootedMLSearcher(Node root, Alignment alignment, SubstitutionModel model, LHCalculator.Factory calcFactory)
-
-
Method Detail
-
getAccessToBranches
public BranchAccess[] getAccessToBranches()
-
getAccessToNodes
public NodeAccess[] getAccessToNodes()
-
getStateReference
public java.lang.Object getStateReference()
- Specified by:
getStateReference
in interfaceStateProvider
-
restoreState
public void restoreState(java.lang.Object stateReference)
- Specified by:
restoreState
in interfaceStateProvider
-
instruct
public void instruct(UnrootedTreeInterface treeInterface)
- Specified by:
instruct
in interfaceUnrootedTreeInterface.Instructee
-
getNNIAction
public UndoableAction getNNIAction(StoppingCriteria.Factory stopper)
-
getBranchLengthOptimiseAction
public UndoableAction getBranchLengthOptimiseAction(StoppingCriteria.Factory stopper)
-
getNNIBranchLengthOptimiseAction
public UndoableAction getNNIBranchLengthOptimiseAction(StoppingCriteria.Factory stopper)
- Parameters:
stopper
- The means for determining when a set of round should be stopped- Returns:
- An undoable action that does the Simulataneous NNI/Branch length of Stephan Guindon
-
getBranchLengthWithModelOptimiseAction
public UndoableAction getBranchLengthWithModelOptimiseAction(StoppingCriteria.Factory stopper, MultivariateMinimum minimiser, int fxFracDigits, int xFracDigits)
-
getModelOptimiseAction
public UndoableAction getModelOptimiseAction(MultivariateMinimum minimiser, int fxFracDigits, int xFracDigits)
-
getModelOptimiseAction
public UndoableAction getModelOptimiseAction(MultivariateMinimum minimiser, MinimiserMonitor monitor, int fxFracDigits, int xFracDigits)
-
getSPRAction
public UndoableAction getSPRAction(StoppingCriteria.Factory stopper)
-
getSweepSPRAction
public UndoableAction getSweepSPRAction(StoppingCriteria.Factory stopper)
-
getFullSweepSPRAction
public UndoableAction getFullSweepSPRAction(StoppingCriteria.Factory stopper)
-
undoToMark
public final void undoToMark()
- Specified by:
undoToMark
in interfaceMarkable
-
testLiklihood
public void testLiklihood()
-
calculateLogLikelihood
public double calculateLogLikelihood()
Likelihood calculation method (not optimisation)- Returns:
- the log likelihood, based on current model, branchlengths and topology
-
calculateLogLikelihood2
public double calculateLogLikelihood2()
An alternative likelihood calculation method (should give same results as other method, and in same time)- Returns:
- the log likelihood, based on current model, branchlengths and topology
-
calculateSiteDetails
public SiteDetails calculateSiteDetails()
-
simpleOptimiseLikelihood
public double simpleOptimiseLikelihood(double epsilon, AlgorithmCallback callback)
Optimise the branch lengths of the tree to obtain the maximum likelihood. Does not change the model or the topology- Parameters:
epsilon
- the tolerance places for convergence (on the likelihood score)callback
- a callback to monitor progress- Returns:
- the resulting likelihood
-
simpleOptimiseLikelihood
public double simpleOptimiseLikelihood(StoppingCriteria stopper, AlgorithmCallback callback)
Optimise the branch lengths of the tree to obtain the maximum likelihood. Does not change the model or the topology- Parameters:
stopper
- the stopping criteria (on the likelihood score)callback
- a callback to monitor progress- Returns:
- the resulting likelihood
-
buildPALTree
public Tree buildPALTree()
-
buildPALNode
public Node buildPALNode()
-
getSimpleAssessor
public final Assessor getSimpleAssessor(StoppingCriteria.Factory stopper)
-
-