gen.unit.K: Generate Comprehensive Trees.

View source: R/p_tool_star_tree.r

gen.unit.KR Documentation

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.

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

Value

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.

Author(s)

Wei-Chen Chen wccsnow@gmail.com

References

Phylogenetic Clustering Website: https://snoweye.github.io/phyclust/

See Also

gen.equal.star.anc.dec.

Examples

## 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)

snoweye/phyclust documentation built on Sept. 12, 2023, 5 a.m.