use of dr.evomodel.tree.ParsimonyStateStatistic in project beast-mcmc by beast-dev.
the class ParsimonyStateStatisticParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
String name = xo.getAttribute(Statistic.NAME, xo.getId());
Tree tree = (Tree) xo.getChild(Tree.class);
XMLObject cxo = xo.getChild(STATE);
TaxonList stateTaxa = (TaxonList) cxo.getChild(TaxonList.class);
cxo = xo.getChild(MRCA);
TaxonList mrcaTaxa = (TaxonList) cxo.getChild(TaxonList.class);
try {
return new ParsimonyStateStatistic(name, tree, stateTaxa, mrcaTaxa);
} catch (TreeUtils.MissingTaxonException mte) {
throw new XMLParseException("Taxon, " + mte + ", in " + getParserName() + "was not found in the tree.");
}
}
Aggregations