Search in sources :

Example 1 with DiscretizedLociRates

use of dr.oldevomodel.sitemodel.DiscretizedLociRates in project beast-mcmc by beast-dev.

the class DiscretizedLociRatesParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    final boolean normalize = xo.getAttribute(NORMALIZE, false);
    final double normalizeBranchRateTo = xo.getAttribute(NORMALIZE_MEAN_LOCI_RATE_TO, Double.NaN);
    final int categoryCount = xo.getIntegerAttribute(CATEGORY_COUNT);
    CompoundParameter lociRates = (CompoundParameter) xo.getElementFirstChild(LOCI_RATES);
    Parameter rateCategoryParameter = (Parameter) xo.getElementFirstChild(RATE_CATEGORIES);
    ParametricDistributionModel distributionModel = (ParametricDistributionModel) xo.getElementFirstChild(DISTRIBUTION);
    Logger.getLogger("dr.evomodel").info("Using discretized loci rates model.");
    Logger.getLogger("dr.evomodel").info("Number of categories: " + categoryCount);
    Logger.getLogger("dr.evomodel").info("  parametric model = " + distributionModel.getModelName());
    if (normalize) {
        Logger.getLogger("dr.evomodel").info("   mean rate is normalized to " + normalizeBranchRateTo);
    }
    return new DiscretizedLociRates(lociRates, rateCategoryParameter, distributionModel, normalize, normalizeBranchRateTo, categoryCount);
}
Also used : CompoundParameter(dr.inference.model.CompoundParameter) ParametricDistributionModel(dr.inference.distribution.ParametricDistributionModel) DiscretizedLociRates(dr.oldevomodel.sitemodel.DiscretizedLociRates) CompoundParameter(dr.inference.model.CompoundParameter) Parameter(dr.inference.model.Parameter)

Aggregations

ParametricDistributionModel (dr.inference.distribution.ParametricDistributionModel)1 CompoundParameter (dr.inference.model.CompoundParameter)1 Parameter (dr.inference.model.Parameter)1 DiscretizedLociRates (dr.oldevomodel.sitemodel.DiscretizedLociRates)1