Search in sources :

Example 11 with LogAnalyser

use of test.beast.beast2vs1.trace.LogAnalyser in project bacter by tgvaughan.

the class AddRemoveTest method test5TaxonSerialSampling.

@Test
public void test5TaxonSerialSampling() throws Exception {
    Randomizer.setSeed(1);
    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(new File("examples/addRemoveTests/addRemoveSerialSamplingTest5taxon.xml"));
    disableScreenLog(runnable);
    runnable.run();
    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 2.07, 0.1));
    expectations.add(new Expectation("acg.CFlength", 5.00, 0.2));
    expectations.add(new Expectation("acg.nConv", 25.190, 1.0));
    LogAnalyser logAnalyser = new LogAnalyser("addRemoveSerialSamplingTest5taxon.stats", expectations);
    for (Expectation expectation : expectations) {
        assertTrue(expectation.isValid());
        assertTrue(expectation.isPassed());
    }
    Files.deleteIfExists(Paths.get("addRemoveSerialSamplingTest5taxon.stats"));
    Files.deleteIfExists(Paths.get("addRemoveSerialSamplingTest5taxon.converted"));
    Files.deleteIfExists(Paths.get("addRemoveSerialSamplingTest5taxon.trees"));
    Files.deleteIfExists(Paths.get("addRemoveSerialSamplingTest5taxon.cf"));
    Files.deleteIfExists(Paths.get("addRemoveSerialSamplingTest5taxon.xml.state"));
}
Also used : LogAnalyser(test.beast.beast2vs1.trace.LogAnalyser) ArrayList(java.util.ArrayList) XMLParser(beast.util.XMLParser) Expectation(test.beast.beast2vs1.trace.Expectation) File(java.io.File) Test(org.junit.Test)

Example 12 with LogAnalyser

use of test.beast.beast2vs1.trace.LogAnalyser in project bacter by tgvaughan.

the class AddRemoveTest method test2Taxon.

@Test
public void test2Taxon() throws Exception {
    Randomizer.setSeed(1);
    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(new File("examples/addRemoveTests/addRemoveTest2taxon.xml"));
    disableScreenLog(runnable);
    runnable.run();
    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 1.008, 5e-2));
    expectations.add(new Expectation("acg.CFlength", 2.015, 5e-2));
    expectations.add(new Expectation("acg.nConv", 10.104, 0.3));
    LogAnalyser logAnalyser = new LogAnalyser("addRemoveTest2taxon.stats", expectations);
    for (Expectation expectation : expectations) {
        assertTrue(expectation.isValid());
        assertTrue(expectation.isPassed());
    }
    Files.deleteIfExists(Paths.get("addRemoveTest2taxon.stats"));
    Files.deleteIfExists(Paths.get("addRemoveTest2taxon.converted"));
    Files.deleteIfExists(Paths.get("addRemoveTest2taxon.trees"));
    Files.deleteIfExists(Paths.get("addRemoveTest2taxon.cf"));
    Files.deleteIfExists(Paths.get("addRemoveTest2taxon.xml.state"));
}
Also used : LogAnalyser(test.beast.beast2vs1.trace.LogAnalyser) ArrayList(java.util.ArrayList) XMLParser(beast.util.XMLParser) Expectation(test.beast.beast2vs1.trace.Expectation) File(java.io.File) Test(org.junit.Test)

Example 13 with LogAnalyser

use of test.beast.beast2vs1.trace.LogAnalyser in project bacter by tgvaughan.

the class AddRemoveTest method test5Taxon.

