Search in sources :

Example 1 with ParsimonyStateStatistic

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.");
    }
}
Also used : TaxonList(dr.evolution.util.TaxonList) ParsimonyStateStatistic(dr.evomodel.tree.ParsimonyStateStatistic) Tree(dr.evolution.tree.Tree) TreeUtils(dr.evolution.tree.TreeUtils)

Aggregations

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