Skip to content
Open
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 Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dockerfile to build container for unit testing

FROM openjdk:10
FROM openjdk:17

RUN apt-get update && apt-get install -y git ant

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ KV Parag, L du Plessis, OG Pybus. _Jointly inferring the dynamics of population

To install BESP:

1. Download and install [BEAST2](www.beast2.org) (at least version 2.5.0).
1. Download and install [BEAST2](www.beast2.org) (at least version 2.7.0).
2. Launch the BEAUti application distributed with BEAST2.
3. From the File menu select "Manage Packages".
4. Click the "Package repositories" button at the bottom of the Package Manager dialog box.
Expand All @@ -26,7 +26,7 @@ To install BESP:

To build this package from source, ensure that you have the following installed:

- Java JDK v1.8
- Java JDK v17
- Apache Ant v1.9 or later
- An internet connection

Expand Down
Binary file added ScreenShotIntelliJ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
103 changes: 78 additions & 25 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@

<!-- Location to check for local copy of beast2 repository -->
<property name="beastDir" location="../beast2"/>
<property name="BeastFXpath" location="../BeastFX" />

<!-- BEAST 2 currently uses Java 1.8 -->
<property name="sourceVersion" value="1.8"/>
<property name="targetVersion" value="1.8"/>
<!-- BEAST 2 currently uses Java 17 -->
<property name="sourceVersion" value="17"/>
<property name="targetVersion" value="17"/>

<!-- Directories necessary for all BEAST 2 packages -->
<property name="doc" location="doc"/>
<property name="examples" location="examples"/>
<property name="templates" location="templates"/>
<property name="templates" location="fxtemplates"/>

