Skip to content

Commit ec57e28

Browse files
committed
port to BEAST v2.7
1 parent b03d360 commit ec57e28

19 files changed

+217
-224
lines changed

build.xml

Lines changed: 31 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
</description>
99

1010
<!-- set global properties for this build -->
11-
<property name="srcNS" location="src" />
12-
<property name="buildNS" location="build" />
13-
<property name="libNS" location="lib" />
14-
<property name="release_dir" value="release" />
11+
<property name="NSdir" location="../nested-sampling/" />
12+
<property name="srcNS" location="${NSdir}/src" />
13+
<property name="buildNS" location="${NSdir}/build" />
14+
<property name="libNS" location="${NSdir}/lib" />
15+
<property name="release_dir" value="${NSdir}/release" />
1516
<property name="distNS" location="${buildNS}/dist" />
1617
<property name="beast2path" location="../beast2" />
1718
<property name="libBeast2" location="${beast2path}/lib" />
1819
<property name="srcBeast2" location="${beast2path}/src" />
1920
<property name="beast2classpath" location="${beast2path}/build" />
21+
<property name="beastappclasspath" location="../BeastFX/build" />
22+
<property name="buildMODEL_SELECTION" location="../model-selection/build" />
23+
2024
<property name="Add_on_dir" value="${release_dir}/add-on" />
21-
<property name="version" value="1.1.0" />
2225

23-
<property name="buildMODEL_SELECTION" location="../model-selection/build"/>
24-
<property name="buildBEAST_LABS" location="../BEASTLabs/build"/>
25-
2626

2727
<import file="${beast2path}/build.xml" />
2828

@@ -31,22 +31,27 @@
3131

3232
<path id="classpath">
3333
<pathelement path="${buildNS}"/>
34-
<fileset dir="${libBeast2}" includes="antlr-runtime-4.7.jar"/>
35-
<fileset dir="${libBeast2}" includes="junit-4.8.2.jar"/>
34+
<fileset dir="${libBeast2}" includes="antlr-runtime-4.10.1.jar"/>
3635
<fileset dir="${libBeast2}" includes="beagle.jar"/>
37-
<fileset dir="${libBeast2}" includes="jam.jar"/>
38-
<fileset dir="${libBeast2}" includes="ntlr-runtime-4.5.jar"/>
39-
<fileset dir="${libBeast2}" includes="commons-math3-3.1.1.jar"/>
36+
<fileset dir="${libBeast2}" includes="commons-math3-3.6.1.jar"/>
4037
<fileset dir="${libBeast2}" includes="colt.jar"/>
41-
<fileset dir="${libBeast2}" includes="debug-1.0.jar"/>
38+
<fileset dir="${libBeast2}/junit/" includes="junit-platform-console-standalone-1.8.2.jar"/>
4239
<pathelement path="${buildMODEL_SELECTION}"/>
43-
<pathelement path="${buildBEAST_LABS}"/>
40+
<pathelement path="${beastappclasspath}"/>
4441
<pathelement path="${beast2classpath}"/>
45-
</path>
42+
</path>
4643

4744
<!-- start -->
4845
<target name="initNS">
4946
<echo message="${ant.project.name}: ${ant.file}" />
47+
<available file="${NSdir}/version.xml" property="versionAvailable"/>
48+
<fail unless="versionAvailable">
49+
** Required file version.xml does not exist. **
50+
</fail>
51+
52+
<!-- Read package name and version from xml file -->
53+
<xmlproperty file="${NSdir}/version.xml" prefix="fromVersionFile" />
54+
<property name="NSversion" value="${fromVersionFile.package(version)}" />
5055
</target>
5156

5257
<target name="cleanNS">
@@ -85,9 +90,7 @@
8590
fork="true"
8691
memoryinitialsize="256m"
8792
memorymaximumsize="256m">
88-
<!--source="1.6"
89-
target="1.6"-->
90-
<include name="beast/**/**" />
93+
<include name="nestedsampling/**/**" />
9194
<!-- compile JUnit test classes -->
9295
<include name="test/beast/**" />
9396
</javac>
@@ -99,45 +102,19 @@
99102
<!-- Create the distribution directory -->
100103
<mkdir dir="${distNS}" />
101104

