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);
}
Aggregations