Search in sources :

Example 1 with MRCATraitStatistic

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

the class MRCATraitStatisticParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    String name = xo.getAttribute(NAME, xo.getId());
    String trait = xo.getStringAttribute(TRAIT);
    DefaultTreeModel tree = (DefaultTreeModel) xo.getChild(DefaultTreeModel.class);
    TaxonList taxa = (TaxonList) xo.getElementFirstChild(MRCA);
    try {
        return new MRCATraitStatistic(name, trait, tree, taxa);
    } catch (TreeUtils.MissingTaxonException mte) {
        throw new XMLParseException("Taxon, " + mte + ", in " + getParserName() + "was not found in the tree.");
    }
}
Also used : MRCATraitStatistic(dr.evomodel.tree.MRCATraitStatistic) TaxonList(dr.evolution.util.TaxonList) DefaultTreeModel(dr.evomodel.tree.DefaultTreeModel) TreeUtils(dr.evolution.tree.TreeUtils)

Aggregations

TreeUtils (dr.evolution.tree.TreeUtils)1 TaxonList (dr.evolution.util.TaxonList)1 DefaultTreeModel (dr.evomodel.tree.DefaultTreeModel)1 MRCATraitStatistic (dr.evomodel.tree.MRCATraitStatistic)1