pal.eval
public final class LikelihoodTool extends java.lang.Object
Constructor and Description |
---|
LikelihoodTool() |
Modifier and Type | Method and Description |
---|---|
static double |
calculateLogLikelihood(Tree tree,
Alignment alignment,
SubstitutionModel model)
Calculate the log likelihood of a particular set of phylogenetic data
|
static Alignment |
getMatchingDataType(Alignment alignment,
SubstitutionModel model)
Creates a new alignment that has a compatible data type with a substution model (needed for likelihood stuff)
|
static Tree |
optimiseClockConstrained(Tree tree,
Alignment alignment,
SubstitutionModel model,
boolean optimiseModel)
Optimise the branches of a tree with regard to maximum likelihood, with a molecular clock assumption, that is, constrained such that all tips are contemporaneous, the tree is treated as rooted.
|
static Tree |
optimiseMRDT(Tree tree,
Alignment alignment,
SubstitutionModel model,
TimeOrderCharacterData tocd,
boolean optimiseModel,
double[] rateStore)
Optimise the branches of a tree with regard to maximum likelihood, with under an assumption of a molecular clock with serially sampled data and multiple mutation rate parameters, mu - one for each sampling interval.
|
static Tree |
optimiseMRDT(Tree tree,
Alignment alignment,
SubstitutionModel model,
TimeOrderCharacterData tocd,
boolean optimiseModel,
double[] rateChangeTimes,
double[] rateStore)
Optimise the branches of a tree with regard to maximum likelihood, with under an assumption of a molecular clock with serially sampled data and multiple mutation rate parameters, mu, over general time intervals.
|
static Tree |
optimiseSRDT(Tree tree,
Alignment alignment,
SubstitutionModel model,
TimeOrderCharacterData tocd,
boolean optimiseModel,
double[] rateStore)
Optimise the branches of a tree with regard to maximum likelihood, with under an assumption of a molecular clock with serially sampled data and a single mutation rate parameter.
|
static Tree |
optimiseUnrooted(Tree tree,
Alignment alignment,
SubstitutionModel model,
boolean optimiseModel)
Optimise the branches of a tree with regard to maximum likelihood, with no constraints on the branchlengths (as for an unrooted tree).
|
public static final double calculateLogLikelihood(Tree tree, Alignment alignment, SubstitutionModel model)
tree
- The tree with set branch lengthsalignment
- The alignment (sequence names must match tree)model
- The substitution model to usepublic static final Tree optimiseUnrooted(Tree tree, Alignment alignment, SubstitutionModel model, boolean optimiseModel)
tree
- The tree (remains unchanged)alignment
- The alignment (sequence names must match tree)model
- The substitution model to use (is changed if optimisation of the model is choosen)optimiseModel
- if true the model is also optimised, otherwise just the treefor an equivalient, but potentially faster method.
public static final Tree optimiseClockConstrained(Tree tree, Alignment alignment, SubstitutionModel model, boolean optimiseModel)
tree
- The tree with set branch lengthsalignment
- The alignment (sequence names must match tree)model
- The substitution model to useoptimiseModel
- if true the model is optimised as wellpublic static final Tree optimiseSRDT(Tree tree, Alignment alignment, SubstitutionModel model, TimeOrderCharacterData tocd, boolean optimiseModel, double[] rateStore)
tree
- The tree with set branch lengthsalignment
- The alignment (sequence names must match tree)model
- The substitution model to usetocd
- The sample information object relating sequences to time or orderoptimiseModel
- if true the model is optimised as wellrateStore
- storage space for the mutation rate, the initial value is used as the starting rate in the optimisationpublic static final Tree optimiseMRDT(Tree tree, Alignment alignment, SubstitutionModel model, TimeOrderCharacterData tocd, boolean optimiseModel, double[] rateStore)
tree
- The tree with set branch lengthsalignment
- The alignment (sequence names must match tree)model
- The substitution model to usetocd
- The sample information object relating sequences to time or orderoptimiseModel
- if true the model is optimised as wellrateStore
- storage space for the mus, the initial values are used as the starting mus in the optimisationpublic static final Tree optimiseMRDT(Tree tree, Alignment alignment, SubstitutionModel model, TimeOrderCharacterData tocd, boolean optimiseModel, double[] rateChangeTimes, double[] rateStore)
tree
- The tree with set branch lengthsalignment
- The alignment (sequence names must match tree)model
- The substitution model to usetocd
- The sample information object relating sequences to time or orderoptimiseModel
- if true the model is optimised as wellrateChangeTimes
- the times (as related to the sample information) of when a new mu is used (should be of length mus.length -1 )rateStore
- storage space for the mus, the initial values are used as the starting mus in the optimisationpublic static final Alignment getMatchingDataType(Alignment alignment, SubstitutionModel model)
alignment
- The base alignmentmodel
- The substitution model that will be used with the alignment data