Skip to content

Commit

Permalink
Some refactoring to remove duplicates, and getting package ready for …
Browse files Browse the repository at this point in the history
…BEAUTI.
  • Loading branch information
denisekuehnert committed May 2, 2016
1 parent 8bf5e2d commit 3575817
Show file tree
Hide file tree
Showing 10 changed files with 1,096 additions and 734 deletions.
211 changes: 211 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
<!-- Build BDMM. It is also used by Hudson BDMM project. JUnit test is available for this build. -->
<project basedir="." default="build_jar_all_BDMM" name="BUILD_BDMM">
<description>
Build BDMM.
Also used by Hudson BDMM project.
JUnit test is available for this build.
$Id: build_BDMM.xml $
</description>

<!-- set global properties for this build -->
<property name="srcBDMM" location="src" />
<property name="buildBDMM" location="build" />
<property name="libBDMM" location="lib" />
<property name="release_dir" value="release" />
<property name="distBDMM" location="${buildBDMM}/dist" />
<property name="beast2path" location="../beast2" />
<property name="libBeast2" location="${beast2path}/lib" />
<property name="srcBeast2" location="${beast2path}/src" />
<property name="beast2classpath" location="${beast2path}/build" />
<property name="masterclasspath" location="../MASTER/build" />
<property name="mttclasspath" location="../MultiTypeTree/build" />
<property name="sampledancestorclasspath" location="..out/production/sampled-ancestors" />
<property name="Add_on_dir" value="${release_dir}/add-on" />

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

<property name="main_class_BEAST" value="beast.app.BeastMCMC" />
<property name="report" value="${buildBDMM}/junitreport"/>

<path id="classpath">
<pathelement path="${buildBDMM}"/>
<fileset dir="${libBeast2}" includes="junit-4.8.2.jar"/>
<fileset dir="${libBeast2}" includes="fest.jar"/>
<fileset dir="${libBeast2}" includes="jam.jar"/>
<fileset dir="${libBeast2}" includes="commons-math3-3.1.1.jar"/>
<fileset dir="${libBeast2}" includes="antlr-runtime-4.5.jar"/>
<fileset dir="../MultiTypeTree/build-lib" includes="guava-15.0.jar"/>
<pathelement path="${beast2classpath}"/>
<pathelement path="${masterclasspath}"/>
<pathelement path="${mttclasspath}"/>
<pathelement path="${sampledancestorclasspath}"/>
</path>

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

<target name="cleanBDMM">
<delete dir="${buildBDMM}" />
</target>

<!-- clean previous build, and then compile Java source code, and Juint test -->
<target name="build_all_BDMM" depends="cleanBDMM,compile-allBDMM,junitBDMM"
description="Clean and Build all run-time stuff">
</target>

<!-- clean previous build, compile Java source code, and Junit test, and make the beast.jar and beauti.jar -->
<target name="build_jar_all_BDMM" depends="cleanBDMM,compile-allBDMM,junitBDMM,dist_all_BDMM"
description="Clean and Build all run-time stuff">
</target>


<!-- No JUnit Test, clean previous build, compile Java source code, and make the BDMM.jar and beauti.jar -->
<target name="build_jar_all_BDMM_NoJUnitTest" depends="cleanBDMM,compile-allBDMM,dist_all_BDMM"
description="Clean and Build all run-time stuff">
</target>

<!-- compile Java source code -->
<target name="compile-allBDMM" depends="initBDMM,compile-all">


<!-- Capture the path as a delimited property using the refid attribute -->
<property name="myclasspath" refid="classpath"/>
<!-- Emit the property to the ant console -->
<echo message="Classpath = ${myclasspath}"/>

<mkdir dir="${buildBDMM}" />

<!-- Compile the java code from ${srcBDMM} into ${buildBDMM} /bin -->
<javac srcdir="${srcBDMM}" destdir="${buildBDMM}" classpathref="classpath"
fork="true"
memoryinitialsize="256m"
memorymaximumsize="256m"
includeAntRuntime='false'
source="1.8"
target="1.8">
<include name="beast/**/**" />
<!-- compile JUnit test classes -->
<include name="test/beast/**" />
</javac>
<echo message="Successfully compiled." />
</target>

<!-- make the beast.jar and beauti.jar -->
<target name="dist_all_BDMM" depends="compile-allBDMM" description="create BDMM jar">
<!-- Create the distribution directory -->
<mkdir dir="${distBDMM}" />

<!-- Put everything in ${buildBDMM} into the beast.jar file -->
<jar jarfile="${distBDMM}/BDMM.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${main_class_BEAST}" />
</manifest>
<fileset dir="${buildBDMM}">
<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="${distBDMM}/BDMM.src.jar">
<fileset dir="${srcBDMM}">
<include name="beast/**/*.java" />
<include name="beast/**/*.png" />
<include name="beast/**/*.xsl" />
</fileset>
</jar>
<jar jarfile="${distBDMM}/BDMM.addon.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
<fileset dir="${buildBDMM}">
<include name="beast/**/*.class" />
<include name="util/**/*.class" />
<include name="**/*.properties" />
</fileset>
</jar>
</target>

<!-- run beast.jar -->
<target name="run_BDMM">
<java jar="${distBDMM}/BDMM.jar" fork="true" />
</target>


