Search in sources :

Example 1 with BranchRateTransform

use of dr.evomodel.branchratemodel.ArbitraryBranchRates.BranchRateTransform in project beast-mcmc by beast-dev.

the class LocalBranchRatesParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    TreeModel tree = (TreeModel) xo.getChild(TreeModel.class);
    BranchRateTransform transform = (BranchRateTransform) xo.getChild(BranchRateTransform.class);
    if (transform == null) {
        transform = new BranchRateTransform.None();
    }
    Parameter multipllierParameter = (Parameter) xo.getChild(Parameter.class);
    final int numBranches = tree.getNodeCount() - 1;
    if (multipllierParameter.getDimension() != numBranches) {
        multipllierParameter.setDimension(numBranches);
    }
    return new LocalBranchRates(tree, multipllierParameter, transform);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) Parameter(dr.inference.model.Parameter) BranchRateTransform(dr.evomodel.branchratemodel.ArbitraryBranchRates.BranchRateTransform) LocalBranchRates(dr.evomodel.branchratemodel.LocalBranchRates)

Aggregations

BranchRateTransform (dr.evomodel.branchratemodel.ArbitraryBranchRates.BranchRateTransform)1 LocalBranchRates (dr.evomodel.branchratemodel.LocalBranchRates)1 TreeModel (dr.evomodel.tree.TreeModel)1 Parameter (dr.inference.model.Parameter)1