ArtPoon / BelleJS

Generate BEAST XML analysis files using a BEAUTI-like JavaScript interface
MIT License
2 stars 0 forks source link

Empirical base frequencies #5

Closed ArtPoon closed 3 years ago

ArtPoon commented 3 years ago

If we estimate base frequencies:

                <frequencies>
                        <frequencyModel dataType="nucleotide">
                                <frequencies>
                                        <parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
                                </frequencies>
                        </frequencyModel>
                </frequencies>

If we set frequencies to empirical:

                <frequencies>
                        <frequencyModel dataType="nucleotide">
                                <alignment idref="alignment"/>
                                <frequencies>
                                        <parameter id="frequencies" dimension="4"/>
                                </frequencies>
                        </frequencyModel>
                </frequencies>
ArtPoon commented 3 years ago

If frequences are set to "All equal":

                <frequencies>
                        <frequencyModel dataType="nucleotide">
                                <frequencies>
                                        <parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
                                </frequencies>
                        </frequencyModel>
                </frequencies>
ArtPoon commented 3 years ago
art@Wernstrom examples % diff -c estimated.xml all-equal.xml 
*** estimated.xml   2021-03-30 12:20:39.000000000 -0400
--- all-equal.xml   2021-03-30 12:21:24.000000000 -0400
***************
*** 488,496 ****
        <scaleOperator scaleFactor="0.75" weight="1">
            <parameter idref="kappa"/>
        </scaleOperator>
-       <deltaExchange delta="0.01" weight="1">
-           <parameter idref="frequencies"/>
-       </deltaExchange>
        <scaleOperator scaleFactor="0.75" scaleAll="true" ignoreBounds="true" weight="3">
            <parameter idref="treeModel.allInternalNodeHeights"/>
        </scaleOperator>
--- 488,493 ----
***************
*** 525,533 ****
                <logNormalPrior mu="1.0" sigma="1.25" offset="0.0">
                    <parameter idref="kappa"/>
                </logNormalPrior>
-               <dirichletPrior alpha="1.0" sumsTo="1.0">
-                   <parameter idref="frequencies"/>
-               </dirichletPrior>
                <oneOnXPrior>
                    <parameter idref="constant.popSize"/>
                </oneOnXPrior>
--- 522,527 ----
***************
*** 567,573 ****
            <treeLengthStatistic idref="treeLength"/>
            <parameter idref="constant.popSize"/>
            <parameter idref="kappa"/>
-           <parameter idref="frequencies"/>
            <parameter idref="clock.rate"/>
            <rateStatistic idref="meanRate"/>
            <treeDataLikelihood idref="treeLikelihood"/>
--- 561,566 ----
ArtPoon commented 3 years ago
art@Wernstrom examples % diff -c estimated.xml empirical.xml 
*** estimated.xml   2021-03-30 12:20:39.000000000 -0400
--- empirical.xml   2021-03-30 12:25:59.000000000 -0400
***************
*** 449,456 ****
    <HKYModel id="hky">
        <frequencies>
            <frequencyModel dataType="nucleotide">
                <frequencies>
!                   <parameter id="frequencies" value="0.25 0.25 0.25 0.25"/>
                </frequencies>
            </frequencyModel>
        </frequencies>
--- 449,457 ----
    <HKYModel id="hky">
        <frequencies>
            <frequencyModel dataType="nucleotide">
+               <alignment idref="alignment"/>
                <frequencies>
!                   <parameter id="frequencies" dimension="4"/>
                </frequencies>
            </frequencyModel>
        </frequencies>
***************
*** 488,496 ****
        <scaleOperator scaleFactor="0.75" weight="1">
            <parameter idref="kappa"/>
        </scaleOperator>
-       <deltaExchange delta="0.01" weight="1">
-           <parameter idref="frequencies"/>
-       </deltaExchange>
        <scaleOperator scaleFactor="0.75" scaleAll="true" ignoreBounds="true" weight="3">
            <parameter idref="treeModel.allInternalNodeHeights"/>
        </scaleOperator>
--- 489,494 ----
***************
*** 525,533 ****
                <logNormalPrior mu="1.0" sigma="1.25" offset="0.0">
                    <parameter idref="kappa"/>
                </logNormalPrior>
-               <dirichletPrior alpha="1.0" sumsTo="1.0">
-                   <parameter idref="frequencies"/>
-               </dirichletPrior>
                <oneOnXPrior>
                    <parameter idref="constant.popSize"/>
                </oneOnXPrior>
--- 523,528 ----
***************
*** 567,573 ****
            <treeLengthStatistic idref="treeLength"/>
            <parameter idref="constant.popSize"/>
            <parameter idref="kappa"/>
-           <parameter idref="frequencies"/>
            <parameter idref="clock.rate"/>
            <rateStatistic idref="meanRate"/>
            <treeDataLikelihood idref="treeLikelihood"/>
--- 562,567 ----
ArtPoon commented 3 years ago

Changes in operators, priors and file log (last 3 differences) should already be handled