Search in sources :

Example 46 with TreeModel

use of dr.evomodel.tree.TreeModel in project beast-mcmc by beast-dev.

the class TreeBitRandomWalkOperatorParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
    TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
    String trait1 = null;
    String trait2 = null;
    if (xo.hasAttribute(INDICTATOR_TRAIT))
        trait1 = xo.getStringAttribute(INDICTATOR_TRAIT);
    if (xo.hasAttribute(TRAIT2))
        trait2 = xo.getStringAttribute(TRAIT2);
    int k = xo.getAttribute("k", 1);
    boolean swapTrait2 = xo.getAttribute(SWAP_TRAIT2, true);
    return new TreeBitRandomWalkOperator(treeModel, trait1, trait2, weight, k, swapTrait2);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) TreeBitRandomWalkOperator(dr.evomodel.operators.TreeBitRandomWalkOperator)

Example 47 with TreeModel

use of dr.evomodel.tree.TreeModel in project beast-mcmc by beast-dev.

the class GibbsSubtreeSwapParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
    final double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
    final boolean pruned = xo.getAttribute("pruned", true);
    return new GibbsSubtreeSwap(treeModel, pruned, weight);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) GibbsSubtreeSwap(dr.evomodel.operators.GibbsSubtreeSwap)

Example 48 with TreeModel

use of dr.evomodel.tree.TreeModel in project beast-mcmc by beast-dev.

the class ImportancePruneAndRegraftParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
    double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
    int samples = xo.getIntegerAttribute("samples");
    return new ImportancePruneAndRegraft(treeModel, weight, samples);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) ImportancePruneAndRegraft(dr.evomodel.operators.ImportancePruneAndRegraft)

Example 49 with TreeModel

use of dr.evomodel.tree.TreeModel in project beast-mcmc by beast-dev.

the class ImportanceSubtreeSwapParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    final TreeModel treeModel = (TreeModel) xo.getChild(TreeModel.class);
    final double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
    final int samples = xo.getIntegerAttribute("samples");
    return new ImportanceSubtreeSwap(treeModel, weight, samples);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) ImportanceSubtreeSwap(dr.evomodel.operators.ImportanceSubtreeSwap)

Example 50 with TreeModel

use of dr.evomodel.tree.TreeModel in project beast-mcmc by beast-dev.

the class TraceCorrelationAssert method createSpecifiedTree.

protected void createSpecifiedTree(String t) throws Exception {
    //        Tree.Utils.newick(tree)
    //create tree
    NewickImporter importer = new NewickImporter(t);
    Tree tree = importer.importTree(null);
    //treeModel
    treeModel = new TreeModel(tree);
}
Also used : TreeModel(dr.evomodel.tree.TreeModel) NewickImporter(dr.evolution.io.NewickImporter) SimpleTree(dr.evolution.tree.SimpleTree) Tree(dr.evolution.tree.Tree)

Aggregations

TreeModel (dr.evomodel.tree.TreeModel)142 Parameter (dr.inference.model.Parameter)62 BranchRateModel (dr.evomodel.branchratemodel.BranchRateModel)28 ArrayList (java.util.ArrayList)28 Tree (dr.evolution.tree.Tree)26 NewickImporter (dr.evolution.io.NewickImporter)21 GammaSiteRateModel (dr.evomodel.siteratemodel.GammaSiteRateModel)20 FrequencyModel (dr.evomodel.substmodel.FrequencyModel)19 HomogeneousBranchModel (dr.evomodel.branchmodel.HomogeneousBranchModel)18 DefaultBranchRateModel (dr.evomodel.branchratemodel.DefaultBranchRateModel)15 SubstitutionModel (dr.evomodel.substmodel.SubstitutionModel)15 PatternList (dr.evolution.alignment.PatternList)14 NodeRef (dr.evolution.tree.NodeRef)14 Partition (dr.app.beagle.tools.Partition)12 BranchModel (dr.evomodel.branchmodel.BranchModel)12 IOException (java.io.IOException)12 BeagleSequenceSimulator (dr.app.beagle.tools.BeagleSequenceSimulator)11 Taxon (dr.evolution.util.Taxon)11 TaxonList (dr.evolution.util.TaxonList)11 Patterns (dr.evolution.alignment.Patterns)9