102-
<!-- Put everything in ${buildNS} into the beast.jar file -->
103-
<jar jarfile="${distNS}/NS.jar">
104-
<manifest>
105-
<attribute name="Built-By" value="${user.name}" />
106-
<attribute name="Main-Class" value="${main_class_BEAST}" />
107-
</manifest>
108-
<fileset dir="${buildNS}">
109-
<include name="**/*.class" />
110-
</fileset>
111-
<fileset dir="${buildMODEL_SELECTION}">
112-
<include name="**/*.class" />
113-
</fileset>
114-
<fileset dir="${buildBEAST_LABS}">
115-
<include name="**/*.class" />
116-
</fileset>
117-
<fileset dir="${beast2classpath}">
118-
<include name="**/*.class" />
119-
<include name="**/*.properties" />
120-
<include name="**/*.png" />
121-
</fileset>
122-
<zipgroupfileset dir="${lib}" includes="jam.jar" />
123-
<zipgroupfileset dir="${lib}" includes="beagle.jar" />
124-
<zipgroupfileset dir="${lib}" includes="colt.jar" />
125-
<zipgroupfileset dir="${lib}" includes="commons-math3-3.1.1.jar" />
126-
<zipgroupfileset dir="${lib}" includes="antlr-runtime-4.7.jar"/>
127-
</jar>
128105
<jar jarfile="${distNS}/NS.src.jar">
129106
<fileset dir="${srcNS}">
130-
<include name="beast/**/*.java" />
131-
<include name="beast/**/*.png" />
132-
<include name="beast/**/*.xsl" />
107+
<include name="nestedsampling/**/*.java" />
108+
<include name="nestedsampling/**/*.png" />
109+
<include name="nestedsampling/**/*.xsl" />
133110
</fileset>
134111
</jar>
135112
<jar jarfile="${distNS}/NS.addon.jar">
136113
<manifest>
137114
<attribute name="Built-By" value="${user.name}" />
138115
</manifest>
139116
<fileset dir="${buildNS}">
140-
<include name="beast/**/*.class" />
117+
<include name="nestedsampling/**/*.class" />
141118
<include name="util/**/*.class" />
142119
<include name="**/*.properties" />
143120
</fileset>
@@ -193,7 +170,7 @@
193170
<mkdir dir="${Add_on_dir}" />
194171
<mkdir dir="${Add_on_dir}/lib" />
195172
<mkdir dir="${Add_on_dir}/examples" />
196-
<mkdir dir="${Add_on_dir}/templates" />
173+
<mkdir dir="${Add_on_dir}/fxtemplates" />
197174

198175
<copy todir="${Add_on_dir}">
199176
<fileset file="version.xml"/>
@@ -207,17 +184,16 @@
207184
<copy todir="${Add_on_dir}">
208185
<fileset dir="${distNS}" includes="NS.src.jar" />
209186
</copy>
210-
<copy todir="${Add_on_dir}/templates">
211-
<fileset file="templates/NS.xml" />
212-
<fileset file="templates/AutoPartition.xml" />
187+
<copy todir="${Add_on_dir}/fxtemplates">
188+
<fileset file="fxtemplates/NS.xml" />
213189
</copy>
214190

215-
<jar jarfile="${distNS}/NS.addon.v${version}.zip">
191+
<jar jarfile="${distNS}/NS.addon.v${NSversion}.zip">
216192
<fileset dir="${Add_on_dir}">
217193
<include name="**/*" />
218194
</fileset>
219195
</jar>
220-
<echo message="Add-on version v${version} release is finished." />
196+
<echo message="Add-on version v${NSversion} release is finished." />
221197
</target>
222198

223199
</project>

examples/NS_4taxa_NormalBirthRate.xml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast beautitemplate='Standard' beautistatus='' namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" required="" version="2.5">
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast beautitemplate='Standard' beautistatus='' namespace="beast.pkgmgmt:beast.base.core:beast.base.inference:beast.base.evolution.alignment: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" required="" version="2.5">
22

33

44
<data
@@ -34,16 +34,16 @@ ML: -2349.814260249774 Information: 14.442480805674677 (SD ~ 0.12)
3434

3535

3636