<!-- JUnit test -->
<target name="junitBDMM">
<mkdir dir="${report}" />
<junit printsummary="yes"> <!--showoutput='yes'-->
<classpath>
<path refid="classpath" />
<path location="${buildBDMM}" />
</classpath>

<formatter type="xml" />

<batchtest fork="yes" todir="${report}">
<fileset dir="${srcBDMM}">
<include name="test/**/*Test.java"/>
</fileset>
<fileset dir="${srcBeast2}">
<include name="test/beast/integration/**/*Test.java"/>
<exclude name="test/beast/integration/**/ResumeTest.java"/>
</fileset>
</batchtest>
</junit>
<echo message="JUnit test finished." />
</target>

<target name="junitreport">
<junitreport todir="${report}">
<fileset dir="${report}" includes="*.xml"/>
<report format="frames" todir="${report}"/>
</junitreport>
<echo message="JUnit test report finished." />
</target>


<target name="addon"
depends="build_jar_all_BDMM_NoJUnitTest"
description="release BEAST 2 add-on version of BDMM">

<delete dir="${Add_on_dir}" />
<!-- Create the release directory -->
<mkdir dir="${Add_on_dir}" />
<mkdir dir="${Add_on_dir}/lib" />
<mkdir dir="${Add_on_dir}/examples" />
<mkdir dir="${Add_on_dir}/templates" />

<copy todir="${Add_on_dir}">
<fileset file="version.xml"/>
</copy>
<copy todir="${Add_on_dir}/examples">
<fileset dir="examples" />
</copy>
<copy todir="${Add_on_dir}/lib">
<fileset dir="${distBDMM}" includes="BDMM.addon.jar" />
</copy>
<copy todir="${Add_on_dir}">
<fileset dir="${distBDMM}" includes="BDMM.src.jar" />
</copy>
<!--copy todir="${Add_on_dir}/templates">
<fileset file="templates/BDSKY_contemp.xml" />
<fileset file="templates/BDSKY_serial.xml" />
</copy-->

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

</project>
8 changes: 4 additions & 4 deletions examples/BDMM_migration_example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@
<stateNode idref="rateMatrix"/>
<parameter id="clockRate" name="stateNode" value="8.05e-3"/> <!-- 8.05e-3 is what Lemey et all estimated, personal communication-->
<parameter dimension="6" id="samplingProportion" lower="0.0" name="stateNode" upper="1.0" value="0. 0.01 0. 0.01 0. 0.01"/>
<parameter dimension="3" id="becomeUninfectiousRate" lower="0.0" name="stateNode" value="80"/>
<parameter dimension="3" id="becomeUninfectiousRate" lower="0.0" name="stateNode" value="40"/>
<parameter dimension="3" id="R0" lower="0.0" name="stateNode" value="1.3"/>
<plate spec='util.Plate' var='n' range='1+2,3'> <!--.CP$(n)-->
<parameter idref="mutationRate.CP$(n)" name="stateNode">1.0</parameter>
<parameter dimension="4" id="freqParameter.CP$(n)" lower="0.0" name="stateNode" upper="1.0" value="0.25"/>
<parameter id="kappa.CP$(n)" lower="0.0" name="stateNode" value="7"/>
</plate>
<stateNode idref="geo-frequencies"/>
<stateNode idref="weightparameter"/>
<!--stateNode idref="weightparameter"/-->
</state>

<distribution id="posterior" spec="util.CompoundDistribution">
Expand Down Expand Up @@ -286,11 +286,11 @@
<operator spec="TypedWilsonBalding" id="CWB" weight="3" multiTypeTree="@tree" alpha="0.1" migrationModel="@migModel"/>

<!-- <operator id="clockRateScaler" parameter="@clockRate" scaleFactor="0.9" spec="ScaleOperator" weight="1"/>-->
<operator delta="0.75" id="FixMeanMutationRatesOperator" spec="DeltaExchangeOperator" weight="2.0">
<!--operator delta="0.75" id="FixMeanMutationRatesOperator" spec="DeltaExchangeOperator" weight="2.0">
<parameter idref="mutationRate.CP1+2"/>
<parameter idref="mutationRate.CP3"/>
<weightvector dimension="2" estimate="false" id="weightparameter" lower="0" spec="parameter.IntegerParameter" upper="0">658 329</weightvector>
</operator>
</operator-->

<plate spec='util.Plate' var='n' range='1+2,3'> <!--.CP$(n)-->
<operator id="KappaScaler.CP$(n)" parameter="@kappa.CP$(n)" scaleFactor="0.75" spec="ScaleOperator" weight="0.1"/>
Expand Down
4 changes: 2 additions & 2 deletions examples/BDMUC_example_SequenceSimAnaLyzer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
<logger fileName="BDMUC_SequenceSimAnaLyzer_$(seed).trees" logEvery="10000" mode="autodetect"
log="@tree"/>

<!--logger id="screenlog" logEvery="1000" mode="autodetect">
<logger id="screenlog" logEvery="1000" mode="autodetect">
<distribution idref="posterior" name="log"/>
<log arg="@posterior" id="ESS.0" spec="util.ESS"/>
<log idref="treePrior"/>
Expand All @@ -314,7 +314,7 @@
<log idref="becomeUninfectiousRate"/>
<log idref="rateMatrix"/>
<log idref="mutationRate"/>
</logger-->
</logger>
</run>

</beast>
Loading

0 comments on commit 3575817

Please sign in to comment.