Skip to content

Commit

Permalink
Merge pull request #14 from jordandouglas/master
Browse files Browse the repository at this point in the history
CoalRe for beast 2.7
  • Loading branch information
nicfel authored Dec 15, 2022
2 parents 9369ea7 + 60e835a commit 3cb6fdd
Show file tree
Hide file tree
Showing 73 changed files with 314 additions and 237 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,21 @@ WORKDIR /root
ADD . ./

ENTRYPOINT ant test



# Dockerfile to build container for unit testing

FROM debian:stable

RUN apt-get update
RUN apt-get install -y openjdk-17-jdk openjfx
RUN apt-get install -y ant
RUN apt-get install -y jblas

WORKDIR /root

ADD . ./


ENTRYPOINT JAVA_FX_HOME=/usr/share/java/ ant test
19 changes: 13 additions & 6 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- 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,8 +44,8 @@

<!-- 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}"/>
Expand Down Expand Up @@ -100,11 +100,12 @@
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${beastDir}/lib" includes="*.jar"/>
<pathelement path="../BeastFX/build"/>
</classpath>
</javac>
<jar jarfile="${build-lib}/beast2.jar" basedir="${build-beast}" />
<copy todir="${build-lib}">
<fileset dir="${beastDir}/lib" includes="*.jar"/>
<fileset dir="${beastDir}/lib" includes="colt.jar"/>
</copy>

<delete dir="${build-beast}" />
Expand All @@ -118,6 +119,7 @@
<classpath>
<pathelement path="${classpath}"/>
<fileset dir="${build-lib}" includes="*.jar"/>
<pathelement path="../BeastFX/build"/>
</classpath>
</javac>
</target>
Expand All @@ -143,6 +145,10 @@
<pathelement path="${classpath}"/>
<pathelement path="${build}" />
<fileset dir="${build-lib}" includes="*.jar"/>
<fileset dir="${beastDir}/lib" includes="*.jar"/>
<fileset dir="${beastDir}/lib/junit" includes="*.jar"/>
<pathelement path="../BeastFX/build"/>
<pathelement path="${beastDir}/build"/>
</classpath>
</javac>
</target>
Expand All @@ -156,6 +162,7 @@
<pathelement path="${build}" />
<pathelement path="${build-test}" />
<fileset dir="${build-lib}" includes="*.jar"/>
<fileset dir="${beastDir}/lib/junit" includes="*.jar"/>
</classpath>
<batchtest fork="yes" todir="${test-reports}">
<fileset dir="${test}">
Expand All @@ -176,7 +183,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 @@ -202,7 +209,7 @@
</copy>

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

