Package pal.eval
Class SimpleLikelihoodCalculator
- java.lang.Object
-
- pal.eval.SimpleLikelihoodCalculator
-
- All Implemented Interfaces:
LikelihoodCalculator
public class SimpleLikelihoodCalculator extends java.lang.Object implements LikelihoodCalculator
-
-
Constructor Summary
Constructors Constructor Description SimpleLikelihoodCalculator(SitePattern pattern)
Need to use setTree(), and setModel() before using compute() if you use this constructorSimpleLikelihoodCalculator(SitePattern pattern, Tree tree, RateMatrix model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
calculateLogLikelihood()
compute log-likelihood for current tree (fixed branch lengths and model) return log-likelihoodprotected Node
getNextBranch(Node branch, Node center)
get next branch around a center node (center may be root, but root is never returned)protected double[][]
getPartial(Node branch)
get partial likelihood of a branchSitePattern
getSitePattern()
Tree
getTree()
void
modelUpdated()
protected void
partialsExternal(Node branch)
compute partials for external branchprotected void
partialsInternal(Node center)
compute partials for branch around center node (it is assumed that multiplied partials are available in the neighbor branch)protected void
productPartials(Node center)
multiply partials into the neighbour of branchvoid
release()
Doesn't do anything...void
setRateMatrix(RateMatrix m)
define model (a site pattern must have been set before calling this method)void
setTree(Tree t)
define tree ,(must only be called only after a site pattern has been defined).void
treeUpdated()
-
-
-
Constructor Detail
-
SimpleLikelihoodCalculator
public SimpleLikelihoodCalculator(SitePattern pattern)
Need to use setTree(), and setModel() before using compute() if you use this constructor
-
SimpleLikelihoodCalculator
public SimpleLikelihoodCalculator(SitePattern pattern, Tree tree, RateMatrix model)
-
-
Method Detail
-
release
public void release()
Doesn't do anything...- Specified by:
release
in interfaceLikelihoodCalculator
-
calculateLogLikelihood
public double calculateLogLikelihood()
compute log-likelihood for current tree (fixed branch lengths and model) return log-likelihood- Specified by:
calculateLogLikelihood
in interfaceLikelihoodCalculator
-
getSitePattern
public SitePattern getSitePattern()
-
getTree
public Tree getTree()
-
setRateMatrix
public void setRateMatrix(RateMatrix m)
define model (a site pattern must have been set before calling this method)- Parameters:
m
- model of substitution (rate matrix + rate distribution)
-
setTree
public void setTree(Tree t)
define tree ,(must only be called only after a site pattern has been defined).- Parameters:
t
- tree
-
modelUpdated
public final void modelUpdated()
-
treeUpdated
public final void treeUpdated()
-
getPartial
protected double[][] getPartial(Node branch)
get partial likelihood of a branch
-
getNextBranch
protected Node getNextBranch(Node branch, Node center)
get next branch around a center node (center may be root, but root is never returned)
-
productPartials
protected void productPartials(Node center)
multiply partials into the neighbour of branch
-
partialsInternal
protected void partialsInternal(Node center)
compute partials for branch around center node (it is assumed that multiplied partials are available in the neighbor branch)
-
partialsExternal
protected void partialsExternal(Node branch)
compute partials for external branch
-
-