Ancestors
Class AncestralMarginal

java.lang.Object
  extended by Ancestors.AncestralMarginal

public class AncestralMarginal
extends java.lang.Object

Class to perform marginal reconstruction of internal nodes. Uses the principles of Yang, Kurma and Nei 1995.

Version:
1.2

Nested Class Summary
 class AncestralMarginal.Result
          Class to store the results of a marginal ancestral reconstruction
 class AncestralMarginal.SiteResult
          Class to store the results of a marginal ancestral reconstruction for a single site
 
Constructor Summary
AncestralMarginal(java.util.Map<java.lang.String,Model> m, Alignment a, Tree t)
          Creates an object to calculate an ancestral reconstruction for a given set of models, an alignment and a tree.
AncestralMarginal(java.util.Map<java.lang.String,Model> m, Alignment a, Tree t, java.util.Map<java.lang.String,Constrainer> con)
          Creates an object to calculate an ancestral reconstruction for a given set of models, an alignment, a tree and s et of constrainers.
AncestralMarginal(Model m, Alignment a, Tree t)
          Creates an object to calculate an ancestral reconstruction for a given model, alignment and tree
AncestralMarginal(Model m, Alignment a, Tree t, Constrainer con)
          Creates an object to calculate an ancestral reconstruction for a given model, alignment, tree and a constrainter
 
Method Summary
 AncestralMarginal.Result calculate(Parameters params)
          Calculates the reconstruction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AncestralMarginal

public AncestralMarginal(Model m,
                         Alignment a,
                         Tree t)
Creates an object to calculate an ancestral reconstruction for a given model, alignment and tree

Parameters:
m - The model
a - The alignment
t - The tree

AncestralMarginal

public AncestralMarginal(Model m,
                         Alignment a,
                         Tree t,
                         Constrainer con)
Creates an object to calculate an ancestral reconstruction for a given model, alignment, tree and a constrainter

Parameters:
m - The model
a - The alignment
t - The tree
con - The constraints on the internal nodes

AncestralMarginal

public AncestralMarginal(java.util.Map<java.lang.String,Model> m,
                         Alignment a,
                         Tree t)
                  throws AlignmentException
Creates an object to calculate an ancestral reconstruction for a given set of models, an alignment and a tree. There should be one model per site class in the alignment

Parameters:
m - Map from site class to model
a - The alignment
t - The tree
Throws:
AlignmentException - Thrown if a model isn't given for each site class in the alignment

AncestralMarginal

public AncestralMarginal(java.util.Map<java.lang.String,Model> m,
                         Alignment a,
                         Tree t,
                         java.util.Map<java.lang.String,Constrainer> con)
                  throws AlignmentException
Creates an object to calculate an ancestral reconstruction for a given set of models, an alignment, a tree and s et of constrainers. There should be one model and one constrainer per site class in the alignment

Parameters:
m - Map from site class to model
a - The alignment
t - The tree
con - Map from site class to constrainer
Throws:
AlignmentException - Thrown if a model and constrainer isn't given for each site class in the alignment
Method Detail

calculate

public AncestralMarginal.Result calculate(Parameters params)
                                   throws RateCategory.RateException,
                                          Model.ModelException,
                                          TreeException,
                                          Parameters.ParameterException,
                                          AlignmentException
Calculates the reconstruction

Parameters:
params - The parameters to be used in the reconstruction
Returns:
An object containing the reconstruction and the probability of each state at each node for each site
Throws:
RateCategory.RateException - Thrown if there is an issue with a rate category in the model (e.g. a badly formatted rate).
Model.ModelException - Thrown if there is a problem with the model (e.g. the rate categories differ in their states)
TreeException - Thrown if there is a problem with the tree.
Parameters.ParameterException - Thrown if there is a problem with the parameters (e.g. a requied parameter is not present)
AlignmentException - Thrown if there is a problem with the alignment