<?xml version="1.0" ?>
<beast>
    <!-- DATA SPECIFICATION -->
    <taxa id="taxa">
        <taxon id="Ar"/>
        <taxon id="Ho"/>
        <taxon id="Ca"/>
        <taxon id="Dr"/>
        <taxon id="An"/>
    </taxa>

    <extendedDataType id="bdDataType">
        <extantState code="1"/>
        <deathState code="0"/>
        <!-- Exon not present -->
        <ambiguity code="U"/>
    </extendedDataType>

    <alignment id="short">
        <dataType idref="bdDataType"/>
        <!-- Dataset from: Current Biology (2003) 13:1512–1517. -->
        <sequence>
            <taxon idref="Dr"/>
            [encoded data, 6713 characters]
        </sequence>
        <sequence>
            <taxon idref="Ar"/>
            [encoded data, 6713 characters]
        </sequence>
        <sequence>
            <taxon idref="Ca"/>
            [encoded data, 6713 characters]
        </sequence>
        <sequence>
            <taxon idref="Ho"/>
            [encoded data, 6713 characters]
        </sequence>
        <sequence>
            <taxon idref="An"/>
            [encoded data, 6713 characters]
        </sequence>
    </alignment>
    <newick id="shortTree">
        (Ar:3,((Dr:1,An:1):1,(Ho:1,Ca:1):1):1);
    </newick>

    <ascertainedPatterns from="1" id="shortPatterns">
        <alignment idref="short"/>
        <!-- <excludePatterns from="1" to="2"/> -->
    </ascertainedPatterns>

    <mutationDeathModel id="intronModel">
        <parameter id="intron.death" lower="0.0" value="1.0"/>
        <dataType idref="bdDataType"/>
    </mutationDeathModel>

    <treeModel id="treeModel">
        <tree idref="shortTree"/>
        <rootHeight>
            <parameter id="treeModel.rootHeight"/>
        </rootHeight>
        <nodeHeights internalNodes="true" rootNode="false">
            <parameter id="treeModel.internalNodeHeights"/>
        </nodeHeights>
        <nodeHeights internalNodes="true" rootNode="true">
            <parameter id="treeModel.allInternalNodeHeights"/>
        </nodeHeights>
    </treeModel>

    <alsSiteModel id="siteModel">
        <substitutionModel>
            <mutationDeathModel idref="intronModel"/>
        </substitutionModel>
        <mutationRate>
            <parameter id="overallRate" lower="0.0" value="1.0"/>
        </mutationRate>
    </alsSiteModel>

    <alsTreeLikelihood id="bdLikelihood" useScaling="false" useAmbiguities="true" integrateGainRate="true">
        <patterns idref="shortPatterns"/>
        <treeModel idref="treeModel"/>
        <alsSiteModel idref="siteModel"/>
        <observationProcess type="anyTip"/>
        <!-- <observationProcess type="singleTip" taxon="Ho"/>   -->
    </alsTreeLikelihood>

    <exponentialBranchLengthsPrior id="treePrior">
        <treeModel idref="treeModel"/>
    </exponentialBranchLengthsPrior>

    <gammaPrior id="deathRatePrior" scale="1" shape="0.0001" offset="0">
        <parameter idref="intron.death"/>
    </gammaPrior>

    <operators id="operators">
        <!--      <scaleOperator scaleFactor="0.9110" weight="1">
    <parameter idref="intron.death"/>
      </scaleOperator>
      <scaleOperator scaleFactor="0.9303" weight="1">
    <parameter idref="intron.birth"/>
      </scaleOperator>  -->
        <scaleOperator scaleFactor="0.8554" weight="4" autoOptimize="true" scaleAll="false">
            <parameter idref="treeModel.allInternalNodeHeights"/>
        </scaleOperator>
    </operators>

    <mcmc id="mcmc" chainLength="1000000" autoOptimize="true">
        <posterior id="posterior">
            <likelihood id="likelihood">
                <alsTreeLikelihood idref="bdLikelihood"/>
            </likelihood>
            <prior id="prior">
                <likelihood idref="deathRatePrior"/>
                <likelihood idref="treePrior"/>
            </prior>
        </posterior>
        <operators idref="operators"/>
        <log logEvery="10">
            <!--	<column label="Lam" sf="6" width="8">
         <parameter idref="intron.birth"/>
       </column>
       <column label="Del" sf="12" width="12">
         <parameter idref="intron.death"/>
       </column> -->
            <column label="Heights" sf="12" width="12">
                <compoundParameter idref="treeModel.allInternalNodeHeights"/>
            </column>
            <column dp="4" label="Likelihood" width="12">
                <likelihood idref="likelihood"/>
            </column>
            <column dp="4" label="Prior" width="12">
                <likelihood idref="prior"/>
            </column>
            <column label="Posterior" dp="4" width="12">
                <likelihood idref="posterior"/>
            </column>
        </log>
        <log id="fileLog" logEvery="100" fileName="IntronSample.log">
            <!--	<parameter idref="intron.birth" />
       <parameter idref="intron.death"/> -->
            <compoundParameter idref="treeModel.allInternalNodeHeights"/>
            <likelihood idref="likelihood"/>
            <likelihood idref="prior"/>
            <likelihood idref="posterior"/>
        </log>
    </mcmc>

</beast>