Search in sources :

Example 11 with ConstantPopulation

use of beast.evolution.tree.coalescent.ConstantPopulation in project beast2 by CompEvol.

the class UnorderedAlignmentsTest method getTree.

public static Tree getTree(TaxonSet taxa) throws Exception {
    Tree tree = new RandomTree();
    TraitSet dates = getDates(taxa);
    ConstantPopulation constant = new ConstantPopulation();
    constant.initByName("popSize", new RealParameter("5.0"));
    tree.initByName("taxonset", taxa, "populationModel", constant, "trait", dates);
    return tree;
}
Also used : ConstantPopulation(beast.evolution.tree.coalescent.ConstantPopulation) RandomTree(beast.evolution.tree.RandomTree) TraitSet(beast.evolution.tree.TraitSet) Tree(beast.evolution.tree.Tree) RandomTree(beast.evolution.tree.RandomTree) RealParameter(beast.core.parameter.RealParameter)

Example 12 with ConstantPopulation

use of beast.evolution.tree.coalescent.ConstantPopulation in project beast2 by CompEvol.

the class StarBeastStartState method initWithMRCACalibrations.

private void initWithMRCACalibrations(List<MRCAPrior> calibrations) {
    final Tree spTree = speciesTreeInput.get();
    final RandomTree rnd = new RandomTree();
    rnd.setInputValue("taxonset", spTree.getTaxonset());
    for (final MRCAPrior cal : calibrations) {
        rnd.setInputValue("constraint", cal);
    }
    ConstantPopulation pf = new ConstantPopulation();
    pf.setInputValue("popSize", new RealParameter("1.0"));
    rnd.setInputValue("populationModel", pf);
    rnd.initAndValidate();
    spTree.assignFromWithoutID((Tree) rnd);
    final double rootHeight = spTree.getRoot().getHeight();
    randomInitGeneTrees(rootHeight);
}
Also used : ConstantPopulation(beast.evolution.tree.coalescent.ConstantPopulation) RandomTree(beast.evolution.tree.RandomTree) MRCAPrior(beast.math.distributions.MRCAPrior) RandomTree(beast.evolution.tree.RandomTree) Tree(beast.evolution.tree.Tree) ClusterTree(beast.util.ClusterTree) RealParameter(beast.core.parameter.RealParameter)

Aggregations

ConstantPopulation (beast.evolution.tree.coalescent.ConstantPopulation)12 RealParameter (beast.core.parameter.RealParameter)10 TaxonSet (beast.evolution.alignment.TaxonSet)7 Test (org.junit.Test)7 Locus (bacter.Locus)5 RandomTree (beast.evolution.tree.RandomTree)4 Tree (beast.evolution.tree.Tree)4 Conversion (bacter.Conversion)3 ConversionGraph (bacter.ConversionGraph)3 Alignment (beast.evolution.alignment.Alignment)3 SiteModel (beast.evolution.sitemodel.SiteModel)3 JukesCantor (beast.evolution.substitutionmodel.JukesCantor)3 TreeIntervals (beast.evolution.tree.coalescent.TreeIntervals)3 SimulatedACG (bacter.model.SimulatedACG)2 Sequence (beast.evolution.alignment.Sequence)2 TraitSet (beast.evolution.tree.TraitSet)2 Coalescent (beast.evolution.tree.coalescent.Coalescent)2 ClusterTree (beast.util.ClusterTree)2 ArrayList (java.util.ArrayList)2 ACGCoalescent (bacter.model.ACGCoalescent)1