You are here

General Data Type

BEAST Documentation->Tutorials->General Data Type

Creating your own general data type and substitution model

The easiest way to start is to use BEAUti to create an XML BEAST file, and edit the XML file by adding the general data type following the demonstration below:

Here is the code in the beginning of XML:

<taxa id="taxa">
	<taxon id="human"/>
	<taxon id="chimp"/>
	<taxon id="bonobo"/>
	<taxon id="gorilla"/>
	<taxon id="orangutan"/>
	<taxon id="siamang"/>

<generalDataType id="general">
	<state code="A"/> <!-- A -->
	<state code="C"/> <!-- C -->
	<state code="G"/> <!-- G -->
	<state code="T"/> <!-- T -->
	<ambiguity code="-" states="ACGT"/>
	<ambiguity code="?" states="ACGT"/>

<alignment id="alignment">
	<dataType idref="general"/>
		<taxon idref="human"/>			
                AGAAA-TAT?G  ...
		<taxon idref="chimp"/>
		AGAAA-TAC?  ...
		<taxon idref="bonobo"/>	
		AGAA--TAT??  ...
		<taxon idref="gorilla"/>
		AG?AA-TATAA  ...
		<taxon idref="orangutan"/>
		<taxon idref="siamang"/>

The rest of part is how to refer your general data type:

<frequencyModel id="frequencies">
	<dataType idref="general"/>
	<alignment idref="alignment"/>
		<parameter id="frequencies.freqs" dimension="4"/>

<generalSubstitutionModel id="generalSubst">
		<frequencyModel idref="frequencies"/>
	<rates relativeTo="5">
		<parameter id="rates" dimension="5" value="1.0"/>

<!-- site model -->
<siteModel id="siteModel">
		<generalSubstitutionModel idref="generalSubst"/>
		<parameter id="" value="1.0" lower="0.0"/>

Do not forget to refer it in the tree likelihood as well:

<treeLikelihood id="treeLikelihood">
	<patterns idref="patterns"/>
	<treeModel idref="treeModel"/>
	<siteModel idref="siteModel"/>

Updated on 26/01/2010.

Return to Tutorials