phylogeny
1
1
Entering edit mode
19 months ago
1509636876 ▴ 10

Dear all,

I am a student in the field of phylogeny.I calculated the phylogenetic diversity with R Language. I encountered the above problem. Maybe there's something wrong with my phylogenetic tree.I wish to ask teachers to help me solve this problem.

Thanks a lot!

Error in node.age(sub.tree) : 
    function node.age only works with a rooted phylo object
phylogenetic-tree diversity • 2.4k views
ADD COMMENT
0
Entering edit mode

Hello, my problem is the same as yours, did you finally solve this problem?

ADD REPLY
0
Entering edit mode

May be because it can't be calculated all at once, but in batches

ADD REPLY
0
Entering edit mode

What did you mean? btw I got the same problem, and I don't know how to solve?

ADD REPLY
0
Entering edit mode

Hello, my problem is the same as yours, did you finally solve this problem?

ADD REPLY
0
Entering edit mode

Maybe it needs to be converted to a binary tree.

library(ape)
mytree<-multi2di.phylo(mytree.tre)
ADD REPLY
2
Entering edit mode
19 months ago
Dave Carlson ★ 1.7k

You should check if your phylogeny is rooted. For example:

install.packages('ape')
library(ape)
mytree <- read.tree(file = "mytree.nwk") # assumes newick format
is.rooted(mytree)

This should return TRUE if your phylogeny is indeed rooted.

If it is not rooted, then you will need to root it yourself (e.g., via outgroup, midpoint rooting, etc.). See here for more info: https://rdrr.io/cran/ape/man/root.html

ADD COMMENT
0
Entering edit mode

Thanks a lot!

Thank you for your help. I have checked my phylogeny and it returned TRUE, but the problem still occurs. I don't know what went wrong.

library(ape)
mytree<-read.tree(file = "mytree.nwk")
is.rooted(mytree)
[1] TRUE
library(picante)
sam<-readsample("sample.txt")
ses.pd(sam,mytree,null.model = "phylogeny.pool",runs=99)

Error in node.age(sub.tree) : 
  function node.age only works with a rooted phylo object
ADD REPLY

Login before adding your answer.

Traffic: 2004 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