Search in sources :

Example 1 with BeagleTreeLikelihood

use of beast.evolution.likelihood.BeagleTreeLikelihood in project beast2 by CompEvol.

the class Utils method main.

public static void main(String[] args) {
    try {
        Sequence a = new Sequence("A", "A");
        Sequence b = new Sequence("B", "A");
        Sequence c = new Sequence("C", "A");
        Sequence d = new Sequence("D", "A");
        Alignment data = new Alignment();
        data.initByName("sequence", a, "sequence", b, "sequence", c, "sequence", d, "dataType", "nucleotide");
        TreeParser tree = new TreeParser();
        tree.initByName("taxa", data, "newick", "(((A:1,B:1):1,C:2):1,D:3)", "IsLabelledNewick", true);
        JukesCantor JC = new JukesCantor();
        JC.initAndValidate();
        SiteModel siteModel = new SiteModel();
        siteModel.initByName("mutationRate", "1.0", "gammaCategoryCount", 1, "substModel", JC);
        BeagleTreeLikelihood likelihood = new BeagleTreeLikelihood();
        likelihood.initByName("data", data, "tree", tree, "siteModel", siteModel);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    System.out.println("Success");
    // if we got this far, exit with status 0
    System.exit(0);
}
Also used : BeagleTreeLikelihood(beast.evolution.likelihood.BeagleTreeLikelihood) Alignment(beast.evolution.alignment.Alignment) TreeParser(beast.util.TreeParser) SiteModel(beast.evolution.sitemodel.SiteModel) Sequence(beast.evolution.alignment.Sequence) JukesCantor(beast.evolution.substitutionmodel.JukesCantor) UnsupportedLookAndFeelException(javax.swing.UnsupportedLookAndFeelException) IOException(java.io.IOException)

Aggregations

Alignment (beast.evolution.alignment.Alignment)1 Sequence (beast.evolution.alignment.Sequence)1 BeagleTreeLikelihood (beast.evolution.likelihood.BeagleTreeLikelihood)1 SiteModel (beast.evolution.sitemodel.SiteModel)1 JukesCantor (beast.evolution.substitutionmodel.JukesCantor)1 TreeParser (beast.util.TreeParser)1 IOException (java.io.IOException)1 UnsupportedLookAndFeelException (javax.swing.UnsupportedLookAndFeelException)1