Hi Emmanuel and the rest of the list, In some code, I use the ape function is.binary.tree to test if a phylogeny is fully dichotomous. However, some recent analyses have made me wonder if this wasn't the right choice. I'm not sure if the following is a bug report me or me not understand the reasoning of a function in ape.
You see, I had an 'unrooted' (in ape terminology) tree with a basal trichotomy. I wouldn't consider such a tree to be fully dichotomous, but is.binary.tree says such a tree is in fact binary (i.e. returns TRUE). It appears to be limited to just trees with basal trichotomies. If the root is an even larger polytomy (more than three descendant nodes), is.binary.tree returns FALSE. I was a bit surprised, as the function description says "This function tests whether a phylogenetic tree is binary, i.e. whether every node (including the root node) has exactly two descendant nodes." This would make me think it also tests if the root has two descendant nodes, but that doesn't seem to be the case, unless an unrooted tree with three lineages is (for some reason I'm unaware of) considered to have two descendant nodes. There's also some stuff in ?is.binary.tree about fully dichotomous trees having 2Ntip-2 edges, which is only true if the root is also dichotomous (and thus the tree is 'rooted'). It isn't true for taxa with a basal trichotomy. Here's some code. I got the same results with both ape v3.0-11 and the v3.1 that Emmanuel had sent out two weeks ago. library(ape) tree<-rtree(10) #collapse root tree$edge.length[which(tree$edge[,1]==11)[1]]<-0 tree1<-di2multi(tree) is.binary.tree(tree1) is.rooted(tree1) tree<-stree(3) is.binary.tree(tree) is.rooted(tree) tree<-stree(4) is.binary.tree(tree) is.rooted(tree) Is.rooted correctly returns FALSE, so does that mean best practice to get a tree where every node has two descendant nodes would be use is.binary.tree() & is.rooted()? Curious on your thoughts on this and the intent of is.binary.tree. -Dave -- David W. Bapst, PhD Adjunct Asst. Professor, Geology and Geol. Eng. South Dakota School of Mines and Technology 501 E. St. Joseph Rapid City, SD 57701 http://webpages.sdsmt.edu/~dbapst/ http://cran.r-project.org/web/packages/paleotree/index.html _______________________________________________ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/