Open ArtPoon opened 5 years ago
This is a problem with the ape
package, but I'm noting it here for future reference.
We can't simply work around the is.rooted
function:
.is.rooted_ape <- function(phy, ntips)
{
if (!is.null(phy$root.edge)) return(TRUE)
if (tabulate(phy$edge[, 1])[ntips + 1] > 2) FALSE else TRUE
}
because the root.edge
attribute is set by read.tree
.
Minimal example:
> t1 <- read.tree(text="((A:1,B:1):1,C:1,D:1);")
> t1
Phylogenetic tree with 4 tips and 2 internal nodes.
Tip labels:
[1] "A" "B" "C" "D"
Unrooted; includes branch lengths.
> t1 <- read.tree(text="((A:1,B:1):1,C:1,D:1):0;")
> t1
Phylogenetic tree with 4 tips and 2 internal nodes.
Tip labels:
[1] "A" "B" "C" "D"
Rooted; includes branch lengths.
See also this thread: https://groups.google.com/forum/#!topic/raxml/tybTbgZmazk
I don’t think this is a problem with ape
- RAxML seems to be sticking an extra branch of length zero as a suffix on the tree string
but BioPython disagrees: