You are here

Nucleotide Substitution Models

BEAST Documentation->Tutorials->Nucleotide Substitution Models


Using a nucleotide substitution model other than HKY and GTR

To create a model that is nested within GTR simply set up the parameters in the GTR model to be shared appropriately. In the case of the Tamura-Nei model (TrN; 1993) all transversions have the same rate and a both transitions have different rates. This can be achieved by the following modification to the standard GTR XML:

<gtrModel id="gtr">
        <frequencies>
            <frequencyModel dataType="nucleotide">
                <alignment idref="alignment"/>
                <frequencies>
                    <parameter id="gtr.frequencies" dimension="4"/>
                </frequencies>
            </frequencyModel>
        </frequencies>
        <rateAC>
            <parameter id="trn.transversion" value="1.0" lower="0.0"/>
        </rateAC>
        <rateAG>
            <parameter id="trn.ag" value="1.0" lower="0.0"/>
        </rateAG>
        <rateAT>
            <parameter idref="trn.transversion"/>
        </rateAT>
        <rateCG>
            <parameter idref="trn.transversion"/>
        </rateCG>
        <rateGT>
            <parameter idref="trn.transversion"/>
        </rateGT>
</gtrModel>

Notice that the trn.transversion parameter is created once in the rateAC socket and then used subsequently in rateAT, rateCG and rateGT sockets. This ensures that all transversions occur at the same rate of the trn.transversion rate parameter. The transition rateAG is given its own parameter trn.ag. The transition rateCT has a rate of 1.0 - so all other rates are relative to the rate of CT=1.0. It should also be noted that the operator schedule and logs need to be modified. The following scale operaters must be added to the operators element (and the gtr. scaleOperators must be removed).

	<scaleOperator scaleFactor="0.5" weight="1">
		<parameter idref="trn.transversion"/>
	</scaleOperator>
	<scaleOperator scaleFactor="0.5" weight="1">
		<parameter idref="trn.ag"/>
	</scaleOperator>

Likewise the log should have these lines removed:

	<parameter idref="gtr.ac"/>
	<parameter idref="gtr.ag"/>
	<parameter idref="gtr.at"/>
	<parameter idref="gtr.cg"/>
	<parameter idref="gtr.gt"/>

and replaced with these:

	<parameter idref="trn.transversion"/>
	<parameter idref="trn.ag"/>

 

 


Return to Tutorials