Beispiel #1
0
 def add_constrainedrandomtree_init(self, beastxml):
     attribs = {"estimate":"false", "id":"startingTree", "initial":"@Tree.t:beastlingTree", "taxonset":"@taxa", "spec":"beast.evolution.tree.ConstrainedRandomTree", "constraints":"@constraints"}
     if self.birthrate_estimate is not None:
         attribs["rootHeight"] = str(self.treeheight_estimate)
     beastxml.init = xml.init(beastxml.run, attrib=attribs)
     popmod = xml.populationModel(beastxml.init, spec="ConstantPopulation")
     xml.popSize(popmod, spec="parameter.RealParameter", value="1")
Beispiel #2
0
 def add_prior(self, beastxml):
     """Add a Yule tree prior."""
     coalescent = xml.distribution(beastxml.prior,
                                   id="Coalescent.t:beastlingTree",
                                   spec="Coalescent")
     popmod = xml.populationModel(coalescent,
                                  id="ConstantPopulation:beastlingTree",
                                  spec="ConstantPopulation")
     xml.parameter(popmod, idref="popSize.t:beastlingTree", name="popSize")
     xml.treeIntervals(coalescent,
                       id="TreeIntervals",
                       spec="TreeIntervals",
                       tree="@Tree.t:beastlingTree")