Search in sources :

Example 6 with LogAnalyser

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

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

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

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

the class SimulatedACGTest method test5TaxonDynamicPopSize.

@Test
public void test5TaxonDynamicPopSize() throws Exception {
    Randomizer.setSeed(1);
    XMLParser parser = new XMLParser();
    beast.core.Runnable runnable = parser.parseFile(new File("examples/ACGsimulations/simulateACGs5taxonDynamicPopSize.xml"));
    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, 1e-2));
    expectations.add(new Expectation("acg.nConv", 25.464, 5e-2));
    LogAnalyser logAnalyser = new LogAnalyser("simulateACGs5taxonDynamicPopSize.stats", expectations);
    for (int i = 0; i < expectations.size(); i++) {
        assertTrue(expectations.get(i).isValid());
        assertTrue(expectations.get(i).isPassed());
    }
    Files.deleteIfExists(Paths.get("simulateACGs5taxonDynamicPopSize.stats"));
    Files.deleteIfExists(Paths.get("simulateACGs5taxonDynamicPopSize.converted"));
    Files.deleteIfExists(Paths.get("simulateACGs5taxonDynamicPopSize.trees"));
}
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 10 with LogAnalyser

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

the class AddRemoveRedundantTest 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/addRemoveRedundantTest5taxon.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("addRemoveRedundantTest5taxon.stats", expectations);
    for (int i = 0; i < expectations.size(); i++) {
        assertTrue(expectations.get(i).isValid());
        assertTrue(expectations.get(i).isPassed());
    }
    Files.deleteIfExists(Paths.get("addRemoveRedundantTest5taxon.stats"));
    Files.deleteIfExists(Paths.get("addRemoveRedundantTest5taxon.converted"));
    Files.deleteIfExists(Paths.get("addRemoveRedundantTest5taxon.trees"));
    Files.deleteIfExists(Paths.get("addRemoveRedundantTest5taxon.cf"));
    Files.deleteIfExists(Paths.get("addRemoveRedundantTest5taxon.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