Hello all,
I was trying to implement the Mk model of Lewis (2001). It is a standard model of discrete character substitution where equilibrium frequencies and rates of substitution are equal for all states; much like the Binary model already implemented for data that is either 0 or 1, but for multistate characters.
My strategy for doing so in the BEAST 1.8 XML was to manually partition the data between sites with different number of character states, and assign the appropriate Mk model for each partition. As such:
<generalDataType id="twoState">
<state code="0"/>
<state code="1"/>
<ambiguity code="?" states="01"/>
<ambiguity code="-" states="01"/>
</generalDataType>
<generalDataType id="threeState">
<state code="0"/>
<state code="1"/>
<state code="2"/>
<ambiguity code="?" states="012"/>
<ambiguity code="-" states="012"/>
</generalDataType>
<generalDataType id="fourState">
<state code="0"/>
<state code="1"/>
<state code="2"/>
<state code="3"/>
<ambiguity code="?" states="0123"/>
<ambiguity code="-" states="0123"/>
</generalDataType>
... and so on, up to ten different states. Then:
<generalSubstitutionModel id="twostatesubstmodel" dataType="twoState" name="GSM.twoState">
<frequencies>
<frequencyModel>
<dataType idref="twoState"/>
<frequencies>
<parameter id="twostate.frequencies" value="0.5 0.5"/>
</frequencies>
</frequencyModel>
</frequencies>
<rates relativeTo="1"/>
</generalSubstitutionModel>
<generalSubstitutionModel dataType="threeState" name="GSM.threeState">
<frequencies>
<frequencyModel>
<dataType idref="threeState"/>
<frequencies>
<parameter id="threestate.frequencies" value="0.33 0.33 0.34"/>
</frequencies>
</frequencyModel>
</frequencies>
<rates relativeTo="1"/>
</generalSubstitutionModel>
<generalSubstitutionModel dataType="fourState" name="GSM.fourState">
<frequencies>
<frequencyModel>
<dataType idref="fourState"/>
<frequencies>
<parameter id="fourstate.frequencies" value="0.25 0.25 0.25 0.25"/>
</frequencies>
</frequencyModel>
</frequencies>
<rates relativeTo="1"/>
</generalSubstitutionModel>
However, when I try to run the XML with only the model definitions as above, I get this error:
The '<generalSubstitutionModel>' element with id, 'twostatesubstmodel', is incorrectly constructed.
The following was expected:
Exactly one ELEMENT of name rates REQUIRED containing
Exactly one ELEMENT of type Parameter REQUIRED
But I haven't found any information on what is this parameter element and how to construct it in the context of generalSubstitutionModel.
Would this implementation be possible on BEAST 2?
Thank you in advance.
Best regards,
Ian