Search in sources :

Example 1 with LogAnalyser

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

the class AddRemoveDetourTest method test5Taxon.

@Test
public void test5Taxon() throws Exception {
    Randomizer.setSeed(1);
    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(new File("examples/addRemoveDetourTests/addRemoveDetourTest5taxon.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("addRemoveDetourTest5taxon.stats", expectations);
    for (int i = 0; i < expectations.size(); i++) {
        assertTrue(expectations.get(i).isValid());
        assertTrue(expectations.get(i).isPassed());
    }
    Files.deleteIfExists(Paths.get("addRemoveDetourTest5taxon.stats"));
    Files.deleteIfExists(Paths.get("addRemoveDetourTest5taxon.converted"));
    Files.deleteIfExists(Paths.get("addRemoveDetourTest5taxon.trees"));
    Files.deleteIfExists(Paths.get("addRemoveDetourTest5taxon_trimmed.trees"));
    Files.deleteIfExists(Paths.get("addRemoveDetourTest5taxon.cf"));
    Files.deleteIfExists(Paths.get("addRemoveDetourTest5taxon.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 2 with LogAnalyser

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

the class AllOperatorTest method testMultiLocus.

@Test
public void testMultiLocus() throws Exception {
    Randomizer.setSeed(1);
    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(new File("examples/allOperatorTests/allOperatorTestSSMultiLocus.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("allOperatorTestSSMultiLocus.stats", expectations);
    for (Expectation expectation : expectations) {
        assertTrue(expectation.isValid());
        assertTrue(expectation.isPassed());
    }
    Files.deleteIfExists(Paths.get("allOperatorTestSSMultiLocus.stats"));
    Files.deleteIfExists(Paths.get("allOperatorTestSSMultiLocus.converted"));
    Files.deleteIfExists(Paths.get("allOperatorTestSSMultiLocus.trees"));
    Files.deleteIfExists(Paths.get("allOperatorTestSSMultiLocus.cf"));
    Files.deleteIfExists(Paths.get("allOperatorTestSSMultiLocus.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 3 with LogAnalyser

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

the class CFOperatorTest method testCFUniform.

@Test
public void testCFUniform() throws Exception {
    Randomizer.setSeed(1);
    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(new File("examples/CFOperatorTests/CFUniformTest5taxon.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("CFUniformTest5taxon.stats", expectations);
    for (Expectation expectation : expectations) {
        assertTrue(expectation.isValid());
        assertTrue(expectation.isPassed());
    }
    Files.deleteIfExists(Paths.get("CFUniformTest5taxon.stats"));
    Files.deleteIfExists(Paths.get("CFUniformTest5taxon.converted"));
    Files.deleteIfExists(Paths.get("CFUniformTest5taxon.trees"));
    Files.deleteIfExists(Paths.get("CFUniformTest5taxon.cf"));
    Files.deleteIfExists(Paths.get("CFUniformTest5taxon.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 4 with LogAnalyser

use of test.beast.beast2vs1.trace.LogAnalyser 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"));
}
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 5 with LogAnalyser

use of test.beast.beast2vs1.trace.LogAnalyser 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"));
}
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