public class StandardCalculator extends Calculator<StandardLikelihood>
Calculator.CalculatorException, Calculator.SiteCalculatorm, snl, t| Constructor and Description |
|---|
StandardCalculator(java.util.Map<java.lang.String,Model> m,
Alignment a,
java.util.Map<java.lang.String,Tree> t)
Creates a class to calculate the likelihood for a given set of models, an alignment,
and a tree.
|
StandardCalculator(java.util.Map<java.lang.String,Model> m,
Alignment a,
java.util.Map<java.lang.String,Tree> t,
Alignment unobserved)
Creates a class to calculate the likelihood for a given set of models, an alignment,
a tree and unobserved data.
|
StandardCalculator(java.util.Map<java.lang.String,Model> m,
Alignment a,
Tree t)
Creates a class to calculate the likelihood for a given set of models, an alignment,
and a tree.
|
StandardCalculator(java.util.Map<java.lang.String,Model> m,
Alignment a,
Tree t,
Alignment unobserved)
Creates a class to calculate the likelihood for a given set of models, an alignment,
and a tree.
|
StandardCalculator(Model m,
Alignment a,
java.util.Map<java.lang.String,Tree> t)
Creates a class to calculate the likelihood for a given set of models, an alignment,
and a tree.
|
StandardCalculator(Model m,
Alignment a,
java.util.Map<java.lang.String,Tree> t,
Alignment unobserved)
Creates a class to calculate the likelihood for a given set of models, an alignment,
and a tree.
|
StandardCalculator(Model m,
Alignment a,
Tree t)
Creates an object to calculate the likelihood for a given model, alignment and
tree.
|
StandardCalculator(Model m,
Alignment a,
Tree t,
Alignment unobserved)
Creates a class to calculate the likelihood for a given model, alignment,
tree and missing data
|
| Modifier and Type | Method and Description |
|---|---|
SiteLikelihood |
calculateSite(Site s,
Tree t,
Parameters p,
Probabilities tp,
java.util.Map<java.lang.String,SiteLikelihood.NodeLikelihood> nl)
Calculate the likelihood for a single site.
|
StandardLikelihood |
combineSites(java.util.Map<Site,SiteLikelihood> sites,
Parameters p)
Combines the likelihood from each site into a alignment likelihood
|
int |
getAlignmentLength()
Get the length of the alignment the calculator is using
|
calculate, setNoThreads, setThread, siteCalculatepublic StandardCalculator(Model m, Alignment a, Tree t) throws TreeException, SiteLikelihood.LikelihoodException, AlignmentException
m - The modela - The alignmentt - The treeTreeException - If there is a problem with the treeSiteLikelihood.LikelihoodException - Thrown if a node is initialised to every state having zero probability
(most probably due to the state at the node not being in the model).AlignmentException - Thrown if the tree and site have incompatible taxapublic StandardCalculator(Model m, Alignment a, Tree t, Alignment unobserved) throws TreeException, SiteLikelihood.LikelihoodException, AlignmentException
m - The modela - The alignmentt - The treeunobserved - Unobserved data given as another alignmentTreeException - If there is a problem with the treeSiteLikelihood.LikelihoodException - Thrown if a node is initialised to every state having zero probability
(most probably due to the state at the node not being in the model).AlignmentException - Thrown if the tree and site have incompatible taxapublic StandardCalculator(java.util.Map<java.lang.String,Model> m, Alignment a, java.util.Map<java.lang.String,Tree> t) throws AlignmentException, TreeException, SiteLikelihood.LikelihoodException
m - Map from site class to modela - The alignmentt - Map from site class to treeAlignmentException - Thrown if a model isn't given for each site class
in the alignmentTreeException - If there is a problem with the treeSiteLikelihood.LikelihoodException - Thrown if a node is initialised to every state having zero probability
(most probably due to the state at the node not being in the model).public StandardCalculator(java.util.Map<java.lang.String,Model> m, Alignment a, Tree t) throws AlignmentException, TreeException, SiteLikelihood.LikelihoodException
m - Map from site class to modela - The alignmentt - The treeAlignmentException - Thrown if a model isn't given for each site class
in the alignmentTreeException - If there is a problem with the treeSiteLikelihood.LikelihoodException - Thrown if a node is initialised to every state having zero probability
(most probably due to the state at the node not being in the model).public StandardCalculator(java.util.Map<java.lang.String,Model> m, Alignment a, Tree t, Alignment unobserved) throws AlignmentException, TreeException, SiteLikelihood.LikelihoodException
m - The modela - The alignmentt - Map from site class to treeunobserved - Unobserved data given as another alignmentAlignmentException - Thrown if a model isn't given for each site class
in the alignmentTreeException - If there is a problem with the treeSiteLikelihood.LikelihoodException - Thrown if a node is initialised to every state having zero probability
(most probably due to the state at the node not being in the model).public StandardCalculator(Model m, Alignment a, java.util.Map<java.lang.String,Tree> t) throws AlignmentException, TreeException, SiteLikelihood.LikelihoodException
m - The modela - The alignmentt - Map from site class to treeAlignmentException - Thrown if a model isn't given for each site class
in the alignmentTreeException - If there is a problem with the treeSiteLikelihood.LikelihoodException - Thrown if a node is initialised to every state having zero probability
(most probably due to the state at the node not being in the model).public StandardCalculator(Model m, Alignment a, java.util.Map<java.lang.String,Tree> t, Alignment unobserved) throws AlignmentException, TreeException, SiteLikelihood.LikelihoodException
m - The modela - The alignmentt - Map from site class to treeunobserved - Unobserved data given as another alignmentAlignmentException - Thrown if a model isn't given for each site class
in the alignmentTreeException - If there is a problem with the treeSiteLikelihood.LikelihoodException - Thrown if a node is initialised to every state having zero probability
(most probably due to the state at the node not being in the model).public StandardCalculator(java.util.Map<java.lang.String,Model> m, Alignment a, java.util.Map<java.lang.String,Tree> t, Alignment unobserved) throws AlignmentException, TreeException, SiteLikelihood.LikelihoodException
m - Map from site class to modela - The alignmentt - Map from site class to treeunobserved - Unobserved data given as another alignmentAlignmentException - Thrown if a model isn't given
for each site class in the alignmentTreeException - If there is a problem with the treeSiteLikelihood.LikelihoodException - Thrown if a node is initialised to every state having zero probability
(most probably due to the state at the node not being in the model).public StandardLikelihood combineSites(java.util.Map<Site,SiteLikelihood> sites, Parameters p) throws Calculator.CalculatorException
CalculatorcombineSites in class Calculator<StandardLikelihood>sites - A map from sites to the likelihood of those sites.p - The parameters to use in the calculationCalculator.CalculatorException - If an unexpected (i.e. positive
or NaN) log likelihood is calculatedpublic SiteLikelihood calculateSite(Site s, Tree t, Parameters p, Probabilities tp, java.util.Map<java.lang.String,SiteLikelihood.NodeLikelihood> nl)
CalculatorcalculateSite in class Calculator<StandardLikelihood>s - The site to calculate the likelihood fort - The tree to use in calculating the likelihoodp - The parameters to use in calculating the likelihoodtp - Pre-calculated transition probabilities to be used in the
calculation (passed in as they don't need to be calculated separately for
each site). See Probabilities for more informationnl - The starting node-likelihoods are passed here as it is much
quicker to clone them for each calculation than re-create themSiteLikelihood given the likelihood and
any other informationpublic int getAlignmentLength()
CalculatorgetAlignmentLength in class Calculator<StandardLikelihood>