How to convert phylo object to hclust object in R
2
0
Entering edit mode
6.8 years ago
ttsutsui1028 ▴ 20

I think there several similar question but I can't solve my issue following with previous answer.

I am trying to convert phylo object to hclust object by following.

dna <- read.dna("my.dna.aln", format="fasta")
dist <- dist.dna(dna)
dna.nj <- nj(dist)
dna.hcl <- as.hclust(dna.nj)
 error in as.hclust.phylo(dna.nj) : the tree is not ultrametric

I really need to convert hclust rather than dendrogram. When I tried to use chronopl it gives me following error

 chronopl(dna.nj, 0, age.min = 1, age.max = NULL,node = "root", S = 1, tol = 1e-8,CV = FALSE, eval.max = 500, iter.max = 500)

 error in chronopl(dna.nj, 0, age.min = 1, age.max = NULL, node = "root": 
 at least one terminal branch is of length zero:
 you should remove it to have a meaningful estimation.

Do you have any suggestion. Thank you, Taiki

ape R alignment • 4.4k views
ADD COMMENT
0
Entering edit mode
ADD COMMENT
0
Entering edit mode
3.9 years ago

Approach the problem from the other end:

dist.dist <- as.dist(dist)
DNA.hc <- hclust(dist.dist, method = "average")
ADD COMMENT

Login before adding your answer.

Traffic: 1303 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6