Hi Heath. You should be able to do this with phangorn.
Say, you have a "phylo" object tree & a standard matrix, X, containing numerically coded states for all species & characters. I'll also assume that you have a common Q matrix for all characters that you want to fix.
You can do: Y<-phyDat(X,type="USER",levels=unique(as.vector(X)) lik<-pml(tree,Y,Q=Q) This will compute the likelihood you want, I think. All the best, Liam Liam J. Revell, Assistant Professor of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://phytools.blogspot.com On 9/13/2012 3:38 PM, Heath Blackmon wrote:
Hello All, Does anybody know of a function that allows you to calculate the likelihood of a tree based on discrete data (not DNA) and a specified Q-matrix. I know that this must be going on as a step in lots of functions like fitDiscrete or ace but I am having some trouble figuring out how to do this short of writing the whole process from scratch. Any suggestions or pointers would be much appreciated. Cheers
_______________________________________________ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo