Search in sources :

Example 1 with MonophylyStatistic

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

the class MonophylyStatisticParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    String name = xo.getAttribute(Statistic.NAME, xo.getId());
    Boolean inverse = xo.getAttribute(INVERSE, false);
    Tree tree = (Tree) xo.getChild(Tree.class);
    TaxonList taxa = parseTaxonListOrTaxa(xo.getChild(MRCA));
    TaxonList ignore = null;
    if (xo.hasChildNamed(IGNORE)) {
        ignore = parseTaxonListOrTaxa(xo.getChild(IGNORE));
    }
    try {
        return new MonophylyStatistic(name, tree, taxa, ignore, inverse);
    } 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) MonophylyStatistic(dr.evomodel.tree.MonophylyStatistic) TreeUtils(dr.evolution.tree.TreeUtils)

Aggregations

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