as.star.tree {phyclust} | R Documentation |
Coerce a rooted tree generating by ms
to a star tree and
maintain a bifurcation structure.
as.star.tree(rooted.tree, keep.bifurcation = TRUE)
rooted.tree |
a rooted tree in |
keep.bifurcation |
keep a bifurcation structure. |
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.
If keep.bifurcation
is TRUE, then internal branches are set to be 0
and leaves branches are set to the original tree height. Otherwise,
the internal branches will be dropped from rooted.tree.
Return a rooted tree in Class phylo
with a star shape.
Wei-Chen Chen wccsnow@gmail.com
Phylogenetic Clustering Website: http://snoweye.github.io/phyclust/
ms
,
read.tree
,
as.phylo
,
plot.phylo
.
## Not run: library(phyclust, quiet = TRUE) 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") ## End(Not run)