AbstractTycheTypeLinkedClockModel
- abstract public class tyche.evolution.branchratemodel.AbstractTycheTypeLinkedClockModel extends beast.base.evolution.branchratemodel.BranchRateModel.Base
Abstract branch rate model for type-linked mutation rates
- Input typeLinkedRatesInput
input object for the mutation rate for each type
- Input nodeTypesInput
input object for the type for each node
- Input typeSwitchClockRateInput
input object for the clock rate for the Ancestral Reconstruction Tree Likelihood
- Input svsInput
input object for the substitution model describing type substitutions
- Input branchRatesInput
input object for a real parameter to log branch rates
- Input occupanciesInput
input object for a real parameter to log expected occupancy
- Function typeSwitchClockRate
the clock rate for the Ancestral Reconstruction Tree Likelihood
- TycheSVSGeneralSubstitutionModel svs
the substitution model describing type substitutions
- double qMatrix
the Q matrix describing type transitions
- RealParameter typeLinkedRates
the mutation rate for each type
- RealParameter branchRates
a real parameter to log branch rates
- RealParameter occupancies
a real parameter to log expected occupancy
- IntegerParameter nodeTypes
the type for each node
- Function muParameter
- public void initAndValidate()
Initialize and validate inputs that are required for all TyCHE branch models
- public double getTypeLinkedRate(int type)
Get the rate that corresponds to the type’s integer position in the rate list
- Parameters:
type – an integer representing the type whose clock rate should be returned
- Returns:
the clock rate at the position in the rate list corresponding to the integer representing the type
- public double getOccupancy(int parentType, int currentType, Double time, int nodeNum)
Get the occupancies in each of two states for a branch
- Parameters:
parentType – an integer representing the type of the parent of this branch
currentType – an integer representing the type of the child of this branch (current node)
time – a Double representing the timespan of the branch
nodeNum – an integer representing the node number of the child of this branch (current node)
- Returns:
a double array listing the expected occupancy for each type
- abstract public double getBranchRate(Node node)
Get the rate for this branch
- Parameters:
node – the current node (child of this branch)
- Returns:
the rate to be used for this branch
- public double getRateForBranch(Node node)
Get the rate for this branch by calling helper getBranchRate method, handling extra logging
- Parameters:
node – the current node (child of this branch)
- Returns:
the rate to be used for this branch
- public boolean isExpectedOccupancy()
Return whether this model is an expected occupancy model or not
- Returns:
true if this model is an expected occupancy model, otherwise false
- public boolean requiresRecalculation()
Return whether this model requires recalculation
- Returns:
true, so that this model is always recalculated