| correlated.trees | R Documentation |
Simulate correlated branch lengths among loci on a phylogeny under a relaxed clock
correlated.trees(tree, model, r, s2, nloci, corr)
tree |
an object of class phylo representing a bifurcating phylogeny |
model |
character, the relaxed clock model |
r |
numeric, the mean rate in substitutions per site |
s2 |
numeric, the rate "diffusion" parameter for the relaxed clocks |
nloci |
numeric, the number of trees to simulate (one per locus) |
corr |
numeric, the correlation of log rates among loci |
A total of nloci trees are simulated, with the log-rates
for branches across trees having correlation corr.
A list with two elements: A list of length nloci of trees of
class phylo with branch lengths in substitutions per site, and a matrix of
branch rates for each locus.
Mario dos Reis
relaxed.tree to simulate a single tree.
require(ape)
par(mfrow=c(2,3))
data(pri10s)
# ILN model:
# Simulate using autocorrelated log-normal rates on a primate phylogeny,
# with no correlation among three loci:
iln0 <- correlated.trees(pri10s, model="iln", r=.04e-2, s2=.1, 3, 0)
lapply(iln0$trees, plot)
# Repeat with strong correlation among loci:
ilnc <- correlated.trees(pri10s, model="iln", r=.04e-2, s2=.1, 3, 0.9)
lapply(ilnc$trees, plot)
# GBM model:
# Simulate using autocorrelated log-normal rates on a primate phylogeny,
# with no correlation among three loci:
gbm0 <- correlated.trees(pri10s, model="gbm", r=.04e-2, s2=.26e-2, 3, 0)
lapply(gbm0$trees, plot)
# Repeat with strong correlation among loci:
gbmc <- correlated.trees(pri10s, model="gbm", r=.04e-2, s2=.26e-2, 3, 0.9)
lapply(gbmc$trees, plot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.