use of dr.evomodel.substmodel.EigenSystem in project beast-mcmc by beast-dev.
the class MarkovModulatedGY94CodonModelParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
DataType dataType = DataTypeUtils.getDataType(xo);
HiddenCodons codons;
if (dataType instanceof HiddenCodons)
codons = (HiddenCodons) dataType;
else
throw new XMLParseException("Must construct " + MARKOV_MODULATED_YANG_MODEL + " with hidden codons");
Parameter omegaParam = (Parameter) xo.getElementFirstChild(OMEGA);
Parameter kappaParam = (Parameter) xo.getElementFirstChild(KAPPA);
Parameter switchingParam = (Parameter) xo.getElementFirstChild(SWITCHING_RATES);
FrequencyModel freqModel = (FrequencyModel) xo.getChild(FrequencyModel.class);
EigenSystem eigenSystem;
if (xo.getAttribute(DIAGONALIZATION, "default").compareToIgnoreCase("colt") == 0)
eigenSystem = new ColtEigenSystem(dataType.getStateCount());
else
eigenSystem = new DefaultEigenSystem(dataType.getStateCount());
return new MarkovModulatedGY94CodonModel(codons, switchingParam, omegaParam, kappaParam, freqModel, eigenSystem);
}
Aggregations