Search in sources :

Example 1 with ParsimonyStatistic

use of dr.evomodel.tree.ParsimonyStatistic in project beast-mcmc by beast-dev.

the class ParsimonyStatisticParser 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 taxa = (TaxonList) cxo.getChild(TaxonList.class);
    try {
        return new ParsimonyStatistic(name, tree, taxa);
    } catch (TreeUtils.MissingTaxonException mte) {
        throw new XMLParseException("Taxon, " + mte + ", in " + getParserName() + "was not found in the tree.");
    }
}
Also used : TaxonList(dr.evolution.util.TaxonList) Tree(dr.evolution.tree.Tree) ParsimonyStatistic(dr.evomodel.tree.ParsimonyStatistic) TreeUtils(dr.evolution.tree.TreeUtils)

Aggregations

Tree (dr.evolution.tree.Tree)1 TreeUtils (dr.evolution.tree.TreeUtils)1 TaxonList (dr.evolution.util.TaxonList)1 ParsimonyStatistic (dr.evomodel.tree.ParsimonyStatistic)1