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