Learn R Programming

phyclust (version 0.1-9)

as.star.tree: Coerce a rooted tree to a star tree in Class phylo

Description

Coerce a rooted tree generating by ms to a star tree and maintain a bifurcation structure.

Usage

as.star.tree(rooted.tree, keep.bifurcation = TRUE)

Arguments

rooted.tree
a rooted tree in Class phylo.
keep.bifurcation
keep a bifurcation structure.

Value

  • Return a rooted tree in Class phylo with a star shape.

code

keep.bifurcation

Details

A tree with a star shape means that all internal branches are 0 and all leaf branches are equal.

The rooted.tree should be in a phylo class of ape, and may be created by ms.

Basically, it is a list with an attribute that the class is phylo, and the other elements are:

  • 'edge'
{edge ids.} 'Nnode'{number of internal nodes.} 'tip.lab'{number of tips (leaves).} 'edge.length'{length of edges.}

References

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

See Also

ms, read.tree, as.phylo, plot.phylo.

Examples

Run this code
set.seed(1234)
ret.ms <- ms(5, 1, opts = paste("-T", sep = " "))
tree.ms <- read.tree(text = ret.ms[3])
str(tree.ms)
(tree.star <- as.star.tree(tree.ms))

# Plot results
par(mfrow = c(1, 2))
plot(tree.ms, type = "u", main = "original tree")
plot(tree.star, type = "u", main = "as star tree")

Run the code above in your browser using DataLab