transf.branch.lengths(phy, model = c("BM", "OUrandomRoot",
"OUfixedRoot", "lambda", "kappa", "delta", "EB", "trend"),
parameters = NULL, check.pruningwise = TRUE,
check.ultrametric=TRUE, D=NULL, check.names = TRUE)
D
needs to be provided. This is used for the
OU transformations only.D
needs to have names that match tip labels
unless check.names=FALSE, in which case the elements in D
are
assumed to come in the same order as tip labels in the tree.phy
,
it is transformed to
$T * (t/T)^\delta$
under the delta model, where $T$ is the maximum root-to-tip
distance. The transformed tree has the same $T$.
Under EB, $t$ is transformed to
$(e^{\mathrm{rate}*t}-1)/\mathrm{rate}$,
which is very close to $t$ (i.e. to the BM model)
when rate
is close to 0.
Under the lambda model, the time $t$ from the
root to a node is transformed to
$\lambda t$ for an internal node and
is unchanged for a tip.
Under "OUrandomRoot", $t$ is transformed to
$\exp(-2\alpha (T-t))$,
where $T$ is now the mean root-to-tip distance.
Under "OUfixedRroot", $t$ is transformed to
$\exp(-2\alpha (T-t))(1-\exp(-2 \alpha t))$.
Under the OU models, diagWeight
contains $\exp(\alpha
D_i)$ for tip $i$, where $D_i$ is the extra
length added to tip $i$ to make the tree ultrametric.three.point.compute
.set.seed(123456)
tre1 = rcoal(10)
tre2 = transf.branch.lengths(phy=tre1, model="OUrandomRoot",
parameters = list(alpha=1))
par(mfrow = c(2,1))
plot(tre1)
plot(tre2$tree,root.edge=TRUE)
Run the code above in your browser using DataLab