<!-- BEAST branch and version to build against
(only different for version tags because of
Expand Down Expand Up @@ -44,15 +45,18 @@

<!-- Read package name and version from xml file -->
<xmlproperty file="version.xml" prefix="fromVersionFile" />
<property name="projName" value="${fromVersionFile.addon(name)}" />
<property name="projVersion" value="${fromVersionFile.addon(version)}" />
<property name="projName" value="${fromVersionFile.package(name)}" />
<property name="projVersion" value="${fromVersionFile.package(version)}" />

<mkdir dir="${build}"/>
<mkdir dir="${build-lib}"/>
<mkdir dir="${dist}"/>

<copy todir="${build-lib}" failonerror="false" quiet="true">
<fileset dir="${lib}" includes="*.jar"/>
<copy todir="${build-lib}">
<!-- <fileset dir="${lib}" includes="*.jar"/>-->
<fileset dir="${beastDir}/lib" includes="*.jar"/>
<fileset dir="${beastDir}/lib/junit" includes="junit-*.jar"/>
<fileset dir="${BeastFXpath}/locallib" includes="*.jar"/>
</copy>
</target>

Expand All @@ -65,7 +69,7 @@
<target name="build-remote-beast" depends="find-beast" unless="localBeastAvailable">
<echo>No local copy of the beast2 source found at ${beastDir}.</echo>
<echo>Compiling against version ${beast-version} from GitHub.</echo>

<!-- TODO not tested -->
<property name="build-beast" location="build-beast"/>
<mkdir dir="${build-beast}"/>

Expand All @@ -80,10 +84,41 @@
<fileset dir="${build-beast}/beast2-${beast-version}/lib" includes="*.jar"/>
</classpath>
</javac>
<jar jarfile="${build-lib}/beast2.jar" basedir="${build-beast}/beast2-${beast-version}/build" />

<mkdir dir="${build-beast}/beast2-${beast-version}/test"/>
<javac target="${targetVersion}" source="${sourceVersion}"
srcdir="${build-beast}/beast2-${beast-version}/test"
destdir="${build-beast}/beast2-${beast-version}/build"
includeantruntime="false">
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${build-beast}/beast2-${beast-version}/lib" includes="*.jar"/>
<fileset dir="${beastDir}/lib/junit" includes="junit-*.jar"/>
</classpath>
</javac>

<copy todir="${build-lib}">
<fileset dir="${build-beast}/beast2-${beast-version}/lib" includes="*.jar"/>
<fileset dir="${beastDir}/lib/junit" includes="junit-*.jar"/>
</copy>
<jar jarfile="${build-lib}/beast2.jar" basedir="${build-beast}/beast2-${beast-version}/build" />

<get src="https://github.com/CompEvol/BeastFX/archive/${beast-branch}.zip" dest="${build-beast}/beastFX.zip"/>
<unzip src="${build-beast}/beastFX.zip" dest="${build-beast}"/>
<mkdir dir="${build-beast}/beastFX-${beast-version}/build"/>
<!-- Java FX -->
<!-- if Zulu is not installed, it can specify javac, e.g. add -->
<!-- executable="../../Downloads/zulu17.36.13-ca-fx-jdk17.0.4-macosx_x64/bin/javac" -->
<javac target="${targetVersion}" source="${sourceVersion}"
srcdir="${build-beast}/beastFX-${beast-version}/src"
destdir="${build-beast}/beastFX-${beast-version}/build"
fork="true" includeantruntime="false">
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${build-lib}" includes="*.jar"/>
</classpath>
</javac>
<jar jarfile="${build-lib}/beastFX.jar" basedir="${build-beast}/beastFX-${beast-version}/build" />

<delete dir="${build-beast}" />
</target>
Expand All @@ -95,21 +130,36 @@
<mkdir dir="${build-beast}"/>

<javac target="${targetVersion}" source="${sourceVersion}"
srcdir="${beastDir}/src"
destdir="${build-beast}" includeantruntime="false">
srcdir="${beastDir}/src" destdir="${build-beast}"
includeantruntime="false">
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${beastDir}/lib" includes="*.jar"/>
</classpath>
</javac>
<!-- for testing -->
<javac target="${targetVersion}" source="${sourceVersion}"
srcdir="${beastDir}/test" destdir="${build-beast}"
includeantruntime="false">
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${build-lib}" includes="*.jar"/>
</classpath>
</javac>

<!-- Java FX -->
<!-- if Zulu is not installed, it can specify javac, e.g. add -->
<!-- executable="../../Downloads/zulu17.36.13-ca-fx-jdk17.0.4-macosx_x64/bin/javac" -->
<javac target="${targetVersion}" source="${sourceVersion}"
srcdir="${BeastFXpath}/src" destdir="${build-beast}"
fork="true" includeantruntime="false">
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${build-lib}" includes="*.jar"/>
</classpath>
</javac>

<jar jarfile="${build-lib}/beast2.jar" basedir="${build-beast}" />
<copy todir="${build-lib}">
<fileset dir="${beastDir}/lib" includes="*.jar"/>
</copy>
<copy todir="${build}">
<fileset dir="${beastDir}/src"
includes="**/*.png" />
</copy>

<delete dir="${build-beast}" />
</target>
Expand All @@ -123,7 +173,9 @@

<!-- Compile -->
<target name="compile" depends="build-beast, get-dependencies">
<javac target="${targetVersion}" source="${sourceVersion}" srcdir="${src}" destdir="${build}" includeantruntime="false">
<javac target="${targetVersion}" source="${sourceVersion}"
srcdir="${src}" destdir="${build}"
includeantruntime="false">
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${build-lib}" includes="*.jar"/>
Expand All @@ -144,10 +196,11 @@
<mkdir dir="${test-reports}"/>
</target>


<!-- Compile unit tests -->
<target name="compile-test" depends="init-test,compile,copy-resources">
<javac target="${targetVersion}" source="${sourceVersion}" srcdir="${test}" destdir="${build-test}" includeantruntime="false">
<javac target="${targetVersion}" source="${sourceVersion}"
srcdir="${test}" destdir="${build-test}"
includeantruntime="false">
<classpath>
<pathelement path="${classpath}"/>
<pathelement path="${build}" />
Expand Down Expand Up @@ -186,7 +239,7 @@

<mkdir dir="${pack}"/>
<mkdir dir="${pack}/examples"/>
<mkdir dir="${pack}/templates"/>
<mkdir dir="${pack}/fxtemplates"/>
<mkdir dir="${pack}/lib"/>
<mkdir dir="${pack}/doc"/>

Expand All @@ -211,8 +264,8 @@
<fileset dir="${examples}" includes="**/*.fasta" />
</copy>

<mkdir dir="${templates}" />
<copy todir="${pack}/templates">
<mkdir dir="fxtemplates" />
<copy todir="${pack}/fxtemplates">
<fileset dir="${templates}" includes="*.xml" />
</copy>

Expand Down
65 changes: 32 additions & 33 deletions examples/BESP/bison_besp_mcpgamma_limits_densdefined.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beast beautitemplate='Standard'
beautistatus=''
namespace="beast.core
:beast.evolution.alignment
:beast.evolution.tree.coalescent
:beast.util
:beast.core.util
:beast.core.parameter
:beast.evolution.nuc
:beast.evolution.operators
:beast.evolution.sitemodel
:beast.evolution.substitutionmodel
:beast.evolution.likelihood
namespace="beast.base.core:beast.base.inference
:beast.base.evolution.alignment
:beast.base.evolution.tree.coalescent
:beast.base.util
:beast.base.inference.parameter
:beast.base.evolution.nuc
:beast.base.evolution.operator:beast.base.inference.operator
:beast.base.evolution.sitemodel
:beast.base.evolution.substitutionmodel
:beast.base.evolution.likelihood
:bsp.distributions
:bsp.util"
required="BEAST v2.5.0"
version="2.5">
required="BEAST v2.7.2"
version="2.7">


<data id="bison_2013" name="alignment">
Expand Down Expand Up @@ -181,23 +180,23 @@



<map name="Uniform" >beast.math.distributions.Uniform</map>
<map name="Exponential" >beast.math.distributions.Exponential</map>
<map name="LogNormal" >beast.math.distributions.LogNormalDistributionModel</map>
<map name="Normal" >beast.math.distributions.Normal</map>
<map name="Beta" >beast.math.distributions.Beta</map>
<map name="Gamma" >beast.math.distributions.Gamma</map>
<map name="LaplaceDistribution" >beast.math.distributions.LaplaceDistribution</map>
<map name="prior" >beast.math.distributions.Prior</map>
<map name="InverseGamma" >beast.math.distributions.InverseGamma</map>
<map name="OneOnX" >beast.math.distributions.OneOnX</map>
<map name="Uniform" >beast.base.inference.distribution.Uniform</map>
<map name="Exponential" >beast.base.inference.distribution.Exponential</map>
<map name="LogNormal" >beast.base.inference.distribution.LogNormalDistributionModel</map>
<map name="Normal" >beast.base.inference.distribution.Normal</map>
<map name="Beta" >beast.base.inference.distribution.Beta</map>
<map name="Gamma" >beast.base.inference.distribution.Gamma</map>
<map name="LaplaceDistribution" >beast.base.inference.distribution.LaplaceDistribution</map>
<map name="prior" >beast.base.inference.distribution.Prior</map>
<map name="InverseGamma" >beast.base.inference.distribution.InverseGamma</map>
<map name="OneOnX" >beast.base.inference.distribution.OneOnX</map>


<run id="mcmc" spec="MCMC" chainLength="20000000">
<state id="state" storeEvery="50000000">

<tree id="Tree.t:bison_2013" name="stateNode">
<trait id="dateTrait.t:bison_2013" spec="beast.evolution.tree.TraitSet" traitname="date-backward">
<trait id="dateTrait.t:bison_2013" spec="beast.base.evolution.tree.TraitSet" traitname="date-backward">
U12959_0_0=0,
U12958_0_0=0,
U12957_0_0=0,
Expand Down Expand Up @@ -367,24 +366,24 @@
</state>

<!-- Initial tree -->
<init id="RandomTree.t:bison_2013" spec="beast.evolution.tree.RandomTree" estimate="false" initial="@Tree.t:bison_2013" taxa="@bison_2013">
<init id="RandomTree.t:bison_2013" spec="beast.base.evolution.tree.coalescent.RandomTree" estimate="false" initial="@Tree.t:bison_2013" taxa="@bison_2013">
<populationModel id="ConstantPopulation0.t:bison_2013" spec="ConstantPopulation">
<parameter id="randomPopSize.t:bison_2013" name="popSize">1.0</parameter>
</populationModel>
</init>

<distribution id="posterior" spec="util.CompoundDistribution">
<distribution id="posterior" spec="beast.base.inference.CompoundDistribution">

<!-- Begin prior -->
<distribution id="prior" spec="util.CompoundDistribution">
<distribution id="prior" spec="beast.base.inference.CompoundDistribution">

<!-- Treeprior (Bayesian Skyline Plot) -->
<distribution id="BayesianSkyline.t:bison_2013" spec="BESP" popSizeGroupSizes="@bGroupSizes.t:bison_2013" popSizes="@bPopSizes.t:bison_2013" minWidth="100" samplingIntensity="@bSamplingIntensity.t:bison_2013">
<treeIntervals id="BESPTreeIntervals.t:bison_2013" spec="TreeIntervals" tree="@Tree.t:bison_2013"/>
<treeIntervals id="BESPTreeIntervals.t:bison_2013" spec="beast.base.evolution.tree.TreeIntervals" tree="@Tree.t:bison_2013"/>
</distribution>

<!-- Smoothing prior -->
<distribution id="MarkovChainedPopSizes.t:bison_2013" spec="beast.math.distributions.MarkovChainDistribution" jeffreys="true" parameter="@bPopSizes.t:bison_2013"/>
<distribution id="MarkovChainedPopSizes.t:bison_2013" spec="beast.base.inference.distribution.MarkovChainDistribution" jeffreys="true" parameter="@bPopSizes.t:bison_2013"/>

<!-- Sampling Intensity Prior -->
<prior id="SamplingIntensityPrior.t:bison_2013" name="distribution" x="@bSamplingIntensity.t:bison_2013">
Expand All @@ -404,7 +403,7 @@
<!-- End prior -->

<!-- Begin likelihood -->
<distribution id="likelihood" spec="util.CompoundDistribution" useThreads="true">
<distribution id="likelihood" spec="beast.base.inference.CompoundDistribution" useThreads="true">

<!-- Alignment likelihood -->
<distribution id="treeLikelihood.bison_2013" spec="ThreadedTreeLikelihood" data="@bison_2013" tree="@Tree.t:bison_2013">
Expand All @@ -420,7 +419,7 @@
</siteModel>

<!-- Clock model (strict clock) -->
<branchRateModel id="StrictClock.c:bison_2013" spec="beast.evolution.branchratemodel.StrictClockModel" clock.rate="@clockRate.c:bison_2013"/>
<branchRateModel id="StrictClock.c:bison_2013" spec="beast.base.evolution.branchratemodel.StrictClockModel" clock.rate="@clockRate.c:bison_2013"/>

</distribution>
</distribution>
Expand Down Expand Up @@ -476,7 +475,7 @@
<log idref="freqParameter.s:bison_2013"/>
<log idref="clockRate.c:bison_2013"/>

<log id="TreeHeight.t:bison_2013" spec="beast.evolution.tree.TreeHeightLogger" tree="@Tree.t:bison_2013"/>
<log id="TreeHeight.t:bison_2013" spec="beast.base.evolution.tree.TreeHeightLogger" tree="@Tree.t:bison_2013"/>
<log idref="bPopSizes.t:bison_2013"/>
<log idref="bGroupSizes.t:bison_2013"/>
<log id="bPopSizeChangeTimes.t:bison_2013" spec="popSizeChangeTimeLogger" skyline="@BayesianSkyline.t:bison_2013"/>
Expand All @@ -493,7 +492,7 @@
</logger>

<logger id="treelog" fileName="output/$(filebase)_$(seed).trees" logEvery="10000" mode="tree">
<log id="TreeWithMetaDataLogger.t:bison_2013" spec="beast.evolution.tree.TreeWithMetaDataLogger" tree="@Tree.t:bison_2013"/>
<log id="TreeWithMetaDataLogger.t:bison_2013" spec="beast.base.evolution.TreeWithMetaDataLogger" tree="@Tree.t:bison_2013"/>
</logger>

</run>
Expand Down
Loading