@Test
public void test5Taxon() throws Exception {
    Randomizer.setSeed(1);
    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(new File("examples/addRemoveTests/addRemoveTest5taxon.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("addRemoveTest5taxon.stats", expectations);
    for (Expectation expectation : expectations) {
        assertTrue(expectation.isValid());
        assertTrue(expectation.isPassed());
    }
    Files.deleteIfExists(Paths.get("addRemoveTest5taxon.stats"));
    Files.deleteIfExists(Paths.get("addRemoveTest5taxon.converted"));
    Files.deleteIfExists(Paths.get("addRemoveTest5taxon.trees"));
    Files.deleteIfExists(Paths.get("addRemoveTest5taxon.cf"));
    Files.deleteIfExists(Paths.get("addRemoveTest5taxon.xml.state"));
}
Also used : LogAnalyser(test.beast.beast2vs1.trace.LogAnalyser) ArrayList(java.util.ArrayList) XMLParser(beast.util.XMLParser) Expectation(test.beast.beast2vs1.trace.Expectation) File(java.io.File) Test(org.junit.Test)

Example 14 with LogAnalyser

use of test.beast.beast2vs1.trace.LogAnalyser in project bacter by tgvaughan.

the class AddRemoveTest method test5TaxonDynamicPopSize.

@Test
public void test5TaxonDynamicPopSize() throws Exception {
    Randomizer.setSeed(2);
    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(new File("examples/addRemoveTests/addRemoveDynamicPopSize5taxon.xml"));
    disableScreenLog(runnable);
    runnable.run();
    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 8.840, 1e-2));
    expectations.add(new Expectation("acg.CFlength", 25.312, 0.5));
    expectations.add(new Expectation("acg.nConv", 25.464, 0.5));
    LogAnalyser logAnalyser = new LogAnalyser("addRemoveDynamicPopSize5taxon.stats", expectations);
    for (Expectation expectation : expectations) {
        assertTrue(expectation.isValid());
        assertTrue(expectation.isPassed());
    }
    Files.deleteIfExists(Paths.get("addRemoveDynamicPopSize5taxon.stats"));
    Files.deleteIfExists(Paths.get("addRemoveDynamicPopSize5taxon.converted"));
    Files.deleteIfExists(Paths.get("addRemoveDynamicPopSize5taxon.trees"));
    Files.deleteIfExists(Paths.get("addRemoveDynamicPopSize5taxon.cf"));
    Files.deleteIfExists(Paths.get("addRemoveDynamicPopSize5taxon.xml.state"));
}
Also used : LogAnalyser(test.beast.beast2vs1.trace.LogAnalyser) ArrayList(java.util.ArrayList) XMLParser(beast.util.XMLParser) Expectation(test.beast.beast2vs1.trace.Expectation) File(java.io.File) Test(org.junit.Test)

Example 15 with LogAnalyser

use of test.beast.beast2vs1.trace.LogAnalyser in project bacter by tgvaughan.

the class AllOperatorTest method testSerialSample.

@Test
public void testSerialSample() throws Exception {
    Randomizer.setSeed(1);
    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(new File("examples/allOperatorTests/allOperatorTestSeriallySampled.xml"));
    disableScreenLog(runnable);
    runnable.run();
    List<Expectation> expectations = new ArrayList<>();
    expectations.add(new Expectation("acg.CFheight", 1.909, 0.2));
    expectations.add(new Expectation("acg.CFlength", 4.655, 0.5));
    expectations.add(new Expectation("acg.nConv", 23.381, 0.5));
    LogAnalyser logAnalyser = new LogAnalyser("allOperatorTestSeriallySampled.stats", expectations);
    for (Expectation expectation : expectations) {
        assertTrue(expectation.isValid());
        assertTrue(expectation.isPassed());
    }
    Files.deleteIfExists(Paths.get("allOperatorTestSeriallySampled.stats"));
    Files.deleteIfExists(Paths.get("allOperatorTestSeriallySampled.converted"));
    Files.deleteIfExists(Paths.get("allOperatorTestSeriallySampled.trees"));
    Files.deleteIfExists(Paths.get("allOperatorTestSeriallySampled.cf"));
    Files.deleteIfExists(Paths.get("allOperatorTestSeriallySampled.xml.state"));
}
Also used : LogAnalyser(test.beast.beast2vs1.trace.LogAnalyser) ArrayList(java.util.ArrayList) XMLParser(beast.util.XMLParser) Expectation(test.beast.beast2vs1.trace.Expectation) File(java.io.File) Test(org.junit.Test)

Aggregations

XMLParser (beast.util.XMLParser)23 File (java.io.File)23 Expectation (test.beast.beast2vs1.trace.Expectation)23 LogAnalyser (test.beast.beast2vs1.trace.LogAnalyser)23 ArrayList (java.util.ArrayList)22 Test (org.junit.Test)22