pal.treesearch
Class UnrootedMLSearcher

java.lang.Object
  extended by 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
static class UnrootedMLSearcher.StateObject
           
 
Constructor Summary
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
 Node buildPALNode()
           
 Tree buildPALTree()
           
 double calculateLogLikelihood()
          Likelihood calculation method (not optimisation)
 double calculateLogLikelihood2()
          An alternative likelihood calculation method (should give same results as other method, and in same time)
 SiteDetails calculateSiteDetails()
           
 BranchAccess[] getAccessToBranches()
           
 NodeAccess[] getAccessToNodes()
           
 UndoableAction getBranchLengthOptimiseAction(StoppingCriteria.Factory stopper)
           
 UndoableAction getBranchLengthWithModelOptimiseAction(StoppingCriteria.Factory stopper, MultivariateMinimum minimiser, int fxFracDigits, int xFracDigits)
           
 UndoableAction getFullSweepSPRAction(StoppingCriteria.Factory stopper)
           
 UndoableAction getModelOptimiseAction(MultivariateMinimum minimiser, int fxFracDigits, int xFracDigits)
           
 UndoableAction getModelOptimiseAction(MultivariateMinimum minimiser, MinimiserMonitor monitor, int fxFracDigits, int xFracDigits)
           
 UndoableAction getNNIAction(StoppingCriteria.Factory stopper)
           
 UndoableAction getNNIBranchLengthOptimiseAction(StoppingCriteria.Factory stopper)
           
 Assessor getSimpleAssessor(StoppingCriteria.Factory stopper)
           
 UndoableAction getSPRAction(StoppingCriteria.Factory stopper)
           
 java.lang.Object getStateReference()
           
 UndoableAction getSweepSPRAction(StoppingCriteria.Factory stopper)
           
 void instruct(UnrootedTreeInterface treeInterface)
           
 void mark()
           
 void restoreState(java.lang.Object stateReference)
           
 double simpleOptimiseLikelihood(double epsilon, AlgorithmCallback callback)
          Optimise the branch lengths of the tree to obtain the maximum likelihood.
 double simpleOptimiseLikelihood(StoppingCriteria stopper, AlgorithmCallback callback)
          Optimise the branch lengths of the tree to obtain the maximum likelihood.
 void testLiklihood()
           
 void undoToMark()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 OTU
model - 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 interface StateProvider

restoreState

public void restoreState(java.lang.Object stateReference)
Specified by:
restoreState in interface StateProvider

instruct

public void instruct(UnrootedTreeInterface treeInterface)
Specified by:
instruct in interface UnrootedTreeInterface.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)

mark

public final void mark()
Specified by:
mark in interface Markable

undoToMark

public final void undoToMark()
Specified by:
undoToMark in interface Markable

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)