Skip to content

Commit fe9b15d

Browse files
committed
2 parents 55d5858 + c76d5e6 commit fe9b15d

File tree

4 files changed

+414
-309
lines changed

4 files changed

+414
-309
lines changed

ParseMdtoLatex.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ def removeRefSection(text):
498498
# Remove relevant references heading
499499
text = removeRefSection(text)
500500

501+
# Remove escaped characters that pandoc inserts (should actually only remove inside math mode)
502+
text = text.replace("\\^","^").replace("\\_","_").replace("\\{","{").replace("\\}","}")
503+
501504
# Remove unknown latex tags that pandoc inserts
502505
# remove \toprule, \bottomrule, \tightlist
503506
text = text.replace("\\toprule","").replace("\\bottomrule","").replace("\\tightlist","")

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@ beastversion: 2.7.x
77
---
88

99

10+
11+
12+
1013
# Background
1114

1215
This tutorial will show how to configure and run a model with progressive changes in birth and death rates, using the ClaDS tree prior implemented in the BEAST2 package ClaDS.
1316

1417
The Cladogenetic Diversification rate Shift (ClaDS) model is a birth-death process which is designed to represent gradual, progressive changes in rates throughout a phylogeny. It is similar in principle to an autocorrelated clock model, as new birth and death rates are drawn for each edge from a distribution which depends on the ancestral rates.
1518

16-
As an example, we consider a lineage {% eqinline N %}, with its associated birth rate {% eqinline \lambda_N %} and death rate {% eqinline \mu_N %}. At the next birth event, the lineage {% eqinline N %} splits into lineages {% eqinline N' %} and {% eqinline N" %}. The new birth rates {% eqinline \lambda_N' %} and {% eqinline \lambda_N" %} are drawn from a lognormal distribution with mean {% eqinline M = log(\alpha \times \lambda_N %} and standard deviation {% eqinline S = \sigma %}. {% eqinline \alpha %}, {% eqinline \sigma %}, and the birth rate at the root {% eqinline \lambda_0 %} are parameters of the model and can be estimated by the inference.
19+
As an example, we consider a lineage {% eqinline N %}, with its associated birth rate {% eqinline \lambda_N %} and death rate {% eqinline \mu_N %}. At the next birth event, the lineage {% eqinline N %} splits into lineages {% eqinline N^\prime %} and {% eqinline N^{\prime\prime} %}. The new birth rates {% eqinline \lambda_N^\prime %} and {% eqinline \lambda_N^{\prime\prime} %} are drawn from a lognormal distribution with mean {% eqinline M = \log(\alpha \times \lambda_N ) %} and standard deviation {% eqinline S = \sigma %}. The model parameters {% eqinline \alpha %}, {% eqinline \sigma %}, and the birth rate at the root, {% eqinline \lambda_0 %}, can be estimated by the inference.
1720

1821
The package includes two separate options for sampling the death rate:
1922
1. New death rates are not sampled separately, but controlled by the turnover parameter {% eqinline \epsilon %}, which is the same throughout the phylogeny and can be estimated by the inference. Thus for each lineage {% eqinline N %}, we have {% eqinline \mu_N = \epsilon \times \lambda_N %}. This is the parametrization by default.
20-
2. New death rates are sampled from the ancestral rates, following a similar lognormal distribution to the birth rates. Thus, for lineage {% eqinline N %} with descendants {% eqinline N' %} and {% eqinline N" %}, we draw the new death rates {% eqinline \mu_N' %} and {% eqinline \mu_N" %} from a lognormal distribution with mean {% eqinline M = log(\alpha_M \times \mu_N %} and standard deviation {% eqinline S = \sigma_M %}. In this case and similar to the birth rate, {% eqinline \alpha_M %}, {% eqinline \sigma_M %}, and the death rate at the root {% eqinline \mu_0 %} are parameters of the model and can be estimated by the inference.
23+
2. New death rates are sampled from the ancestral rates, following a similar lognormal distribution to the birth rates. Thus, for lineage {% eqinline N %} with descendants {% eqinline N^\prime %} and {% eqinline N^{\prime\prime} %}, we draw the new death rates {% eqinline \mu_N^\prime %} and {% eqinline \mu_N^{\prime\prime} %} from a lognormal distribution with mean {% eqinline M = \log(\alpha_M \times \mu_N ) %} and standard deviation {% eqinline S = \sigma_M %}. In this case and similar to the birth rate, {% eqinline \alpha_M %}, {% eqinline \sigma_M %}, and the death rate at the root, {% eqinline \mu_0 %}, are parameters of the model and can be estimated by the inference.
2124
The choice of death rate parametrization is left to the user, and will depend on the dataset and on which characteristics are thought to drive the variations in rate. The first parametrization is appropriate when the variations of both rates are tied to the same factor and thus strongly correlated, whereas the second parametrization is more appropriate when the variations in birth rates and death rates are uncorrelated. The first parametrization is also more simple and contains less parameters, and thus may be easier to use when the available data is limited.
2225

2326
Finally, it is also possible to set either the birth rate or the death rate to be constant throughout the phylogeny, by setting the corresponding trend parameter {% eqinline \alpha %} or {% eqinline \alpha_M %} to 1 and the corresponding standard deviation parameter {% eqinline \sigma %} or {% eqinline \sigma_M %} to 0. This will lead to {% eqinline \lambda_N = \lambda_0 %} or {% eqinline \mu_N = \mu_0 %} for all lineages.
@@ -167,7 +170,7 @@ The next step is to look at the different priors, in the **Priors** panel. The d
167170
168171
<figure>
169172
<a id="taxonSet"></a>
170-
<img style="width:80.0%;" src="figures/taxonSet.png" alt="">
173+
<img style="width:40.0%;" src="figures/taxonSet.png" alt="">
171174
<figcaption>Figure 7: Taxon set editor.</figcaption>
172175
</figure>
173176
<br>
@@ -211,7 +214,7 @@ Note that many other options are available in this section, such as fixing the v
211214

212215
### The parameter priors
213216

214-
Most of the default parameter priors are reasonable, so we will not change them. However, the default prior for the mean clock rate is a uniform distribution from 0 to Infinity, which allows values which are too large for most datasets. A reasonable value for the global substitution rate of primates is on the order of 10^-2 substitution/site/My, so we will set a exponential prior around this value.
217+
Most of the default parameter priors are reasonable, so we will not change them. However, the default prior for the mean clock rate is a uniform distribution from 0 to Infinity, which allows values which are too large for most datasets. A reasonable value for the global substitution rate of primates is on the order of {% eqinline 10^{-2} %} substitution/site/My, so we will set a exponential prior around this value.
215218

216219
> Use the dropdown menu on the right of **clockRate.c:primates** to select a **Exponential** distribution for this prior.
217220
> Click on the arrow left to **clockRate.c:primates** to open the detailed options. Set the **Mean** parameter to **0.01**.

0 commit comments

Comments
 (0)