Class UnrootedMLSearcher

java.lang.Object
pal.treesearch.UnrootedMLSearcher
All Implemented Interfaces:
Markable, StateProvider, UnrootedTreeInterface.Instructee

public class UnrootedMLSearcher extends Object implements Markable, StateProvider, UnrootedTreeInterface.Instructee
  • Constructor Details

    • 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 Details

    • getAccessToBranches

      public BranchAccess[] getAccessToBranches()
    • getAccessToNodes

      public NodeAccess[] getAccessToNodes()
    • getStateReference

      public Object getStateReference()
      Specified by:
      getStateReference in interface StateProvider
    • restoreState

      public void restoreState(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)