use of dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings.ApSpInfo in project beast-mcmc by beast-dev.
the class AlloppSpeciesNetworkModelTEST method testNetworkToMulLabTree.
public void testNetworkToMulLabTree() {
ApSpInfo[] apspecies = new ApSpInfo[5];
apspecies[0] = new ApSpInfo("a", 2, new Individual[0]);
apspecies[1] = new ApSpInfo("b", 4, new Individual[0]);
apspecies[2] = new ApSpInfo("c", 4, new Individual[0]);
apspecies[3] = new ApSpInfo("d", 4, new Individual[0]);
apspecies[4] = new ApSpInfo("e", 2, new Individual[0]);
AlloppSpeciesBindings testASB = new AlloppSpeciesBindings(apspecies);
AlloppSpeciesNetworkModel testASNM = new AlloppSpeciesNetworkModel(testASB);
System.out.println("Tests of Network To MulLabTree conversion with dips a,e and tets b,c,d");
String newick;
newick = testASNM.testExampleNetworkToMulLabTree(1);
System.out.println(newick + "\n\n");
assertEquals(0, newick.compareTo("((((b0,c0),d0),a),(((b1,c1),d1),e))"));
newick = testASNM.testExampleNetworkToMulLabTree(2);
System.out.println(newick + "\n\n");
assertEquals(0, newick.compareTo("(((((b0,c0),d0),a),((b1,c1),d1)),e)"));
newick = testASNM.testExampleNetworkToMulLabTree(3);
System.out.println(newick + "\n\n");
assertEquals(0, newick.compareTo("(((((b0,c0),d0),((b1,c1),d1)),a),e)"));
newick = testASNM.testExampleNetworkToMulLabTree(4);
System.out.println(newick + "\n\n");
assertEquals(0, newick.compareTo("((((b0,c0),a),(d0,d1)),((b1,c1),e))"));
newick = testASNM.testExampleNetworkToMulLabTree(5);
System.out.println(newick + "\n\n");
assertEquals(0, newick.compareTo("(((((a,b0),c0),c1),(d0,d1)),(b1,e))"));
System.out.println("");
System.out.println("");
}
use of dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings.ApSpInfo in project beast-mcmc by beast-dev.
the class AlloppSpeciesNetworkModelTEST method testLhoodMulLabTree.
public void testLhoodMulLabTree() {
ApSpInfo[] apspecies = new ApSpInfo[3];
apspecies[0] = new ApSpInfo("a", 2, new Individual[0]);
apspecies[1] = new ApSpInfo("b", 2, new Individual[0]);
apspecies[2] = new ApSpInfo("z", 4, new Individual[0]);
AlloppSpeciesBindings testASB = new AlloppSpeciesBindings(apspecies);
AlloppMulLabTree testamlt = new AlloppMulLabTree(testASB);
double llhood = testamlt.testGeneTreeInMULTreeLogLikelihood();
assertEquals(llhood, -13.562218135041552713, 1e-10);
System.out.println(llhood);
}
Aggregations