richfitz / diversitree

diversitree: comparative phylogenetic analyses of diversification
http://www.zoology.ubc.ca/prog/diversitree
30 stars 9 forks source link

Error : 'tree' must be ultrametric #17

Closed ghost closed 7 years ago

ghost commented 7 years ago

I'm using Rsudio and when I run the script of GeoSSE I got this error: Error in check.tree(tree) : 'tree' must be ultrametric

Although the tree is ultrametric. Thank you!

richfitz commented 7 years ago

Test your tree with ape::is.ultrametric, it probably is not actually ultrametric.

ghost commented 7 years ago

yes it comes out with [False] How could I make this nearly ultrametric tree into ultrametric tree? Thank you!

richfitz commented 7 years ago

I don't know - it varies by your tree making software. The ape package may have something that can help perhaps.

ghost commented 7 years ago

Yes I found one using libraries "ape" and "phangorn, and function is: tr<-nnls.tree(cophenetic(tree),tree, rooted=TRUE,trace=0)

Thank you!

richfitz commented 7 years ago

Great :smile: