Search in sources :

Example 1 with ContinuousTraitPartialsProvider

use of dr.evomodel.treedatalikelihood.continuous.ContinuousTraitPartialsProvider in project beast-mcmc by beast-dev.

the class TraitValidationProviderParser method parseTraitValidationProvider.

public static TraitValidationProvider parseTraitValidationProvider(XMLObject xo) throws XMLParseException {
    String trueValuesName = xo.getStringAttribute(TreeTraitParserUtilities.TRAIT_NAME);
    String inferredValuesName = xo.getStringAttribute(INFERRED_NAME);
    TreeDataLikelihood treeLikelihood = (TreeDataLikelihood) xo.getChild(TreeDataLikelihood.class);
    ContinuousDataLikelihoodDelegate delegate = (ContinuousDataLikelihoodDelegate) treeLikelihood.getDataLikelihoodDelegate();
    ContinuousTraitPartialsProvider dataModel = delegate.getDataModel();
    Tree treeModel = treeLikelihood.getTree();
    TreeTraitParserUtilities utilities = new TreeTraitParserUtilities();
    TreeTraitParserUtilities.TraitsAndMissingIndices returnValue = utilities.parseTraitsFromTaxonAttributes(xo, trueValuesName, treeModel, true);
    Parameter trueParameter = returnValue.traitParameter;
    List<Integer> trueMissing = returnValue.missingIndices;
    Parameter missingParameter = null;
    if (xo.hasChildNamed(MASK)) {
        missingParameter = (Parameter) xo.getElementFirstChild(MASK);
    }
    String id = xo.getId();
    TraitValidationProvider provider = new TraitValidationProvider(trueParameter, dataModel, treeModel, id, missingParameter, treeLikelihood, inferredValuesName, trueMissing);
    return provider;
}
Also used : TreeDataLikelihood(dr.evomodel.treedatalikelihood.TreeDataLikelihood) Tree(dr.evolution.tree.Tree) TreeTraitParserUtilities(dr.evomodelxml.treelikelihood.TreeTraitParserUtilities) Parameter(dr.inference.model.Parameter) ContinuousDataLikelihoodDelegate(dr.evomodel.treedatalikelihood.continuous.ContinuousDataLikelihoodDelegate) ContinuousTraitPartialsProvider(dr.evomodel.treedatalikelihood.continuous.ContinuousTraitPartialsProvider) TraitValidationProvider(dr.inference.model.TraitValidationProvider)

Aggregations

Tree (dr.evolution.tree.Tree)1 TreeDataLikelihood (dr.evomodel.treedatalikelihood.TreeDataLikelihood)1 ContinuousDataLikelihoodDelegate (dr.evomodel.treedatalikelihood.continuous.ContinuousDataLikelihoodDelegate)1 ContinuousTraitPartialsProvider (dr.evomodel.treedatalikelihood.continuous.ContinuousTraitPartialsProvider)1 TreeTraitParserUtilities (dr.evomodelxml.treelikelihood.TreeTraitParserUtilities)1 Parameter (dr.inference.model.Parameter)1 TraitValidationProvider (dr.inference.model.TraitValidationProvider)1