To start the tree with a tree in Newick format, you need the TreeParser to initialise the tree. You can insert this in the XML by editing it (this is not possible in BEAUti yet) for example, like so:
It is a bit tricky, because you have to ensure that
- the id (here id=’Tree.t:xyz’) is the same as in your original file.
- taxa refers to the alignment so it knows the order of taxa. If your alignment has id=’xyz’ then add taxa=’@xyz’.
- the element name (here stateNode) should be the same as in the original file.
- if the tree is supposed to be ultrametric, that is, all the tips have the same age then also set adjustTipHeights to true.
- if there is an initaliser generated by BEAUti of the form
remove this element from the file, otherwise the tree will be Newick tree will be overwritten by a random tree.
- if you added constraints to the RandomTree in “constraint”-elements, these should not be moved to TreeParser. TreeParser does not rely on constraints to initialise, so these constraints should be moved outside the RandomTree to the top level of the XML (just inside the “beast”-element).
For more information about starting threes, including for *BEAST, see All about starting trees.
Fix the tree throughout BEAST run
If you want to keep the tree fixed during the MCMC chain, you need to remove operators that operate on the tree. To remove an operator you can
- set the operator weight to 0, in the operator panel in BEAUti (make sure the operator panel is visible by selecting the View/Show Operators panel menu first), or
- set the operator weight to 0 in the XML, or
- comment out (wrap inside <!– and –>) or delete the operator by editing the XML
For a standard analysis (one generated in BEAUti using the Standard template) you can keep the topology fixed by removing the following operators
- Wide-exchange, which are elements with spec=”Exchange” and isNarrow=”false”
- Narrow-exchange, elements with spec=”Exchange” and isNarrow not specified
- Wilson-Balding, elements with spec=”WilsonBalding”
- Subtree-slide, elements with spec=”SubtreeSlide”
If you also want to keep the height of the internal nodes fixed, on top of removing the above operators you need to remove
- Tree-scaler, which are elements with spec=”ScaleOperator” and id containing “TreeScaler”
- Tree-root-scaler, elements with spec=”ScaleOperator” and id containing “TreeRootScaler”
- Uniform, elements with spec=”Uniform”
- Up-down-operators, elements with spec=”UpDownOperator” containing the tree as “up” or “down” input.
For a *BEAST analysis (one generated in BEAUti using the StarBeast template) the same applies to gene trees, but the species tree uses a NodeReheight operator that changes both topology and internal node heights.