37-
<map name="Uniform" >beast.math.distributions.Uniform</map>
38-
<map name="Exponential" >beast.math.distributions.Exponential</map>
39-
<map name="LogNormal" >beast.math.distributions.LogNormalDistributionModel</map>
40-
<map name="Normal" >beast.math.distributions.Normal</map>
41-
<map name="Beta" >beast.math.distributions.Beta</map>
42-
<map name="Gamma" >beast.math.distributions.Gamma</map>
43-
<map name="LaplaceDistribution" >beast.math.distributions.LaplaceDistribution</map>
44-
<map name="prior" >beast.math.distributions.Prior</map>
45-
<map name="InverseGamma" >beast.math.distributions.InverseGamma</map>
46-
<map name="OneOnX" >beast.math.distributions.OneOnX</map>
37+
<map name="Uniform" >beast.base.inference.distribution.Uniform</map>
38+
<map name="Exponential" >beast.base.inference.distribution.Exponential</map>
39+
<map name="LogNormal" >beast.base.inference.distribution.LogNormalDistributionModel</map>
40+
<map name="Normal" >beast.base.inference.distribution.Normal</map>
41+
<map name="Beta" >beast.base.inference.distribution.Beta</map>
42+
<map name="Gamma" >beast.base.inference.distribution.Gamma</map>
43+
<map name="LaplaceDistribution" >beast.base.inference.distribution.LaplaceDistribution</map>
44+
<map name="prior" >beast.base.inference.distribution.Prior</map>
45+
<map name="InverseGamma" >beast.base.inference.distribution.InverseGamma</map>
46+
<map name="OneOnX" >beast.base.inference.distribution.OneOnX</map>
4747

4848

4949
<run id="mcmc" spec="beast.gss.NS" subChainLength="10000" chainLength="250000" preBurnin="0" particleCount="100" epsilon="1e-10"
@@ -62,22 +62,22 @@ ML: -2349.814260249774 Information: 14.442480805674677 (SD ~ 0.12)
6262
<parameter id="freqParameter.s:dna" dimension="4" lower="0.0" name="stateNode" upper="1.0">0.25</parameter>
6363
</state>
6464

65-
<init id="RandomTree.t:dna" spec="beast.evolution.tree.RandomTree" estimate="false" initial="@Tree.t:dna" taxa="@dna">
65+
<init id="RandomTree.t:dna" spec="beast.base.evolution.tree.coalescent.RandomTree" estimate="false" initial="@Tree.t:dna" taxa="@dna">
6666
<populationModel id="ConstantPopulation0.t:dna" spec="ConstantPopulation">
6767
<parameter id="randomPopSize.t:dna" name="popSize">1.0</parameter>
6868
</populationModel>
6969
</init>
7070

71-
<distribution id="posterior" spec="util.CompoundDistribution">
72-
<distribution id="prior" spec="util.CompoundDistribution">
73-
<distribution id="YuleModel.t:dna" spec="beast.evolution.speciation.YuleModel" birthDiffRate="@birthRate.t:dna" tree="@Tree.t:dna"/>
71+
<distribution id="posterior" spec="beast.base.inference.CompoundDistribution">
72+
<distribution id="prior" spec="beast.base.inference.CompoundDistribution">
73+
<distribution id="YuleModel.t:dna" spec="beast.base.evolution.speciation.YuleModel" birthDiffRate="@birthRate.t:dna" tree="@Tree.t:dna"/>
7474
<prior id="YuleBirthRatePrior.t:dna" name="distribution" x="@birthRate.t:dna">
75-
<Normal name="distr" mean="6.5" sigma="0.1" spec="beast.math.distributions.Normal"/>
75+
<Normal name="distr" mean="6.5" sigma="0.1" spec="beast.base.inference.distribution.Normal"/>
7676
</prior>
7777
<prior id="KappaPrior.s:dna" name="distribution" x="@kappa.s:dna">
7878
<Normal id="LogNormalDistributionModel.0" name="distr" mean="2.5" sigma="0.1"/>
7979
</prior>
80-
<distribution id="root.prior" spec="beast.math.distributions.MRCAPrior" monophyletic="true" tree="@Tree.t:dna">
80+
<distribution id="root.prior" spec="beast.base.evolution.tree.MRCAPrior" monophyletic="true" tree="@Tree.t:dna">
8181
<taxonset id="root" spec="TaxonSet">
8282
<taxon id="Cow" spec="Taxon"/>
8383
<taxon id="Human" spec="Taxon"/>
@@ -87,7 +87,7 @@ ML: -2349.814260249774 Information: 14.442480805674677 (SD ~ 0.12)
8787
<Normal name="distr" mean="0.19" sigma="0.05"/>
8888
</distribution>
8989
</distribution>
90-
<distribution id="likelihood" spec="util.CompoundDistribution" useThreads="true">
90+
<distribution id="likelihood" spec="beast.base.inference.CompoundDistribution" useThreads="true">
9191
<distribution id="treeLikelihood.dna" spec="ThreadedTreeLikelihood" data="@dna" tree="@Tree.t:dna">
9292
<siteModel id="SiteModel.s:dna" spec="SiteModel">
9393
<parameter id="mutationRate.s:dna" estimate="false" name="mutationRate">1.0</parameter>
@@ -97,7 +97,7 @@ ML: -2349.814260249774 Information: 14.442480805674677 (SD ~ 0.12)
9797
<frequencies id="estimatedFreqs.s:dna" spec="Frequencies" frequencies="@freqParameter.s:dna"/>
9898
</substModel>
9999
</siteModel>
100-
<branchRateModel id="StrictClock.c:dna" spec="beast.evolution.branchratemodel.StrictClockModel">
100+
<branchRateModel id="StrictClock.c:dna" spec="beast.base.evolution.branchratemodel.StrictClockModel">
101101
<parameter id="clockRate.c:dna" estimate="false" name="clock.rate">1.0</parameter>
102102
</branchRateModel>
103103
</distribution>
@@ -131,7 +131,7 @@ ML: -2349.814260249774 Information: 14.442480805674677 (SD ~ 0.12)
131131
<log idref="likelihood"/>
132132
<log idref="prior"/>
133133
<log idref="treeLikelihood.dna"/>
134-
<log id="TreeHeight.t:dna" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:dna"/>
134+
<log id="TreeHeight.t:dna" spec="beast.base.evolution.tree.TreeHeightLogger" tree="@Tree.t:dna"/>
135135
<log idref="YuleModel.t:dna"/>
136136
<log idref="birthRate.t:dna"/>
137137
<log idref="kappa.s:dna"/>
@@ -147,7 +147,7 @@ ML: -2349.814260249774 Information: 14.442480805674677 (SD ~ 0.12)
147147
</logger>
148148

149149
<logger id="treelog.t:dna" fileName="$(tree).trees" logEvery="1000" mode="tree">
150-
<log id="TreeWithMetaDataLogger.t:dna" spec="beast.evolution.tree.TreeWithMetaDataLogger" tree="@Tree.t:dna"/>
150+
<log id="TreeWithMetaDataLogger.t:dna" spec="beast.base.evolution.TreeWithMetaDataLogger" tree="@Tree.t:dna"/>
151151
</logger>
152152

153153

examples/dna.xml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast beautitemplate='Standard' beautistatus='' namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" required="" version="2.4">
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?><beast beautitemplate='Standard' beautistatus='' namespace="beast.pkgmgmt:beast.base.core:beast.base.inference:beast.base.evolution.alignment: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" required="" version="2.4">
22

33

44
<data
@@ -24,16 +24,16 @@ name="alignment">
2424

2525

2626

27-
<map name="Uniform" >beast.math.distributions.Uniform</map>
28-
<map name="Exponential" >beast.math.distributions.Exponential</map>
29-
<map name="LogNormal" >beast.math.distributions.LogNormalDistributionModel</map>
30-
<map name="Normal" >beast.math.distributions.Normal</map>
31-
<map name="Beta" >beast.math.distributions.Beta</map>
32-
<map name="Gamma" >beast.math.distributions.Gamma</map>
33-
<map name="LaplaceDistribution" >beast.math.distributions.LaplaceDistribution</map>
34-
<map name="prior" >beast.math.distributions.Prior</map>
35-
<map name="InverseGamma" >beast.math.distributions.InverseGamma</map>
36-
<map name="OneOnX" >beast.math.distributions.OneOnX</map>
27+
<map name="Uniform" >beast.base.inference.distribution.Uniform</map>
28+
<map name="Exponential" >beast.base.inference.distribution.Exponential</map>
29+
<map name="LogNormal" >beast.base.inference.distribution.LogNormalDistributionModel</map>
30+
<map name="Normal" >beast.base.inference.distribution.Normal</map>
31+
<map name="Beta" >beast.base.inference.distribution.Beta</map>
32+
<map name="Gamma" >beast.base.inference.distribution.Gamma</map>
33+
<map name="LaplaceDistribution" >beast.base.inference.distribution.LaplaceDistribution</map>
34+
<map name="prior" >beast.base.inference.distribution.Prior</map>
35+
<map name="InverseGamma" >beast.base.inference.distribution.InverseGamma</map>
36+
<map name="OneOnX" >beast.base.inference.distribution.OneOnX</map>
3737

