Learn R Programming

phyclust (version 0.1-9)

gen.unit.K: Generate comprehensive trees.

Description

Generate comprehensive trees for simulation studies.

Usage

gen.unit.K(K, N.K, rate.anc = 10, rate.dec = 10)

Arguments

K
number of clusters, $K$.
N.K
number of sequences for each cluster, a vector with length K.
rate.anc
$r_a$, growth rate of ancestral tree.
rate.dec
$r_d$, growth rate of descendent tree.

Value

  • A list contains all information of generation and results including:
  • 'K'number of clusters.
  • 'N.Knumber 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.

Details

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 appliedas.star.treeand attached to the ancestral tree, then scale the maximum height to be 1.

References

Phylogenetic Clustering Website: http://thirteen-01.stat.iastate.edu/snoweye/phyclust/

See Also

gen.equal.star.anc.dec.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab