Hi Nicholas.

The nodes in a "phylo" object are numbered 1:tree$Nnode+N, where N is the number of tips in the tree & tree$Nnode is the number of nodes. That means if your tree has 10 tips and 9 internal nodes, the node numbers will be 11, 12, 13, ..., 19.

To use nodelabels(...,pie=XX) you can supply a matrix in which the rows sum to one (as in the transpose of your example matrix). If the node argument is left empty, then it is assumed that the rows are in node order (i.e., 11, 12, ..., 19). This is the order returned by (for example) ace. If you have a matrix in which the nodes are in a different order, you can use nodelabels(...,node=YY,pie=XX) in which YY supplies the node numbers (using the scheme above) for the rows of XX.

Note that as per recent discussion on this email list, ace(...,type="discrete") should not be used for ancestral state reconstruction except for the root node of the tree. I describe this in some posts to my blog (http://blog.phytools.org/2013/03/conditional-scaled-likelihoods-in-ace.html and http://blog.phytools.org/2013/03/a-little-more-on-ancestral-state.html). The scaled likelihoods at internal nodes are conditional likelihoods for the subtree, not marginal ancestral state reconstructions. I believe that the help page for ace will be clarified in future versions of ape.

Good luck. 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://blog.phytools.org

On 3/25/2013 12:09 PM, Nicholas Crouch wrote:
Hi,

Hoe does the function "nodelabels" match data to the phylogeny? Ancestral
reconstruction produces a vector with a sample output:

st


           [,1]         [,2]        [,3]       [,4]        [,5]
[1,] 0.0001381085 0.007642601 0.01638118 0.001591162 0.001268793
[2,] 0.9998618915 0.992357399 0.98361882 0.998408838 0.998731207


The numbers across the top do no correlate with the node numbers on
the phylogeny: compare


nodelabels(pie=t(st))


with


nodelabels()


Would it be possible to create a list vector of the nodes in a
phylogeny with the corresponding values from an ancestral
reconstruction?


An example could be something like:


vector

         Node 1

[1] 0.05

[2] 0.95

         Node 2

[1] 0.3

[2] 0.7



Thanks

        [[alternative HTML version deleted]]

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


_______________________________________________
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