[R-sig-phylo] phangorn, parsimony, and polytomies

Ross Mounce rcpm20 at bath.ac.uk
Mon Jan 17 15:33:41 CET 2011

Dear all,

I'm getting incorrect (MP) tree length and topology results with the phangorn package.

I apply Maximum Parsimony to this small morphological dataset
available here: http://db.tt/ycvBoMr (2kb nexus file)

Which results in one fully-resolved topology of length 119.
PAUP* and TNT retrieve  an MPT with a polytomy, of length 118.

Is there a way to make 'optim.parsimony' give the result I would expect it to do with regards to polytomies? Am I doing something wrong?

exact commands used here:

chars <- read.nexus.data("costa08.nex")
chars.ph <- phyDat(chars, type="USER", levels=c("0","1","2","3","4","5","6","7","8","9") )
nex.data.to.matrix <- function(chars) {
  ntaxa <- length(attributes(chars)$names)
  a <- unlist(chars, use.names=F)
  a[a=="?"] <- NA
  b <- matrix(as.numeric(a), nrow=ntaxa, byrow=T)
  rownames(b) <- attributes(chars)$names
z  <- nex.data.to.matrix(chars)
base <- as.phylo(hclust(dist(z)))
ptree <- optim.parsimony(base, chars.ph, method="fitch", cost=NULL, trace=2)

Ross Mounce
PhD Student
Fossils, Phylogeny and Macroevolution Research Group
University of Bath
4 South Building, Lab 1.07

More information about the R-sig-phylo mailing list