Search in sources :

Example 11 with SiteModel

use of dr.oldevomodel.sitemodel.SiteModel in project beast-mcmc by beast-dev.

the class SequenceSimulator method main.

// getDefaultSiteModel
public static void main(String[] args) {
    try {
        int nReplications = 10;
        // create tree
        NewickImporter importer = new NewickImporter("((A:1.0,B:1.0)AB:1.0,(C:1.0,D:1.0)CD:1.0)ABCD;");
        Tree tree = importer.importTree(null);
        // create site model
        SiteModel siteModel = getDefaultSiteModel();
        // create branch rate model
        BranchRateModel branchRateModel = new DefaultBranchRateModel();
        // feed to sequence simulator and generate leaves
        SequenceSimulator treeSimulator = new SequenceSimulator(tree, siteModel, branchRateModel, nReplications);
        Sequence ancestralSequence = new Sequence();
        ancestralSequence.appendSequenceString("TCAGGTCAAG");
        treeSimulator.setAncestralSequence(ancestralSequence);
        System.out.println(treeSimulator.simulate().toString());
    } catch (Exception e) {
        e.printStackTrace();
    }
//END: try-catch block
}
Also used : BranchRateModel(dr.evomodel.branchratemodel.BranchRateModel) DefaultBranchRateModel(dr.evomodel.branchratemodel.DefaultBranchRateModel) NewickImporter(dr.evolution.io.NewickImporter) Tree(dr.evolution.tree.Tree) GammaSiteModel(dr.oldevomodel.sitemodel.GammaSiteModel) SiteModel(dr.oldevomodel.sitemodel.SiteModel) Sequence(dr.evolution.sequence.Sequence) DefaultBranchRateModel(dr.evomodel.branchratemodel.DefaultBranchRateModel)

Aggregations

SiteModel (dr.oldevomodel.sitemodel.SiteModel)11 TreeModel (dr.evomodel.tree.TreeModel)7 BranchRateModel (dr.evomodel.branchratemodel.BranchRateModel)6 Parameter (dr.inference.model.Parameter)6 PatternList (dr.evolution.alignment.PatternList)5 GammaSiteModel (dr.oldevomodel.sitemodel.GammaSiteModel)4 Taxon (dr.evolution.util.Taxon)3 AnyTipObservationProcess (dr.oldevomodel.MSSD.AnyTipObservationProcess)3 SingleTipObservationProcess (dr.oldevomodel.MSSD.SingleTipObservationProcess)3 NewickImporter (dr.evolution.io.NewickImporter)2 NodeRef (dr.evolution.tree.NodeRef)2 Tree (dr.evolution.tree.Tree)2 ALSTreeLikelihood (dr.oldevomodel.MSSD.ALSTreeLikelihood)2 AbstractObservationProcess (dr.oldevomodel.MSSD.AbstractObservationProcess)2 FrequencyModel (dr.oldevomodel.substmodel.FrequencyModel)2 HKY (dr.oldevomodel.substmodel.HKY)2 MutationDeathModel (dr.oldevomodel.substmodel.MutationDeathModel)2 TreeLikelihood (dr.oldevomodel.treelikelihood.TreeLikelihood)2 Importer (dr.evolution.io.Importer)1 TreeImporter (dr.evolution.io.TreeImporter)1