use of beast.util.XMLParser in project bacter by tgvaughan.
the class CFOperatorTest method testCFSTX.
@Test
public void testCFSTX() throws Exception {
Randomizer.setSeed(1);
XMLParser parser = new XMLParser();
beast.core.Runnable runnable = parser.parseFile(new File("examples/CFOperatorTests/CFSubtreeExchangeTest5taxon.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("CFSubtreeExchangeTest5taxon.stats", expectations);
for (Expectation expectation : expectations) {
assertTrue(expectation.isValid());
assertTrue(expectation.isPassed());
}
Files.deleteIfExists(Paths.get("CFSubtreeExchangeTest5taxon.stats"));
Files.deleteIfExists(Paths.get("CFSubtreeExchangeTest5taxon.trees"));
Files.deleteIfExists(Paths.get("CFSubtreeExchangeTest5taxon.xml.state"));
}
use of beast.util.XMLParser in project bacter by tgvaughan.
the class CFOperatorTest method testCFWB.
@Test
public void testCFWB() throws Exception {
Randomizer.setSeed(1);
XMLParser parser = new XMLParser();
beast.core.Runnable runnable = parser.parseFile(new File("examples/CFOperatorTests/CFWilsonBaldingTest5taxon.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("CFWilsonBaldingTest5taxon.stats", expectations);
for (Expectation expectation : expectations) {
assertTrue(expectation.isValid());
assertTrue(expectation.isPassed());
}
Files.deleteIfExists(Paths.get("CFWilsonBaldingTest5taxon.stats"));
Files.deleteIfExists(Paths.get("CFWilsonBaldingTest5taxon.converted"));
Files.deleteIfExists(Paths.get("CFWilsonBaldingTest5taxon.trees"));
Files.deleteIfExists(Paths.get("CFWilsonBaldingTest5taxon.cf"));
Files.deleteIfExists(Paths.get("CFWilsonBaldingTest5taxon.xml.state"));
}
use of beast.util.XMLParser in project bacter by tgvaughan.
the class CFOperatorTest method testCFSTS.
@Test
public void testCFSTS() throws Exception {
Randomizer.setSeed(1);
XMLParser parser = new XMLParser();
beast.core.Runnable runnable = parser.parseFile(new File("examples/CFOperatorTests/CFSubtreeSlideTest5taxon.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("CFSubtreeSlideTest5taxon.stats", expectations);
for (Expectation expectation : expectations) {
assertTrue(expectation.isValid());
assertTrue(expectation.isPassed());
}
Files.deleteIfExists(Paths.get("CFSubtreeSlideTest5taxon.stats"));
Files.deleteIfExists(Paths.get("CFSubtreeSlideTest5taxon.trees"));
Files.deleteIfExists(Paths.get("CFSubtreeSlideTest5taxon.xml.state"));
}
use of beast.util.XMLParser in project bacter by tgvaughan.
the class MergeSplitTest method test.
@Test
public void test() throws Exception {
Randomizer.setSeed(1);
XMLParser parser = new XMLParser();
beast.core.Runnable runnable = parser.parseFile(new File("examples/mergeSplitTests/mergeSplitTest5taxon.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("mergeSplitTest5taxon.stats", expectations);
for (Expectation expectation : expectations) {
assertTrue(expectation.isValid());
assertTrue(expectation.isPassed());
}
Files.deleteIfExists(Paths.get("mergeSplitTest5taxon.stats"));
Files.deleteIfExists(Paths.get("mergeSplitTest5taxon.converted"));
Files.deleteIfExists(Paths.get("mergeSplitTest5taxon.trees"));
Files.deleteIfExists(Paths.get("mergeSplitTest5taxon.cf"));
Files.deleteIfExists(Paths.get("mergeSplitTest5taxon.xml.state"));
}
use of beast.util.XMLParser in project bacter by tgvaughan.
the class RegionShiftTest method testRegionShift.
@Test
public void testRegionShift() throws Exception {
Randomizer.setSeed(1);
XMLParser parser = new XMLParser();
beast.core.Runnable runnable = parser.parseFile(new File("examples/regionShiftTests/regionShiftTest5taxon.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("regionShiftTest5taxon.stats", expectations);
for (int i = 0; i < expectations.size(); i++) {
assertTrue(expectations.get(i).isValid());
assertTrue(expectations.get(i).isPassed());
}
Files.deleteIfExists(Paths.get("regionShiftTest5taxon.stats"));
Files.deleteIfExists(Paths.get("regionShiftTest5taxon.converted"));
Files.deleteIfExists(Paths.get("regionShiftTest5taxon.trees"));
Files.deleteIfExists(Paths.get("regionShiftTest5taxon.cf"));
Files.deleteIfExists(Paths.get("regionShiftTest5taxon.xml.state"));
}
Aggregations