Search in sources :

Example 1 with MarkovModulatedGY94CodonModel

use of dr.evomodel.substmodel.codon.MarkovModulatedGY94CodonModel 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);
}
Also used : FrequencyModel(dr.evomodel.substmodel.FrequencyModel) DefaultEigenSystem(dr.evomodel.substmodel.DefaultEigenSystem) HiddenCodons(dr.evolution.datatype.HiddenCodons) DataType(dr.evolution.datatype.DataType) Parameter(dr.inference.model.Parameter) ColtEigenSystem(dr.evomodel.substmodel.ColtEigenSystem) ColtEigenSystem(dr.evomodel.substmodel.ColtEigenSystem) EigenSystem(dr.evomodel.substmodel.EigenSystem) DefaultEigenSystem(dr.evomodel.substmodel.DefaultEigenSystem) MarkovModulatedGY94CodonModel(dr.evomodel.substmodel.codon.MarkovModulatedGY94CodonModel)

Aggregations

DataType (dr.evolution.datatype.DataType)1 HiddenCodons (dr.evolution.datatype.HiddenCodons)1 ColtEigenSystem (dr.evomodel.substmodel.ColtEigenSystem)1 DefaultEigenSystem (dr.evomodel.substmodel.DefaultEigenSystem)1 EigenSystem (dr.evomodel.substmodel.EigenSystem)1 FrequencyModel (dr.evomodel.substmodel.FrequencyModel)1 MarkovModulatedGY94CodonModel (dr.evomodel.substmodel.codon.MarkovModulatedGY94CodonModel)1 Parameter (dr.inference.model.Parameter)1