Expand Down
20 changes: 9 additions & 11 deletions templates/CoalRe.xml → fxtemplates/CoalRe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,20 @@
inlineInputs="coalre.distribution.CoalescentWithReassortment.networkIntervals"
suppressInputs="coalre.distribution.NetworkIntervals.network">
<![CDATA[
<stateNode id="reassortmentRateCwR.alltrees" spec="beast.core.parameter.RealParameter" value="0.1" estimate="true"/>
<stateNode id="popSizeCwR.alltrees" spec="beast.core.parameter.RealParameter" value="1.0" estimate="true"/>
<stateNode id="binomialProbCwR.alltrees" spec="beast.core.parameter.RealParameter" lower="0.0" upper="1.0" value="0.5" estimate="false"/>
<stateNode id="reassortmentRateCwR.alltrees" spec="beast.base.inference.parameter.RealParameter" value="0.1" estimate="true"/>
<stateNode id="popSizeCwR.alltrees" spec="beast.base.inference.parameter.RealParameter" value="1.0" estimate="true"/>
<stateNode id="binomialProbCwR.alltrees" spec="beast.base.inference.parameter.RealParameter" lower="0.0" upper="1.0" value="0.5" estimate="false"/>
<stateNode id="networkCwR.alltrees" spec="coalre.simulator.SimulatedCoalescentNetwork" nSegments="1"
enableSegmentTreeUpdate="false" estimate="true">
<reassortmentRate spec="beast.core.parameter.RealParameter" value="0.0"/>
<populationModel spec="beast.evolution.tree.coalescent.ConstantPopulation">
<popSize spec="beast.core.parameter.RealParameter" value="1.0"/>
<reassortmentRate spec="beast.base.inference.parameter.RealParameter" value="0.0"/>
<populationModel spec="beast.base.evolution.tree.coalescent.ConstantPopulation">
<popSize spec="beast.base.inference.parameter.RealParameter" value="1.0"/>
</populationModel>
<taxonSet spec="beast.evolution.alignment.TaxonSet" alignment="@$(n)"/>
<taxonSet spec="beast.base.evolution.alignment.TaxonSet" alignment="@$(n)"/>
</stateNode>
<init id="networkCwR.segmentInitializer" spec="SegmentTreeInitializer" network="@networkCwR.alltrees">
</init>
<init id="segmentTreeInitializerCwR.t:$(n)" spec="coalre.network.SegmentTreeInitializer"
network="@networkCwR.alltrees">
Expand All @@ -49,7 +47,7 @@
<prior spec="coalre.distribution.CoalescentWithReassortment" id="CoalescentWithReassortmentPrior.alltrees">
<reassortmentRate idref="reassortmentRateCwR.alltrees"/>
<populationModel id="constantPopSizeCwR.alltrees" spec="beast.evolution.tree.coalescent.ConstantPopulation">
<populationModel id="constantPopSizeCwR.alltrees" spec="beast.base.evolution.tree.coalescent.ConstantPopulation">
<popSize idref="popSizeCwR.alltrees"/>
</populationModel>
<networkIntervals id="networkIntervalsCwR.alltrees" spec="coalre.distribution.NetworkIntervals">
Expand All @@ -68,7 +66,7 @@
</prior>
<prior id="binomialProbCwRPrior.alltrees" x="@binomialProbCwR.alltrees">
<distr spec="beast.math.distributions.Uniform" lower="0" upper="1"/>
<distr spec="beast.base.inference.distribution.Uniform" lower="0" upper="1"/>
</prior>
Expand Down
Binary file added lib/antlr-runtime-4.7.jar
Binary file not shown.
10 changes: 5 additions & 5 deletions src/coalre/distribution/CoalescentWithReassortment.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package coalre.distribution;

import beast.core.CalculationNode;
import beast.core.Description;
import beast.core.Function;
import beast.core.Input;
import beast.evolution.tree.coalescent.PopulationFunction;
import beast.base.inference.CalculationNode;
import beast.base.core.Description;
import beast.base.core.Function;
import beast.base.core.Input;
import beast.base.evolution.tree.coalescent.PopulationFunction;

import java.util.List;

Expand Down
8 changes: 4 additions & 4 deletions src/coalre/distribution/NetworkDistribution.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package coalre.distribution;

import beast.core.Distribution;
import beast.core.Input;
import beast.core.Input.Validate;
import beast.core.State;
import beast.base.inference.Distribution;
import beast.base.core.Input;
import beast.base.core.Input.Validate;
import beast.base.inference.State;

import java.util.List;
import java.util.Random;
Expand Down
10 changes: 5 additions & 5 deletions src/coalre/distribution/NetworkIntervals.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@



import beast.core.CalculationNode;
import beast.core.Function;
import beast.core.Input;
import beast.core.Input.Validate;
import beast.core.parameter.RealParameter;
import beast.base.inference.CalculationNode;
import beast.base.core.Function;
import beast.base.core.Input;
import beast.base.core.Input.Validate;
import beast.base.inference.parameter.RealParameter;
import coalre.network.Network;

import java.util.ArrayList;
Expand Down
20 changes: 10 additions & 10 deletions src/coalre/distribution/TipPrior.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
import java.util.Random;
import java.util.Set;

import beast.core.Description;
import beast.core.Distribution;
import beast.core.Input;
import beast.core.Input.Validate;
import beast.core.State;
import beast.core.parameter.RealParameter;
import beast.evolution.alignment.TaxonSet;
import beast.evolution.tree.Node;
import beast.evolution.tree.Tree;
import beast.math.distributions.ParametricDistribution;
import beast.base.core.Description;
import beast.base.inference.Distribution;
import beast.base.core.Input;
import beast.base.core.Input.Validate;
import beast.base.inference.State;
import beast.base.inference.parameter.RealParameter;
import beast.base.evolution.alignment.TaxonSet;
import beast.base.evolution.tree.Node;
import beast.base.evolution.tree.Tree;
import beast.base.inference.distribution.ParametricDistribution;
import coalre.network.Network;
import coalre.network.NetworkNode;

Expand Down
16 changes: 8 additions & 8 deletions src/coalre/distribution/emptyNetworkEdgesPrior.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package coalre.distribution;

import beast.core.Description;
import beast.core.Function;
import beast.core.Input;
import beast.core.Input.Validate;
import beast.core.parameter.IntegerParameter;
import beast.core.parameter.RealParameter;
import beast.evolution.tree.coalescent.PopulationFunction;
import beast.math.distributions.ParametricDistribution;
import beast.base.core.Description;
import beast.base.core.Function;
import beast.base.core.Input;
import beast.base.core.Input.Validate;
import beast.base.inference.parameter.IntegerParameter;
import beast.base.inference.parameter.RealParameter;
import beast.base.evolution.tree.coalescent.PopulationFunction;
import beast.base.inference.distribution.ParametricDistribution;
import coalre.network.NetworkEdge;

import java.util.BitSet;
Expand Down
8 changes: 4 additions & 4 deletions src/coalre/network/Network.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package coalre.network;

import beast.core.StateNode;
import beast.evolution.alignment.TaxonSet;
import beast.evolution.tree.Node;
import beast.evolution.tree.Tree;
import beast.base.inference.StateNode;
import beast.base.evolution.alignment.TaxonSet;
import beast.base.evolution.tree.Node;
import beast.base.evolution.tree.Tree;
import coalre.network.parser.NetworkBaseVisitor;
import coalre.network.parser.NetworkLexer;
import coalre.network.parser.NetworkParser;
Expand Down
4 changes: 2 additions & 2 deletions src/coalre/network/NetworkNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import java.util.Map;
import java.util.TreeMap;

import beast.evolution.tree.TraitSet;
import beast.evolution.tree.Tree;
import beast.base.evolution.tree.TraitSet;
import beast.base.evolution.tree.Tree;

public class NetworkNode {

Expand Down
10 changes: 5 additions & 5 deletions src/coalre/network/SegmentTreeInitializer.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package coalre.network;

import beast.core.BEASTObject;
import beast.core.Input;
import beast.core.StateNode;
import beast.core.StateNodeInitialiser;
import beast.evolution.tree.Tree;
import beast.base.core.BEASTObject;
import beast.base.core.Input;
import beast.base.inference.StateNode;
import beast.base.inference.StateNodeInitialiser;
import beast.base.evolution.tree.Tree;
import cern.colt.Arrays;

import java.util.ArrayList;
Expand Down
16 changes: 8 additions & 8 deletions src/coalre/networkannotator/ColoredTreeExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

package coalre.networkannotator;

import beast.core.BEASTObject;
import beast.core.Function;
import beast.core.parameter.Parameter;
import beast.core.parameter.RealParameter;
import beast.core.util.Log;
import beast.evolution.branchratemodel.BranchRateModel;
import beast.evolution.tree.Node;
import beast.evolution.tree.Tree;
import beast.base.core.BEASTObject;
import beast.base.core.Function;
import beast.base.inference.parameter.Parameter;
import beast.base.inference.parameter.RealParameter;
import beast.base.core.Log;
import beast.base.evolution.branchratemodel.BranchRateModel;
import beast.base.evolution.tree.Node;
import beast.base.evolution.tree.Tree;
import coalre.network.Network;
import coalre.network.NetworkEdge;
import coalre.network.NetworkNode;
Expand Down
2 changes: 1 addition & 1 deletion src/coalre/networkannotator/NetworkCladeSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import javax.swing.plaf.synth.SynthSeparatorUI;

import beast.math.statistic.DiscreteStatistics;
import beast.base.util.DiscreteStatistics;
import coalre.network.Network;
import coalre.network.NetworkEdge;
import coalre.network.NetworkNode;
Expand Down
2 changes: 1 addition & 1 deletion src/coalre/networkannotator/ReassortmentAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package coalre.networkannotator;

import beast.util.Randomizer;
import beast.base.util.Randomizer;
import coalre.network.Network;
import coalre.network.NetworkEdge;
import coalre.network.NetworkNode;
Expand Down
2 changes: 1 addition & 1 deletion src/coalre/networkannotator/ReassortmentDistance.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package coalre.networkannotator;

import beast.core.util.Log;
import beast.base.core.Log;
import coalre.network.Network;
import coalre.network.NetworkEdge;
import coalre.network.NetworkNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.util.List;
import java.util.Set;

import beast.math.statistic.DiscreteStatistics;
import beast.base.util.DiscreteStatistics;
import coalre.network.Network;
import coalre.network.NetworkEdge;
import coalre.network.NetworkNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package coalre.networkannotator;

import beast.core.util.Log;
import beast.base.core.Log;
import coalre.network.Network;
import coalre.network.NetworkNode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package coalre.networkannotator;

import beast.core.util.Log;
import beast.base.core.Log;
import coalre.network.Network;
import coalre.network.NetworkNode;

Expand Down
2 changes: 1 addition & 1 deletion src/coalre/networkannotator/TrunkReassortment.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package coalre.networkannotator;

import beast.core.util.Log;
import beast.base.core.Log;
import coalre.network.Network;
import coalre.network.NetworkEdge;
import coalre.network.NetworkNode;
Expand Down
6 changes: 3 additions & 3 deletions src/coalre/operators/AddRemoveReassortment.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package coalre.operators;

import beast.core.Input;
import beast.util.Package;
import beast.util.Randomizer;
import beast.base.core.Input;
import beast.pkgmgmt.Package;
import beast.base.util.Randomizer;
import coalre.network.Network;
import coalre.network.NetworkEdge;
import coalre.network.NetworkNode;
Expand Down
4 changes: 2 additions & 2 deletions src/coalre/operators/AddRemoveReassortmentCoalescent.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package coalre.operators;

import beast.core.Input;
import beast.util.Randomizer;
import beast.base.core.Input;
import beast.base.util.Randomizer;
import coalre.distribution.CoalescentWithReassortment;
import coalre.distribution.NetworkEvent;
import coalre.network.NetworkEdge;
Expand Down
Loading

0 comments on commit 3cb6fdd

Please sign in to comment.