emmanuelparadis / ape

analysis of phylogenetics and evolution

Home Page:http://ape-package.ird.fr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Newick tree with a single tip and more than one node not read correctly

emmanuelparadis opened this issue · comments

While looking at #103, I found this:

R> tr1 <- read.tree(text = "(());")
R> tr2 <- read.tree(text = "((,));")

The numbers of tips are correct:

R> Ntip(tr1)
[1] 1
R> Ntip(tr2)
[1] 2

But the number of nodes should be the same:

R> Nnode(tr1)
[1] 1
R> Nnode(tr2)
[1] 2

Maybe this could be fixed while solving #103.

Fixed and pushed here.

@emmanuelparadis : The following seems also to give incorrect results. This is a tree with a single tip and several nodes.

"((((:1):2):3):4):5;" |>
  read.tree(text=_) -> ttt
ttt$edge
     [,1] [,2]
[1,]    2    4
[2,]    3    5
[3,]    3    5
[4,]    4    1