Search in sources :

Example 6 with TipStatesModel

use of dr.evomodel.tipstatesmodel.TipStatesModel in project beast-mcmc by beast-dev.

the class TreeLikelihoodParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    boolean useAmbiguities = xo.getAttribute(USE_AMBIGUITIES, false);
    boolean allowMissingTaxa = xo.getAttribute(ALLOW_MISSING_TAXA, false);
    boolean storePartials = xo.getAttribute(STORE_PARTIALS, true);
    boolean forceJavaCore = xo.getAttribute(FORCE_JAVA_CORE, false);
    if (Boolean.valueOf(System.getProperty("java.only"))) {
        forceJavaCore = true;
    }
    PatternList patternList = (PatternList) xo.getChild(PatternList.class);
    TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
    SiteModel siteModel = (SiteModel) xo.getChild(SiteModel.class);
    BranchRateModel branchRateModel = (BranchRateModel) xo.getChild(BranchRateModel.class);
    TipStatesModel tipStatesModel = (TipStatesModel) xo.getChild(TipStatesModel.class);
    if (tipStatesModel != null && tipStatesModel.getPatternList() != null) {
        throw new XMLParseException("The same sequence error model cannot be used for multiple partitions");
    }
    if (tipStatesModel != null && tipStatesModel.getModelType() == TipStatesModel.Type.STATES) {
        throw new XMLParseException("The state emitting TipStateModel requires BEAGLE");
    }
    boolean forceRescaling = xo.getAttribute(FORCE_RESCALING, false);
    return new TreeLikelihood(patternList, treeModel, siteModel, branchRateModel, tipStatesModel, useAmbiguities, allowMissingTaxa, storePartials, forceJavaCore, forceRescaling);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) BranchRateModel(dr.evomodel.branchratemodel.BranchRateModel) PatternList(dr.evolution.alignment.PatternList) TreeLikelihood(dr.oldevomodel.treelikelihood.TreeLikelihood) SiteModel(dr.oldevomodel.sitemodel.SiteModel) TipStatesModel(dr.evomodel.tipstatesmodel.TipStatesModel)

Aggregations

TipStatesModel (dr.evomodel.tipstatesmodel.TipStatesModel)6 PatternList (dr.evolution.alignment.PatternList)5 BranchRateModel (dr.evomodel.branchratemodel.BranchRateModel)5 BranchModel (dr.evomodel.branchmodel.BranchModel)4 HomogeneousBranchModel (dr.evomodel.branchmodel.HomogeneousBranchModel)4 GammaSiteRateModel (dr.evomodel.siteratemodel.GammaSiteRateModel)4 FrequencyModel (dr.evomodel.substmodel.FrequencyModel)4 SubstitutionModel (dr.evomodel.substmodel.SubstitutionModel)4 PartialsRescalingScheme (dr.evomodel.treelikelihood.PartialsRescalingScheme)4 ArrayList (java.util.ArrayList)4 Patterns (dr.evolution.alignment.Patterns)3 TreeModel (dr.evomodel.tree.TreeModel)3 CompoundLikelihood (dr.inference.model.CompoundLikelihood)3 Likelihood (dr.inference.model.Likelihood)3 Parameter (dr.inference.model.Parameter)3 SitePatterns (dr.evolution.alignment.SitePatterns)2 TreeUtils (dr.evolution.tree.TreeUtils)2 TaxonList (dr.evolution.util.TaxonList)2 SiteRateModel (dr.evomodel.siteratemodel.SiteRateModel)2 AbstractTreeLikelihood (dr.evomodel.treelikelihood.AbstractTreeLikelihood)2