Class GeneralConstructionTool

java.lang.Object
pal.treesearch.GeneralConstructionTool

public class GeneralConstructionTool extends Object
  • Constructor Details

    • GeneralConstructionTool

      public GeneralConstructionTool(ConstraintModel constraints, Alignment alignment)
      The constructor
      Parameters:
      alignment - the base alignment
      numberOfStates - the number of states
      numberOfCategories - the number of model classes
      freeCalculatorGenerator - The generator for free calculation (may be null if no free components)
      constrainedCalcGenerator - The generator for constrained calculation (assuming a Molecular Clock, and may be null if no constrained components)
  • Method Details

    • createFreeNode

      public FreeNode createFreeNode(Node peer, FreeBranch parent, GeneralConstraintGroupManager.Store store)
      Create an appropriate free node given a peer, and it's parent branch
      Parameters:
      peer - The normal PAL node peer
      parent - The parent branch
      Returns:
      A FreeNode
    • createRootAccess

      public RootAccess createRootAccess(Node baseTree, GeneralConstraintGroupManager.Store store)
    • createConstrainedNode

      public ConstrainedNode createConstrainedNode(Node peer, ParentableConstrainedNode parent, GeneralConstraintGroupManager.Store store, GeneralConstraintGroupManager groupManager)
      Create an appropriate constrained node given a peer, and it's parent node
      Parameters:
      peer - The normal PAL node peer
      parent - The parent node
      Returns:
      A ConstrainedNode
    • constructFreshPatternInfo

      public PatternInfo constructFreshPatternInfo(boolean binaryPattern)
    • obtainTempConditionalProbabilityStore

      public final ConditionalProbabilityStore obtainTempConditionalProbabilityStore()
    • newConditionalProbabilityStore

      public final ConditionalProbabilityStore newConditionalProbabilityStore(boolean isForLeaf)
    • allocateNextConnectionIndex

      public final int allocateNextConnectionIndex()
    • allocateNewFreeInternalCalculator

      public UnconstrainedLikelihoodModel.Internal allocateNewFreeInternalCalculator()
    • obtainFreeExternalCalculator

      public UnconstrainedLikelihoodModel.External obtainFreeExternalCalculator()
    • createNewFreeLeafCalculator

      public UnconstrainedLikelihoodModel.Leaf createNewFreeLeafCalculator(int[] patternStateMatchup, int numberOfPatterns)
    • build

      public int build(PatternInfo beingBuilt, PatternInfo left, PatternInfo right)
    • getDataType

      public DataType getDataType()
    • getNumberOfSites

      public final int getNumberOfSites()
    • getNumberOfStates

      public int getNumberOfStates()
    • getSequence

      public int[] getSequence(String name)
      Get the sequence data for a particular OTU
      Parameters:
      name - The name of the OTU
      Returns:
      the sequence data stored as integer values
      Throws:
      IllegalArgumentException - if no such OTU with given name
    • getLeafLabelSet

      public String[] getLeafLabelSet(Node peer)
      A horibly inefficient way of doing things. Finds the leaf index for all leaves from the tree defined by the PAL node. Returns -1 if more than one index.
      Parameters:
      peer - the root of the sub tree
      Returns:
      the common leaf index, of -1 if no common leaf index
    • getLeafLabelSet

      public void getLeafLabelSet(Node peer, ArrayList al)