Hi Laura.

The phytools functions resolveNode and resolveAllNodes could be used. They resolve either a single node in all possible ways; or all nodes in all possible ways, returning a "multiPhylo" object. Note that in the latter case the number of trees can be quite large. From the phytools doc: "For resolveNode applied to a multifurcation with n descendants, the number of resolved trees will be equal to the number of possible rooted trees of n taxa. (For instance, three for a trifurcation, 15 for a quadrifurcation, and so on.) For resolveAllNodes the number of fully resolved trees will be equal to the product of numbers for resolveNode applied to each multifurcation separately. (For instance, 45 for a tree containing one trifurcation and one quadrifurcation.)" To get a random set of resolved trees, rather than all possible trees (because this number can be high), you could start with one multifurcating node in the tree, resolve it in all ways using resolveNode, pick one of those resolutions, then move to the next node & so on. I will try to post a formal solution & then share it to the list.


All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 6/21/2017 10:38 AM, Laura Jackson wrote:
Hi all,

I am using the ape package to randomly resolve polytomies using 'multi2di'
and wondering if there is a way to use this function to get a single output
tree file that contains multiple different randomly resolved trees using
some number of resamplings?

Thanks,
-Laura


_______________________________________________
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/

Reply via email to