Search in sources :

Example 1 with LinkageConstraints

use of dr.evolution.LinkageConstraints in project beast-mcmc by beast-dev.

the class LinkageConstraintsParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    ArrayList<LinkedGroup> groups = new ArrayList<LinkedGroup>();
    for (int i = 0; i < xo.getChildCount(); i++) {
        Object child = xo.getChild(i);
        if (child instanceof LinkedGroup) {
            groups.add((LinkedGroup) child);
        }
    }
    LinkageConstraints lc = new LinkageConstraints(groups);
    return lc;
}
Also used : LinkedGroup(dr.evolution.LinkedGroup) ArrayList(java.util.ArrayList) LinkageConstraints(dr.evolution.LinkageConstraints)

Example 2 with LinkageConstraints

use of dr.evolution.LinkageConstraints in project beast-mcmc by beast-dev.

the class MetagenomeDataParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    TaxonList taxa = null;
    taxa = (TaxonList) xo.getChild(TaxonList.class);
    if (taxa == null)
        taxa = (Tree) xo.getChild(Tree.class);
    Alignment alignment = (Alignment) xo.getChild(Alignment.class);
    LinkageConstraints lc = (LinkageConstraints) xo.getChild(LinkageConstraints.class);
    boolean fixedReferenceTree = false;
    if (xo.hasAttribute("fixedReferenceTree")) {
        fixedReferenceTree = xo.getBooleanAttribute("fixedReferenceTree");
    }
    MetagenomeData md = new MetagenomeData(taxa, alignment, lc, fixedReferenceTree);
    return md;
}
Also used : Alignment(dr.evolution.alignment.Alignment) TaxonList(dr.evolution.util.TaxonList) Tree(dr.evolution.tree.Tree) MetagenomeData(dr.evolution.MetagenomeData) LinkageConstraints(dr.evolution.LinkageConstraints)

Aggregations

LinkageConstraints (dr.evolution.LinkageConstraints)2 LinkedGroup (dr.evolution.LinkedGroup)1 MetagenomeData (dr.evolution.MetagenomeData)1 Alignment (dr.evolution.alignment.Alignment)1 Tree (dr.evolution.tree.Tree)1 TaxonList (dr.evolution.util.TaxonList)1 ArrayList (java.util.ArrayList)1