use of beast.util.XMLParser in project bacter by tgvaughan.
the class CFOperatorTest method testCFCS.
@Test
public void testCFCS() throws Exception {
Randomizer.setSeed(1);
XMLParser parser = new XMLParser();
beast.core.Runnable runnable = parser.parseFile(new File("examples/CFOperatorTests/CFConversionSwapTest5taxon.xml"));
disableScreenLog(runnable);
runnable.run();
List<Expectation> expectations = new ArrayList<>();
expectations.add(new Expectation("acg.CFheight", 1.606, 0.2));
expectations.add(new Expectation("acg.CFlength", 4.181, 0.5));
expectations.add(new Expectation("acg.nConv", 21.0, 0.5));
new LogAnalyser("CFConversionSwapTest5taxon.stats", expectations);
for (Expectation expectation : expectations) {
assertTrue(expectation.isValid());
assertTrue(expectation.isPassed());
}
Files.deleteIfExists(Paths.get("CFConversionSwapTest5taxon.stats"));
Files.deleteIfExists(Paths.get("CFConversionSwapTest5taxon.converted"));
Files.deleteIfExists(Paths.get("CFConversionSwapTest5taxon.trees"));
Files.deleteIfExists(Paths.get("CFConversionSwapTest5taxon.cf"));
Files.deleteIfExists(Paths.get("CFConversionSwapTest5taxon.xml.state"));
}
use of beast.util.XMLParser in project bacter by tgvaughan.
the class RegionShiftTest method testBoundaryShift.
@Test
public void testBoundaryShift() throws Exception {
Randomizer.setSeed(1);
XMLParser parser = new XMLParser();
beast.core.Runnable runnable = parser.parseFile(new File("examples/regionShiftTests/boundaryShiftTest5taxon.xml"));
disableScreenLog(runnable);
runnable.run();
List<Expectation> expectations = new ArrayList<>();
expectations.add(new Expectation("acg.CFheight", 1.606, 0.2));
expectations.add(new Expectation("acg.CFlength", 4.181, 0.5));
expectations.add(new Expectation("acg.nConv", 21.0, 0.5));
LogAnalyser logAnalyser = new LogAnalyser("boundaryShiftTest5taxon.stats", expectations);
for (int i = 0; i < expectations.size(); i++) {
assertTrue(expectations.get(i).isValid());
assertTrue(expectations.get(i).isPassed());
}
Files.deleteIfExists(Paths.get("boundaryShiftTest5taxon.stats"));
Files.deleteIfExists(Paths.get("boundaryShiftTest5taxon.converted"));
Files.deleteIfExists(Paths.get("boundaryShiftTest5taxon.trees"));
Files.deleteIfExists(Paths.get("boundaryShiftTest5taxon.cf"));
Files.deleteIfExists(Paths.get("boundaryShiftTest5taxon.xml.state"));
}
use of beast.util.XMLParser in project bacter by tgvaughan.
the class SimulatedACGTest method test5TaxonSerialSampling.
@Test
public void test5TaxonSerialSampling() throws Exception {
Randomizer.setSeed(1);
XMLParser parser = new XMLParser();
beast.core.Runnable runnable = parser.parseFile(new File("examples/ACGsimulations/simulateACGs5taxonSerialSampling.xml"));
runnable.run();
List<Expectation> expectations = new ArrayList<>();
expectations.add(new Expectation("acg.CFheight", 1.909, 1e-2));
expectations.add(new Expectation("acg.CFlength", 4.655, 1e-2));
expectations.add(new Expectation("acg.nConv", 23.381, 5e-2));
LogAnalyser logAnalyser = new LogAnalyser("simulateACGs5taxonSerialSampling.stats", expectations);
for (int i = 0; i < expectations.size(); i++) {
assertTrue(expectations.get(i).isValid());
assertTrue(expectations.get(i).isPassed());
}
Files.deleteIfExists(Paths.get("simulateACGs5taxonSerialSampling.stats"));
Files.deleteIfExists(Paths.get("simulateACGs5taxonSerialSampling.converted"));
Files.deleteIfExists(Paths.get("simulateACGs5taxonSerialSampling.trees"));
}
use of beast.util.XMLParser in project bacter by tgvaughan.
the class SimulatedACGTest method test5TaxonMultiLocus.
@Test
public void test5TaxonMultiLocus() throws Exception {
Randomizer.setSeed(1);
XMLParser parser = new XMLParser();
beast.core.Runnable runnable = parser.parseFile(new File("examples/ACGsimulations/simulateACGs5taxonMultiLocus.xml"));
runnable.run();
List<Expectation> expectations = new ArrayList<>();
expectations.add(new Expectation("acg.CFheight", 1.917, 1e-2));
expectations.add(new Expectation("acg.CFlength", 4.672, 1e-2));
expectations.add(new Expectation("acg.nConv", 23.614, 5e-2));
LogAnalyser logAnalyser = new LogAnalyser("simulateACGs5taxonMultiLocus.stats", expectations);
for (int i = 0; i < expectations.size(); i++) {
assertTrue(expectations.get(i).isValid());
assertTrue(expectations.get(i).isPassed());
}
Files.deleteIfExists(Paths.get("simulateACGs5taxonMultiLocus.stats"));
Files.deleteIfExists(Paths.get("simulateACGs5taxonMultiLocus.converted"));
Files.deleteIfExists(Paths.get("simulateACGs5taxonMultiLocus.trees"));
}
use of beast.util.XMLParser in project bacter by tgvaughan.
the class SimulatedACGTest method test2Taxon.
@Test
public void test2Taxon() throws Exception {
Randomizer.setSeed(1);
XMLParser parser = new XMLParser();
beast.core.Runnable runnable = parser.parseFile(new File("examples/ACGsimulations/simulateACGs2taxon.xml"));
runnable.run();
List<Expectation> expectations = new ArrayList<>();
expectations.add(new Expectation("acg.CFheight", 1.0, 1e-2));
expectations.add(new Expectation("acg.CFlength", 2.0, 1e-2));
expectations.add(new Expectation("acg.nConv", 10.0, 5e-2));
LogAnalyser logAnalyser = new LogAnalyser("simulateACGs2taxon.stats", expectations);
for (int i = 0; i < expectations.size(); i++) {
assertTrue(expectations.get(i).isValid());
assertTrue(expectations.get(i).isPassed());
}
Files.deleteIfExists(Paths.get("simulateACGs2taxon.stats"));
Files.deleteIfExists(Paths.get("simulateACGs2taxon.converted"));
Files.deleteIfExists(Paths.get("simulateACGs2taxon.trees"));
}
Aggregations