use of dr.evolution.datatype.GeneralDataType in project beast-mcmc by beast-dev.
the class GeneralSubstitutionModelTest method setUp.
public void setUp() throws Exception {
super.setUp();
MathUtils.setSeed(666);
List<String> states = new ArrayList<String>();
states.add("A");
states.add("C");
states.add("G");
states.add("T");
//states.addAll(Arrays.asList("A", "C", "G", "T"));
dataType = new GeneralDataType(states);
dataType.addAmbiguity("-", new String[] { "A", "C", "G", "T" });
dataType.addAmbiguity("?", new String[] { "A", "C", "G", "T" });
createAlignment(PRIMATES_TAXON_SEQUENCE, dataType);
// popSize
createRandomInitialTree(0.0001);
// createSpecifiedTree("(((((chimp:0.010464222027296717,bonobo:0.010464222027296717):0.010716369046616688," +
// "human:0.021180591073913405):0.010988083344422011,gorilla:0.032168674418335416):0.022421978632286572," +
// "orangutan:0.05459065305062199):0.009576302472349953,siamang:0.06416695552297194);");
}
use of dr.evolution.datatype.GeneralDataType in project beast-mcmc by beast-dev.
the class GeneralF81Test method testGF81.
public void testGF81() {
for (Instance test : all) {
double[] pi = test.getPi();
// Parameter freqs = new Parameter.Default(pi);
GeneralDataType gdt = new GeneralDataType(new String[] { "1", "2", "3", "4" });
FrequencyModel f = new FrequencyModel(gdt, pi);
GeneralF81Model generalF81Model = new GeneralF81Model(f);
double distance = test.getDistance();
double[] mat = new double[4 * 4];
generalF81Model.getTransitionProbabilities(distance, mat);
final double[] result = test.getExpectedResult();
for (int k = 0; k < mat.length; ++k) {
assertEquals(mat[k], result[k], 1e-10);
// System.out.print(" " + (mat[k] - result[k]));
}
}
}
Aggregations