Skip to content

Commit

Permalink
more BEAST v2.7 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed Feb 20, 2023
1 parent f774608 commit df1f39d
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 122 deletions.
51 changes: 19 additions & 32 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,27 @@

<path id="classpath">
<pathelement path="${buildphylodynamics}"/>
<fileset dir="${libBeast2}" includes="junit-4.8.2.jar"/>
<fileset dir="${libBeast2}/junit" includes="junit-*.jar"/>
<fileset dir="${lib}" includes="colt.jar"/>
<fileset dir="${libBeast2}" includes="fest.jar"/>
<fileset dir="${libBeast2}" includes="jam.jar"/>
<fileset dir="${libBeast2}" includes="beagle.jar"/>
<fileset dir="${libBeast2}" includes="commons-math3-3.1.1.jar"/>
<fileset dir="${libBeast2}" includes="antlr-runtime-4.7.jar"/>
<fileset dir="${libBeast2}" includes="commons-math3-3.6.1.jar"/>
<fileset dir="${libBeast2}" includes="antlr-runtime-4.10.1.jar"/>
<pathelement path="${beast2classpath}"/>
<!--pathelement path="${beastlabsclasspath}"/-->
<pathelement path="${bdskyclasspath}"/>
<!--<pathelement path="${masterclasspath}"/>-->
</path>

<!-- start -->
<target name="initphylodynamics">
<echo message="${ant.project.name}: ${ant.file}" />

<available file="./version.xml" property="versionAvailable"/>
<fail unless="versionAvailable">
** Required file version.xml does not exist. **
</fail>

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

<target name="cleanphylodynamics">
Expand Down Expand Up @@ -86,7 +91,7 @@
includeAntRuntime='false'
source="1.8"
target="1.8">
<include name="beast/**/**" />
<include name="phylodynamics/**/**" />
<!-- compile JUnit test classes -->
<include name="test/beast/**" />
<include name="test/phylodynamics/**" />
Expand All @@ -102,37 +107,19 @@
<!-- Create the distribution directory -->
<mkdir dir="${distphylodynamics}" />

<!-- Put everything in ${buildphylodynamics} into the beast.jar file -->
<jar jarfile="${distphylodynamics}/phylodynamics.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${main_class_BEAST}" />
</manifest>
<fileset dir="${buildphylodynamics}">
<include name="beast/**/*.class" />
</fileset>
<fileset dir="${beast2classpath}">
<include name="beast/**/*.class" />
<include name="beast/**/*.properties" />
<include name="beast/**/*.png" />
<include name="beagle/**/*.class" />
<include name="org/**/*.class" />
</fileset>
</jar>
<jar jarfile="${distphylodynamics}/phylodynamics.src.jar">
<fileset dir="${srcphylodynamics}">
<include name="beast/**/*.java" />
<include name="beast/**/*.png" />
<include name="beast/**/*.xsl" />
<include name="phylodynamics/**/*.java" />
<include name="phylodynamics/**/*.png" />
<include name="phylodynamics/**/*.xsl" />
</fileset>
</jar>
<jar jarfile="${distphylodynamics}/phylodynamics.addon.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
<fileset dir="${buildphylodynamics}">
<include name="beast/**/*.class" />
<include name="util/**/*.class" />
<include name="phylodynamics/**/*.class" />
<include name="**/*.properties" />
</fileset>
</jar>
Expand Down Expand Up @@ -206,12 +193,12 @@
<fileset file="fxtemplates/BDSIR_serial.xml" />
</copy>

<jar jarfile="${distphylodynamics}/phylodynamics.addon.zip">
<jar jarfile="${distphylodynamics}/phylodynamics.addon.v${phylodynamicsVersion}.zip">
<fileset dir="${Add_on_dir}">
<include name="**/*" />
</fileset>
</jar>
<echo message="Add-on version release is finished." />
<echo message="Add-on version release ${phylodynamicsVersion} is finished." />
</target>

</project>
4 changes: 2 additions & 2 deletions examples/BDSIR.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<beast version='2.0'
namespace='beast.phylodynamics:beast.phylodynamics.epidemiology: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:beast.base.evolution.speciation:beast.base.inference.parameter'>
namespace='phylodynamics:phylodynamics.epidemiology: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:beast.base.evolution.speciation:beast.base.inference.parameter'>


<tree spec='beast.base.evolution.tree.TreeParser' id='tree' IsLabelledNewick='true' adjustTipHeights='false'>
Expand All @@ -11,7 +11,7 @@
</input>
</tree>

<BDSIR spec="beast.phylodynamics.BDSIR" id="birthDeath" tree="@tree" dS="@dS" dR="@dR" checkTreeConsistent="false">
<BDSIR spec="phylodynamics.BDSIR" id="birthDeath" tree="@tree" dS="@dS" dR="@dR" checkTreeConsistent="false">
<!--origin must > tree height(12.485382039003651)-->
<parameter name="origin" id="origin" value ="15"/>
<parameter name="reproductiveNumber" id="reproductiveNumber" value="2.5" lower="0." upper="10."/>
Expand Down
20 changes: 10 additions & 10 deletions examples/BDSIR_contemp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

