You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<figcaption>Figure 11: The Starting tree panel showing our Newick initial tree.</figcaption>
284
284
</figure>
285
285
<br>
286
286
@@ -292,20 +292,33 @@ We can now run our updated analysis.
292
292
> Open **BEAST2** and choose `primates_run_newick.xml` as the Input file. Then click **Run**.
293
293
>
294
294
295
-
On this small example, we will not see a strong difference in performance from adding an initial tree. However, initial trees can be helpful for larger and more complex inferences to converge.
295
+
We can load the log files `primates_run.log` and `primates_run_newick.log` (found in the `Output` section of the tutorial) into **Tracer** to compare both runs. On this small example, the ESS of the run with an initial tree are slightly higher on most parameters than with the random tree, but both runs have converged and we do not see a strong difference in performance from adding an initial tree. However, initial trees can be very helpful for larger and more complex inferences to converge.
296
296
297
297
## Common issues with initial trees
298
298
299
-
A frequent issue with using initial tree is that **BEAST2** expects a dated tree, i.e. a tree with branch lengths in units of time, whereas initial trees are often generated using a maximum likelihood software such as **IQ-TREE**, which will output a tree with branch lengths in units of number of substitutions. This is exactly the case in our example, and if we plot the primates tree provided above we will notice this very easily. For instance, all our samples come from the present, but our example tree is not ultrametric.
299
+
A frequent issue with using an initial tree is that **BEAST2** expects a dated tree, i.e. a tree with branch lengths in units of time, whereas initial trees are often generated using a maximum likelihood software such as **IQ-TREE**, which will output a tree with branch lengths in units of number of substitutions. This is exactly the case in our example, and if we plot the primates tree provided above we will notice this very easily. For instance, all our samples come from the present, but our primates initial tree is not ultrametric.
300
300
301
301
This was not an issue in our earlier inference because **BEAST2** was able to correct the tip ages (with the **Adjust Tip Heights** option) and we had no other time calibration points. However, in a real analysis we will likely have several calibrations to help calibrate our molecular clock. Let us check what happens when we add a root calibration at the root of the tree.
302
302
303
303
> Download the second **BEAST2** input file `primates_run_newick_root.xml`.
304
+
> Open **BEAUti** and load in the `primates_run_newick_root.xml` file by navigating to **File > Load**.
305
+
> Check the added root calibration in the **Priors** panel.
306
+
>
307
+
308
+
We can see here that we have added a distribution on the root node in order to infer a dated tree. Now we can run this analysis.
309
+
304
310
> Open **BEAST2** and choose `primates_run_newick_root.xml` as the Input file. Then click **Run**.
305
311
>
306
312
307
313
Our analysis does not start, and by looking at the error message in [Figure 12](#fig:error_root) we can see that our root calibration has probability **-Infinity**. This is because the root calibration that we have set has an **offset** of **20 My**, meaning that the root age has to be above that value. On the other hand, the initial tree we have provided has a root age of 0.887, which is completely incompatible with the calibration.
<figcaption>Figure 12: The error obtained when running an analysis with a root calibration.</figcaption>
319
+
</figure>
320
+
<br>
321
+
309
322
We can solve this issue by scaling our initial tree so that the root age is increased. Since our root age has to be greater than 20, we need a scaling factor of at least 20/0.887 = 22.55 to have a tree which is compatible with the calibration.
310
323
311
324
> Open **BEAUti** and load in the `primates_run_newick_root.xml` file by navigating to **File > Load**.
@@ -321,13 +334,24 @@ We can now test that our updated analysis runs correctly.
321
334
322
335
Unfortunately, the **Scale** parameter is applied to the whole tree, and in analyses with many different calibration points it is not always possible to find a scale factor which is compatible with all calibrations, especially if some calibrations have both a minimum and a maximum age. For instance, let us see what happens if we add a second calibration point to our analysis.
323
336
324
-
> Download the third **BEAST2** input file `primates_run_newick_calibrated_scaled.xml`.
325
-
> Open **BEAST2** and choose `primates_run_newick_calibrated_scaled.xml` as the Input file. Then click **Run**.
337
+
> Download the third **BEAST2** input file `primates_run_newick_2calib.xml`.
338
+
> Open **BEAUti** and load in the `primates_run_newick_2calib.xml` file by navigating to **File > Load**.
339
+
> Check the two calibrations in the **Priors** panel.
340
+
>
341
+
342
+
We can see two calibrations in our analysis, one at the root of the tree and one on the human-chimpanzee clade. Now we can run this analysis.
343
+
344
+
> Open **BEAST2** and choose `primates_run_newick_2calib.xml` as the Input file. Then click **Run**.
326
345
>
327
346
328
347
Again our analysis does not start, and by looking at the error message in [Figure 13](#fig:error_calib) we can see that our second calibration **human_pan** has probability **-Infinity**, which indicates that it is incompatible with the initial tree. In this situation, we would need to either use a dated tree as our starting value for the inference, or manually adjust the tree so that all calibration nodes have an age which is compatible with the calibrations set in the analysis.
0 commit comments