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);
}
Aggregations