Search in sources :

Example 6 with AncestralStateBeagleTreeLikelihood

use of dr.evomodel.treelikelihood.AncestralStateBeagleTreeLikelihood in project beast-mcmc by beast-dev.

the class AncestralStateTreeLikelihoodParser method createTreeLikelihood.

protected BeagleTreeLikelihood createTreeLikelihood(// 
PatternList patternList, // 
MutableTreeModel treeModel, // 
BranchModel branchModel, // 
GammaSiteRateModel siteRateModel, // 
BranchRateModel branchRateModel, // 
TipStatesModel tipStatesModel, // 
boolean useAmbiguities, // 
PartialsRescalingScheme scalingScheme, boolean delayScaling, Map<// 
Set<String>, Parameter> partialsRestrictions, // 
XMLObject xo) throws XMLParseException {
    // System.err.println("XML object: " + xo.toString());
    DataType dataType = branchModel.getRootSubstitutionModel().getDataType();
    // default tag is RECONSTRUCTION_TAG
    String tag = xo.getAttribute(RECONSTRUCTION_TAG_NAME, RECONSTRUCTION_TAG);
    boolean useMAP = xo.getAttribute(MAP_RECONSTRUCTION, false);
    boolean useMarginalLogLikelihood = xo.getAttribute(MARGINAL_LIKELIHOOD, true);
    boolean conditionalProbabilitiesInLogSpace = xo.getAttribute(CONDITIONAL_PROBABILITIES_IN_LOG_SPACE, false);
    if (patternList.areUnique()) {
        throw new XMLParseException("Ancestral state reconstruction cannot be used with compressed (unique) patterns.");
    }
    return new // Current just returns a OldBeagleTreeLikelihood
    AncestralStateBeagleTreeLikelihood(patternList, treeModel, branchModel, siteRateModel, branchRateModel, tipStatesModel, useAmbiguities, scalingScheme, delayScaling, partialsRestrictions, dataType, tag, useMAP, useMarginalLogLikelihood, conditionalProbabilitiesInLogSpace);
}
Also used : DataType(dr.evolution.datatype.DataType) AncestralStateBeagleTreeLikelihood(dr.evomodel.treelikelihood.AncestralStateBeagleTreeLikelihood)

Aggregations

AncestralStateBeagleTreeLikelihood (dr.evomodel.treelikelihood.AncestralStateBeagleTreeLikelihood)6 TreeModel (dr.evomodel.tree.TreeModel)3 DataType (dr.evolution.datatype.DataType)2 HomogeneousBranchModel (dr.evomodel.branchmodel.HomogeneousBranchModel)2 BranchRateModel (dr.evomodel.branchratemodel.BranchRateModel)2 DefaultTreeModel (dr.evomodel.tree.DefaultTreeModel)2 SimpleAlignment (dr.evolution.alignment.SimpleAlignment)1 Codons (dr.evolution.datatype.Codons)1 Sequence (dr.evolution.sequence.Sequence)1 Taxa (dr.evolution.util.Taxa)1 Taxon (dr.evolution.util.Taxon)1 BranchModel (dr.evomodel.branchmodel.BranchModel)1 TipStateSwapOperator (dr.evomodel.operators.TipStateSwapOperator)1 GammaSiteRateModel (dr.evomodel.siteratemodel.GammaSiteRateModel)1 CodonLabeling (dr.evomodel.substmodel.CodonLabeling)1 CodonPartitionedRobustCounting (dr.evomodel.substmodel.CodonPartitionedRobustCounting)1 FrequencyModel (dr.evomodel.substmodel.FrequencyModel)1 StratifiedTraitOutputFormat (dr.evomodel.substmodel.StratifiedTraitOutputFormat)1 HKY (dr.evomodel.substmodel.nucleotide.HKY)1 Parameter (dr.inference.model.Parameter)1