3838

3939
<!-- stepping stone
@@ -56,28 +56,28 @@ name="alignment">
5656
<parameter id="birthRate.t:dna" name="stateNode">1.0</parameter>
5757
</state>
5858

59-
<init id="RandomTree.t:dna" spec="beast.evolution.tree.RandomTree" estimate="false" initial="@Tree.t:dna" taxa="@dna">
59+
<init id="RandomTree.t:dna" spec="beast.base.evolution.tree.coalescent.RandomTree" estimate="false" initial="@Tree.t:dna" taxa="@dna">
6060
<populationModel id="ConstantPopulation0.t:dna" spec="ConstantPopulation">
6161
<parameter id="randomPopSize.t:dna" name="popSize">1.0</parameter>
6262
</populationModel>
6363
</init>
6464

65-
<distribution id="posterior" spec="util.CompoundDistribution">
66-
<distribution id="prior" spec="util.CompoundDistribution">
67-
<distribution id="YuleModel.t:dna" spec="beast.evolution.speciation.YuleModel" birthDiffRate="@birthRate.t:dna" tree="@Tree.t:dna"/>
65+
<distribution id="posterior" spec="beast.base.inference.CompoundDistribution">
66+
<distribution id="prior" spec="beast.base.inference.CompoundDistribution">
67+
<distribution id="YuleModel.t:dna" spec="beast.base.evolution.speciation.YuleModel" birthDiffRate="@birthRate.t:dna" tree="@Tree.t:dna"/>
6868
<prior id="YuleBirthRatePrior.t:dna" name="distribution" x="@birthRate.t:dna">
6969
<Uniform id="Uniform.1" name="distr" upper="10"/>
7070
</prior>
7171
</distribution>
72-
<distribution id="likelihood" spec="util.CompoundDistribution" useThreads="true">
72+
<distribution id="likelihood" spec="beast.base.inference.CompoundDistribution" useThreads="true">
7373
<distribution id="treeLikelihood.dna" spec="ThreadedTreeLikelihood" data="@dna" tree="@Tree.t:dna">
7474
<siteModel id="SiteModel.s:dna" spec="SiteModel">
7575
<parameter id="mutationRate.s:dna" estimate="false" name="mutationRate">1.0</parameter>
7676
<parameter id="gammaShape.s:dna" estimate="false" name="shape">1.0</parameter>
7777
<parameter id="proportionInvariant.s:dna" estimate="false" lower="0.0" name="proportionInvariant" upper="1.0">0.0</parameter>
7878
<substModel id="JC69.s:dna" spec="JukesCantor"/>
7979
</siteModel>
80-
<branchRateModel id="StrictClock.c:dna" spec="beast.evolution.branchratemodel.StrictClockModel">
80+
<branchRateModel id="StrictClock.c:dna" spec="beast.base.evolution.branchratemodel.StrictClockModel">
8181
<parameter id="clockRate.c:dna" estimate="false" name="clock.rate">1.0</parameter>
8282
</branchRateModel>
8383
</distribution>
@@ -105,7 +105,7 @@ name="alignment">
105105
<log idref="likelihood"/>
106106
<log idref="prior"/>
107107
<log idref="treeLikelihood.dna"/>
108-
<log id="TreeHeight.t:dna" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:dna"/>
108+
<log id="TreeHeight.t:dna" spec="beast.base.evolution.tree.TreeHeightLogger" tree="@Tree.t:dna"/>
109109
<log idref="YuleModel.t:dna"/>
110110
<log idref="birthRate.t:dna"/>
111111
</logger>
@@ -118,7 +118,7 @@ name="alignment">
118118
</logger>
119119

120120
<logger id="treelog.t:dna" fileName="$(tree).trees" logEvery="10000" mode="tree">
121-
<log id="TreeWithMetaDataLogger.t:dna" spec="beast.evolution.tree.TreeWithMetaDataLogger" tree="@Tree.t:dna"/>
121+
<log id="TreeWithMetaDataLogger.t:dna" spec="beast.base.evolution.TreeWithMetaDataLogger" tree="@Tree.t:dna"/>
122122
</logger>
123123

124124
</run>

0 commit comments

Comments
 (0)