Description Usage Arguments Details Value Author(s) See Also Examples
Generate aggregated or overdispersed sampling designs for any given phylogenetic tree (class phylo). Results can be used to design experiments/samples, for resample proposes and data bias removal.
1 2 | run_sampler_phy(x, n, alpha, dist.func = cophenetic, n_start = 1,
return_start = FALSE, starting = NULL)
|
x |
|
n |
A positive integer number indicating the sample size. |
alpha |
Number indicating the strength of aggregation (if negative) or overdispersion (if positive). When alpha = 0 sample is random. |
dist.func |
Function to calculate the phylogenetic distance.
The function should be able to receive a phylo object and return
a |
n_start |
Number of initial selected tips. Default is one starting tip. |
return_start |
if |
starting |
Character vector indicating the starting tips. If not provided, random starting value(s) is(are) selected. |
The function uses the algorithm in run_sampler
,
but here it accepts a phylo object as input.
The function returns a pruned phylogenetic tree.
Bruno Vilela
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Generate a random tree
require(ape)
set.seed(100)
tree <- rcoal(10)
set.seed(2)
# Highly overdispersed 50% resample design (alpha = 100)
overdispersed <- run_sampler_phy(tree, 5, alpha = 100, starting = "t10")
# Highly aggregated 50% resample design (alpha = -100)
aggregated <- run_sampler_phy(tree, 5, alpha = -100, starting = "t10")
# Random 50% resample design (alpha = 0)
random <- run_sampler_phy(tree, 5, alpha = 0, starting = "t10")
# Plot to compare
par(mfrow = c(2, 2))
plot(tree, main = "Full tree", cex = 1)
axis(1)
plot(overdispersed, main = "Overdispersed 50% sampling", cex = 1)
axis(1)
plot(aggregated, main = "Aggregated 50% sampling", cex = 1)
axis(1)
plot(random, main = "Random 50% sampling", cex = 1)
axis(1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.