I imported the ClustalW2 tree to R using the monkey function and read.tree ape package functions. I evaluate molecular eyelids using the chronop function, which leads to an ultrametric binary tree. From which I want to create an R-assembly in a dendrogram object.
The trees are beautifully located and are the real object of phylo. However, I am trying to convert it to problems:
Minimum working example:
require(ape) test.tree <- read.tree(file = "testree.phylip", text = NULL, tree.names = NULL, skip = 0, comment.char = "#", keep.multi = FALSE) test.tree.nu <- chronopl(test.tree, 0, age.min = 1, age.max = NULL, node = "root", S = 1, tol = 1e-8, CV = FALSE, eval.max = 500, iter.max = 500) is.ultrametric(test.tree.nu) is.binary.tree(test.tree.nu) treeclust <- as.hclust.phylo(test.tree.nu)
The resulting tree looks βexcellentβ, I check that the tree is not ultrametric and binary, and you want to convert it to an hclust object in order to eventually create its dendrogram object.
> is.binary.tree(test.tree.nu) [1] TRUE > is.ultrametric(test.tree.nu) [1] TRUE
After trying to make an hclust object from a tree, I get an error message:
> tree.phylo <- as.hclust.phylo(test.tree.nu) Error in if (tmp <= n) -tmp else nm[tmp] : missing value where TRUE/FALSE needed In addition: Warning message: In nm[inode] <- 1:N : number of items to replace is not a multiple of replacement length
I understand that this is a very detailed question, and it might be better to ask questions that are specifically related to certain packages elsewhere, but I hope someone can help me.
All help is much appreciated
Hello,
File upload
The Phylip file can be downloaded here http://www.box.net/shared/rnbdk973ja