<distribution id="posterior" spec="beast.base.inference.CompoundDistribution">
<distribution id="prior" spec="beast.base.inference.CompoundDistribution">
<distribution reproductiveNumber="@reproductiveNumberEc.t:3" S0="@S0Ec.t:3" becomeUninfectiousRate="@becomeUninfectiousRateEc.t:3" contemp="true" dR="@dR.t:3" dS="@dS.t:3" id="BDSIRcontemp.t:3" origin="@originEc.t:3" rho="@rhoEc.t:3" spec="beast.phylodynamics.BDSIR" tree="@Tree.t:3">
<distribution reproductiveNumber="@reproductiveNumberEc.t:3" S0="@S0Ec.t:3" becomeUninfectiousRate="@becomeUninfectiousRateEc.t:3" contemp="true" dR="@dR.t:3" dS="@dS.t:3" id="BDSIRcontemp.t:3" origin="@originEc.t:3" rho="@rhoEc.t:3" spec="phylodynamics.BDSIR" tree="@Tree.t:3">
<parameter id="samplingEc.t:3" lower="0.0" name="samplingProportion" upper="1.0">0.0</parameter>
</distribution>
<prior id="reproductiveNumberPriorEc.t:3" name="distribution" x="@reproductiveNumberEc.t:3">
Expand Down Expand Up @@ -110,9 +110,9 @@

<operator id="KappaScaler.s:3" parameter="@kappa.s:3" scaleFactor="0.5" spec="ScaleOperator" weight="0.1"/>

<operator S0="@S0Ec.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_tree_operator.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="beast.phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="5.0">
<operator S0="@S0Ec.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_tree_operator.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="5.0">
<affectingOperator id="ScaleOperator.0" scaleFactor="0.9" spec="ScaleOperator" tree="@Tree.t:3" weight="5.0"/>
<SIR Nsamples="101" Nt="10000" S0="@S0Ec.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" simulationType="SAL" spec="beast.phylodynamics.epidemiology.HybridSEIREpidemic">
<SIR Nsamples="101" Nt="10000" S0="@S0Ec.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" simulationType="SAL" spec="phylodynamics.epidemiology.HybridSEIREpidemic">
<birth expression="reproductiveNumberEc.t:3 S0Ec.t:3 / becomeUninfectiousRateEc.t:3 *" id="birthEc.t:3" spec="beast.base.inference.util.RPNcalculator">
<parameter idref="becomeUninfectiousRateEc.t:3"/>
<parameter idref="reproductiveNumberEc.t:3"/>
Expand All @@ -122,31 +122,31 @@
<birth idref="birthEc.t:3"/>
</operator>

<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_treeRoot_operator.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="beast.phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="5.0">
<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_treeRoot_operator.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="5.0">
<affectingOperator id="ScaleOperator.01" rootOnly="true" scaleFactor="0.9" spec="ScaleOperator" tree="@Tree.t:3" weight="1.0"/>
</operator>

<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_subtreeslide_operator.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="beast.phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="15.0">
<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_subtreeslide_operator.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="15.0">
<affectingOperator id="SubtreeSlide.0" spec="SubtreeSlide" tree="@Tree.t:3" weight="1.0"/>
</operator>

<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_origin_operatorEc.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="beast.phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="3.0">
<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_origin_operatorEc.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="3.0">
<affectingOperator id="originOperatorEc.t:3" parameter="@originEc.t:3" scaleFactor="0.9" spec="ScaleOperator" weight="1.0"/>
</operator>

<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_rho_operatorEc.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="beast.phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="3.0">
<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_rho_operatorEc.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="3.0">
<affectingOperator id="rhoOperatorEc.t:3" parameter="@rhoEc.t:3" scaleFactor="0.9" spec="ScaleOperator" weight="1.0"/>
</operator>

<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_becomeUninfectiousRate_operatorEc.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="beast.phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="3.0">
<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_becomeUninfectiousRate_operatorEc.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="3.0">
<affectingOperator id="becomeUninfectiousRateOperatorEc.t:3" parameter="@becomeUninfectiousRateEc.t:3" scaleFactor="0.9" spec="ScaleOperator" weight="1.0"/>
</operator>

<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_reproductiveNumber_operatorEc.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="beast.phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="3.0">
<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_reproductiveNumber_operatorEc.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="3.0">
<affectingOperator id="reproductiveNumberOperatorEc.t:3" parameter="@reproductiveNumberEc.t:3" scaleFactor="0.9" spec="ScaleOperator" weight="1.0"/>
</operator>

<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_S0_operatorEc.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="beast.phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="3.0">
<operator S0="@S0Ec.t:3" SIR="@SIR.t:3" birth="@birthEc.t:3" dR="@dR.t:3" dS="@dS.t:3" death="@becomeUninfectiousRateEc.t:3" id="SIR_S0_operatorEc.t:3" origin="@originEc.t:3" sampling="@samplingEc.t:3" spec="phylodynamics.epidemiology.CompoundSIROperator" tree="@Tree.t:3" weight="3.0">
<affectingOperator id="S0OperatorEc.t:3" parameter="@S0Ec.t:3" scaleFactor="0.9" spec="ScaleOperator" weight="1.0"/>
</operator>

Expand Down
Loading

0 comments on commit df1f39d

Please sign in to comment.