gen.unit.K {phyclust} | R Documentation |
Generate comprehensive trees for simulation studies.
gen.unit.K(K, N.K, rate.anc = 10, rate.dec = 10)
K |
number of clusters, K. |
N.K |
number of sequences for each cluster, a vector with length |
rate.anc |
r_a, growth rate of ancestral tree. |
rate.dec |
r_d, growth rate of descendent tree. |
These functions generates an ancestral tree in K tips and
generates descendent trees according to N.K
tips,
and returns several types of trees, org
, equal
,
max
, and star
, as the following:
'org': original tree, adjacent the descendent trees to the ancestral tree.
'equal': descendent trees are scaled to the average height and attached to the ancestral tree, then scale the total height to be 1.
'max': descendent trees are attached to the ancestral tree, then scale the maximum height to be 1.
'star': descendent trees are applied as.star.tree
and
attached to the ancestral tree,
then scale the maximum height to be 1.
A list contains all information of generation and results including:
'K' |
number of clusters. |
'N.K |
number of sequences for each cluster. |
'rate.anc' |
r_a, growth rate of ancestral tree. |
'rate.dec' |
r_d, growth rate of descendent tree. |
'height.anc' |
height of ancestral tree. |
'height.dec' |
height of all descendent trees. |
'anc' |
an ancestral tree. |
'dec' |
all descendent trees. |
'org' |
an original tree. |
'equal' |
a three that descendants are all equal height. |
'max' |
a tree that descendants are scaled by the maximum height. |
'star' |
a tree that descendants are star trees. |
Wei-Chen Chen wccsnow@gmail.com
Phylogenetic Clustering Website: http://snoweye.github.io/phyclust/
## Not run: library(phyclust, quiet = TRUE) # For gen.unit.K() set.seed(1234) tree.K <- gen.unit.K(6, rep(3:5, 2), rate.anc = 0.7, rate.dec = 1.1) X.class <- as.numeric(gsub("d(.)(.*)", "\\1", tree.K$org$tip.label)) # Plot results par(mfrow = c(2, 2)) plotnj(tree.K$org, X.class, type = "p", edge.width.class = 2, main = "org") axis(1) plotnj(tree.K$equal, X.class, type = "p", edge.width.class = 2, main = "equal") axis(1) plotnj(tree.K$max, X.class, type = "p", edge.width.class = 2, main = "max") axis(1) plotnj(tree.K$star, X.class, type = "p", edge.width.class = 2, main = "star") axis(1) ## End(Not run)