Skip to content
Merged

B3xml #103

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beast-base/src/assembly/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<outputDirectory>examples</outputDirectory>
<includes>
<include>*.xml</include>
<include>spec/*.xml</include>
<include>fasta/**</include>
<include>nexus/**</include>
</includes>
</fileSet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public TestFramework() {
}

public static File readTestXML(String xmlName) throws URISyntaxException {
String fullPath = "/beast.base/examples/spec/beast2vs1/" + xmlName;
String fullPath = "/beast.base/examples/beast2vs1/" + xmlName;
var url = TestFramework.class.getResource(fullPath);
if (url == null)
throw new IllegalArgumentException("Test XML not found on classpath: " + fullPath);
Expand Down
4 changes: 3 additions & 1 deletion beast-base/src/test/resources/beast.base/examples/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# XML examples

The converted XML examples for BEAST3 are available under beast-base/src/test/resources/beast.base/examples/spec/
The BEAST3 XML examples for release are directly under `beast-base/src/test/resources/beast.base/examples/` (i.e., `examples/*.xml`).

Long-run beast2-vs-1 comparison XMLs are under `examples/beast2vs1/` (not for release).

All BEAST2 XMLs are hosted under `examples/legacy/` (not for release).
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<beast version='2.0'
namespace='beast.pkgmgmt:beast.base.core:beast.base.inference:beast.base.evolution.tree.coalescent:beast.pkgmgmt:beast.base.core:beast.base.inference.util:beast.evolution.nuc:beast.base.evolution.operator:beast.base.inference.operator:beast.base.evolution.sitemodel:beast.base.evolution.substitutionmodel:beast.base.evolution.likelihood'>
namespace='beast.pkgmgmt:beast.base.core:beast.base.inference:
beast.base.evolution.tree.coalescent:beast.evolution.nuc:beast.base.evolution.alignment:
beast.base.evolution.operator:beast.base.spec.inference.operator:
beast.base.spec.evolution.sitemodel:beast.base.spec.evolution.substitutionmodel:
beast.base.spec.inference.parameter:beast.base.spec.inference.util:
beast.base.spec.inference.distribution:beast.base.spec.evolution.likelihood'>

<!-- 17 taxa, 1485 sites, 138 patterns -->
<data dataType="nucleotide" id="alignment">
Expand Down Expand Up @@ -74,7 +79,7 @@
</sequence>
</data>

<tree spec='beast.base.evolution.tree.ClusterTree' id='tree' clusterType='upgma'>
<tree spec='beast.base.spec.evolution.tree.ClusterTree' id='tree' clusterType='upgma'>
<trait spec='beast.base.evolution.tree.TraitSet' traitname='date-forward' units='year'
value='
D4Brazi82 = 1982,
Expand All @@ -101,71 +106,68 @@

<distribution spec="CompoundDistribution" id="posterior">
<distribution spec="CompoundDistribution" id="prior">
<!--
<distribution id="hky.kappa.prior" spec="beast.base.inference.distribution.Prior" x="@hky.kappa">
<distr id="LogNormalDistributionModel" M="1.0" S="1.25" meanInRealSpace="false"
spec="beast.base.inference.distribution.LogNormalDistributionModel"/>
</distribution>
<distribution id="hky.frequencies.prior" spec="beast.base.inference.distribution.Prior" x="@hky.frequencies">
<distr id="Uniform" lower="0.0" upper="1.0" spec="beast.base.inference.distribution.Uniform"/>
</distribution>
-->

<distribution spec="BayesianSkyline" id='skyline'>
<distribution spec="beast.base.spec.evolution.tree.coalescent.BayesianSkyline" id='skyline'>
<popSizes idref="skyline.popSize"/>
<groupSizes idref='skyline.groupSize'/>
<treeIntervals spec='beast.base.evolution.tree.TreeIntervals' id='TreeIntervals'>
<tree idref="tree"/>
</treeIntervals>
</distribution>

<distribution id='eml1' spec="beast.base.inference.distribution.MarkovChainDistribution"
jeffreys="true"
parameter="@skyline.popSize"/>

<distribution id='eml1' spec="beast.base.spec.inference.distribution.MarkovChainDistribution"
jeffreys="true" param="@skyline.popSize"/>
</distribution>

<distribution spec='TreeLikelihood' id="likelihood">
<data idref="alignment"/>
<tree idref="tree"/>
<siteModel spec='SiteModel' id="siteModel" gammaCategoryCount="4">
<parameter id='siteModel.alpha' name='shape' value="5.40372E-2" lower="0.0" upper="100.0"/>
<parameter id='siteModel.alpha' name='shape' spec="RealScalarParam" domain="PositiveReal" value="5.40372E-2"/>

<substModel spec='HKY' id="hky">
<parameter name='kappa' id="hky.kappa" value="21.5056" lower="0.0" upper="100.0"/>
<frequencies id='freqs' spec='Frequencies' data="@alignment"/>
</substModel>
<substModel spec='HKY' id="hky">
<kappa id="hky.kappa" spec="RealScalarParam" domain="PositiveReal" value="21.5056"/>
<frequencies id='freqs' spec='Frequencies' data="@alignment"/>
</substModel>
</siteModel>
<branchRateModel spec='beast.base.evolution.branchratemodel.StrictClockModel' id="branchRates">
<parameter name='clock.rate' id='clock.rate' value="8.8579E-4" lower="0.0" upper="100.0"/>
<branchRateModel spec='beast.base.spec.evolution.branchratemodel.StrictClockModel' id="branchRates">
<parameter id="clock.rate" name='clock.rate' spec="RealScalarParam" domain="PositiveReal" value="8.8579E-4"/>
</branchRateModel>
</distribution>
</distribution>

<run spec="MCMC" id="mcmc" chainLength="5000000">
<state>
<parameter name='stateNode' id="skyline.popSize" dimension="5" value="380.0" lower="0.0" upper="38000.0"/>
<stateNode spec='parameter.IntegerParameter' id='skyline.groupSize' dimension="5" value="0"/>
<stateNode id="skyline.popSize" spec='beast.base.spec.inference.parameter.RealVectorParam'
domain="PositiveReal" dimension="5" value="380.0"/>
<!-- Note: for group size of BSP, need to set domain="PositiveInt" -->
<stateNode id='skyline.groupSize' spec='beast.base.spec.inference.parameter.IntSimplexParam'
domain="PositiveInt" dimension="5" value="1"/>
<stateNode idref="hky.kappa"/>
<stateNode idref="tree"/>
<stateNode idref="clock.rate"/>
<stateNode idref="siteModel.alpha"/>
</state>

<distribution idref="posterior"/>
<operator id='kappaScaler' spec='ScaleOperator' scaleFactor="0.75" weight="1" parameter="@hky.kappa"/>
<operator id='clockRateScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter="@clock.rate"/>
<operator id='shapeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="1" parameter="@siteModel.alpha"/>
<operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>
<operator spec='Uniform' weight="30" tree="@tree"/>
<operator id='kappaScaler' spec='beast.base.spec.inference.operator.ScaleOperator' scaleFactor="0.75" weight="1" parameter="@hky.kappa"/>
<operator id='clockRateScaler' spec='beast.base.spec.inference.operator.ScaleOperator' scaleFactor="0.75" weight="3" parameter="@clock.rate"/>
<operator id='shapeScaler' spec='beast.base.spec.inference.operator.ScaleOperator' scaleFactor="0.75" weight="1" parameter="@siteModel.alpha"/>

<!-- <operator id='treeScaler' spec='ScaleOperator' scaleFactor="0.75" weight="3" tree="@tree"/>-->
<operator id='treeScaler' spec='beast.base.spec.evolution.operator.ScaleTreeOperator'
scaleFactor="0.75" weight="3" tree="@tree"/>
<operator spec='beast.base.evolution.operator.Uniform' weight="30" tree="@tree"/>
<operator spec='SubtreeSlide' weight="15" gaussian="true" tree="@tree"/>
<operator id='narrow' spec='Exchange' isNarrow='true' weight="15" tree="@tree"/>
<operator id='wide' spec='Exchange' isNarrow='false' weight="3" tree="@tree"/>
<operator spec='WilsonBalding' weight="3" tree="@tree"/>
<operator spec='UpDownOperator' scaleFactor="0.75" weight="3" up="@clock.rate" down="@tree"/>
<operator spec='beast.base.spec.evolution.operator.UpDownOperator' scaleFactor="0.75" weight="3"
up="@clock.rate" down="@tree"/>

<operator id='popSizesScaler' spec='ScaleOperator' scaleFactor="0.75" weight="15" parameter="@skyline.popSize"/>
<operator id='groupSizesDelta' spec='DeltaExchangeOperator' delta="1" weight="6" integer="true"
intparameter="@skyline.groupSize"/>
<operator id='popSizesScaler' spec='beast.base.spec.inference.operator.ScaleOperator' scaleFactor="0.75" weight="15" parameter="@skyline.popSize"/>
<operator id='groupSizesDelta' spec='beast.base.spec.inference.operator.DeltaExchangeOperator'
delta="1" weight="6" ivparameter="@skyline.groupSize"/>

<logger logEvery="1000" fileName="test.$(seed).log">
<log idref="posterior"/>
Expand Down Expand Up @@ -195,3 +197,62 @@
</run>
</beast>

<!-- posterior : -3865.9542466284047 +- 0.0961389601876614, ESS = 3492.604498800299, expectation is -3865.3635 +- 0.082236-->
<!-- prior : -92.83210229903075 +- 0.08003083882360096, ESS = 3526.0536725304587, expectation is -92.178 +- 0.075174-->
<!-- siteModel.alpha : 0.05497788953106609 +- 5.299331110248909E-4, ESS = 4359.688517553307, expectation is 0.054354 +- 5.2519E-4-->
<!-- clock.rate : 9.458175044728434E-4 +- 2.0321064507817452E-6, ESS = 3931.1423167686116, expectation is 9.4858E-4 +- 1.9706E-6-->
<!-- skyline.popSize.1 : 173.76402579265374 +- 29.860420930332154, ESS = 3790.3791104367774, expectation is 67.8827 +- 2.2639-->
<!-- skyline.popSize.2 : 72.87159412926472 +- 30.305852200599514, ESS = 4293.640695139613, expectation is 25.4281 +- 0.3165-->
<!-- skyline.popSize.3 : 39.87848820895047 +- 3.462081443420053, ESS = 4260.583420175925, expectation is 31.9271 +- 0.3819-->
<!-- skyline.popSize.4 : 37.32718252996777 +- 0.4472310626854941, ESS = 4097.472800164088, expectation is 41.6596 +- 0.3976-->
<!-- skyline.popSize.5 : 33.55786864929906 +- 0.550735781840017, ESS = 4057.284272072856, expectation is 33.5967 +- 0.3554-->
<!-- skyline.groupSize.1 : 2.7127305043323706 +- 0.06306608837776836, ESS = 2398.929431240526, expectation is 2.4686 +- 0.040465-->
<!-- skyline.groupSize.2 : 3.3061541879582315 +- 0.05994709875781661, ESS = 2772.55083764436, expectation is 3.3671 +- 0.039454-->
<!-- skyline.groupSize.3 : 3.5143301488558096 +- 0.05338807957250786, ESS = 3592.6273024874827, expectation is 3.181 +- 0.033807-->
<!-- skyline.groupSize.4 : 3.4534547878249278 +- 0.06293620983239555, ESS = 2705.219849449633, expectation is 3.723 +- 0.050187-->
<!-- skyline.groupSize.5 : 3.01333037102866 +- 0.06597484934953088, ESS = 2423.979975652484, expectation is 3.2603 +- 0.059824-->
<!-- hky.kappa : 21.61103060838405 +- 0.06324776408653743, ESS = 4501.000000000001, expectation is 21.6911 +- 0.052142-->
<!-- likelihood : -3773.1221443293744 +- 0.05486169919391575, ESS = 3815.825171853874, expectation is -3773.1854 +- 0.039474-->
<!-- skyline : -70.2720392679962 +- 0.055065315407511715, ESS = 3360.9793129247732, expectation is -69.725 +- 0.05435-->
<!-- eml1 : -22.560063031034492 +- 0.052431171754551725, ESS = 2963.8139809178087, expectation is -22.453 +- 0.031115-->


<!-- Uniform prior-->
<!-- posterior : -3918.723673298291 +- 0.09293307120140108, ESS = 3737.03597399822, expectation is -3865.3635 +- 0.082236-->
<!-- prior : -145.592239548388 +- 0.08139134407857418, ESS = 3330.253918111081, expectation is -92.178 +- 0.075174-->
<!-- siteModel.alpha : 0.05575303704611519 +- 5.944657534632992E-4, ESS = 3362.732291389403, expectation is 0.054354 +- 5.2519E-4-->
<!-- clock.rate : 9.47976581828431E-4 +- 2.1266182866295015E-6, ESS = 3444.6362179749535, expectation is 9.4858E-4 +- 1.9706E-6-->
<!-- skyline.popSize.1 : 163.1044085425222 +- 22.593891532033254, ESS = 2321.735979191498, expectation is 67.8827 +- 2.2639-->
<!-- skyline.popSize.2 : 50.939151229419615 +- 9.07633634051999, ESS = 1467.111240235273, expectation is 25.4281 +- 0.3165-->
<!-- skyline.popSize.3 : 41.0104252266342 +- 4.718937661308659, ESS = 3855.6620005064383, expectation is 31.9271 +- 0.3819-->
<!-- skyline.popSize.4 : 37.135462041283105 +- 0.4462350613992348, ESS = 3731.988309847787, expectation is 41.6596 +- 0.3976-->
<!-- skyline.popSize.5 : 34.17745448837122 +- 0.5473854560669065, ESS = 4016.578695468486, expectation is 33.5967 +- 0.3554-->
<!-- skyline.groupSize.1 : 2.4890024439013554 +- 0.0564806436428423, ESS = 2657.0167213248005, expectation is 2.4686 +- 0.040465-->
<!-- skyline.groupSize.2 : 3.282159520106643 +- 0.05647092935103854, ESS = 3070.85720372171, expectation is 3.3671 +- 0.039454-->
<!-- skyline.groupSize.3 : 3.4034658964674516 +- 0.05133295951550351, ESS = 3614.4717293796266, expectation is 3.181 +- 0.033807-->
<!-- skyline.groupSize.4 : 3.597200622083981 +- 0.0636065492027155, ESS = 2714.9046234601724, expectation is 3.723 +- 0.050187-->
<!-- skyline.groupSize.5 : 3.2281715174405687 +- 0.07138178790261579, ESS = 2225.0890477043995, expectation is 3.2603 +- 0.059824-->
<!-- hky.kappa : 21.706993859867826 +- 0.06519983739530205, ESS = 4421.030218272883, expectation is 21.6911 +- 0.052142-->
<!-- likelihood : -3773.131433749916 +- 0.05689918245086899, ESS = 3710.0809574936966, expectation is -3773.1854 +- 0.039474-->
<!-- skyline : -70.1887676852798 +- 0.052847791629031235, ESS = 3547.545071612453, expectation is -69.725 +- 0.05435-->
<!-- eml1 : -22.676764801144497 +- 0.05522848188228343, ESS = 2636.96968956787, expectation is -22.453 +- 0.031115-->


<!-- posterior : -3917.9498143004666 +- 0.08565826258812939, ESS = 3915.6596753020604, expectation is -3865.3635 +- 0.082236-->
<!-- prior : -144.92219722155576 +- 0.0716846034994167, ESS = 3702.4421228085616, expectation is -92.178 +- 0.075174-->
<!-- siteModel.alpha : 0.05409879470678472 +- 5.083947725398481E-4, ESS = 4404.751737929933, expectation is 0.054354 +- 5.2519E-4-->
<!-- clock.rate : 9.490971564476442E-4 +- 2.2088548142697736E-6, ESS = 3176.895074955792, expectation is 9.4858E-4 +- 1.9706E-6-->
<!-- skyline.popSize.1 : 63.81156608863796 +- 1.6921469269889846, ESS = 4236.376838314304, expectation is 67.8827 +- 2.2639-->
<!-- skyline.popSize.2 : 25.434787606102066 +- 0.3636549889452317, ESS = 3545.580404779142, expectation is 25.4281 +- 0.3165-->
<!-- skyline.popSize.3 : 32.40195192030104 +- 0.3965431307420086, ESS = 3730.674552441753, expectation is 31.9271 +- 0.3819-->
<!-- skyline.popSize.4 : 40.870729251940446 +- 0.406585858420294, ESS = 3810.877649501971, expectation is 41.6596 +- 0.3976-->
<!-- skyline.popSize.5 : 33.87653529388686 +- 0.44469436767918263, ESS = 3962.1583904865975, expectation is 33.5967 +- 0.3554-->
<!-- skyline.groupSize.1 : 2.512108420351033 +- 0.039466698140399714, ESS = 2797.7482686302988, expectation is 2.4686 +- 0.040465-->
<!-- skyline.groupSize.2 : 3.374805598755832 +- 0.036870783125188336, ESS = 3467.728566706139, expectation is 3.3671 +- 0.039454-->
<!-- skyline.groupSize.3 : 3.2448344812263943 +- 0.03324235155534377, ESS = 3958.7444794721573, expectation is 3.181 +- 0.033807-->
<!-- skyline.groupSize.4 : 3.6665185514330147 +- 0.04135488020523446, ESS = 3399.502449281693, expectation is 3.723 +- 0.050187-->
<!-- skyline.groupSize.5 : 3.201732948233726 +- 0.04660359139697981, ESS = 2798.2478556787314, expectation is 3.2603 +- 0.059824-->
<!-- hky.kappa : 21.589261203122547 +- 0.06314340352206708, ESS = 4488.708350190953, expectation is 21.6911 +- 0.052142-->
<!-- likelihood : -3773.0276170789084 +- 0.056627001899388164, ESS = 3782.5079405522606, expectation is -3773.1854 +- 0.039474-->
<!-- skyline : -69.77661896471284 +- 0.052313445818236035, ESS = 3885.3498389520378, expectation is -69.725 +- 0.05435-->
<!-- eml1 : -22.41887119487888 +- 0.032732487520717904, ESS = 3976.6606751683016, expectation is -22.453 +- 0.031115-->
Loading