Hi Nick,

it might be useful to plot the node labels on the tree:

plot(tree, label.offset = .25)
tiplabels()
nodelabels()

Regards,
Klaus




On Tue, Sep 7, 2021 at 4:56 AM Emmanuel Paradis <emmanuel.para...@ird.fr>
wrote:

> Hi,
>
> A tree has n terminal nodes (aka tips) and m internal nodes (aka nodes
> simply). In the edge matrix, the tips are numbered 1:n and the nodes are
> numbered (n+1):(n+m) (same than n+1:m). n and m can be found with:
>
> n <- Ntip(tree) # or length(tree$tip.label)
> m <- Nnode(tree) # or tree$Nnode
>
> Details can be found in:
>
> http://ape-package.ird.fr/misc/FormatTreeR.pdf
>
> Best,
>
> Emmanuel
>
> ----- Le 5 Sep 21, à 21:07, Nick Youngblut nyoun...@gmail.com a écrit :
> > For `ape::dist.nodes()`, how can one match the output matrix
> rows/columns with
> > the node IDs in the tree (eg., the tip.labels)? I cannot just use
> > `ape::cophenetic()` in my particular situation. The docs for
> > `ape::dist.nodes()` state:
> >
> > ```
> > … in the case of dist.nodes, the numbers of the tips and the nodes (as
> given by
> > the element edge).
> > ```
> >
> > … but tree$edge doesn’t provide any direct info about which nodes are
> internal
> > vs external and how the external tip labels map to the tree$edge matrix.
> >
> > Thanks,
> > Nick
> > _______________________________________________
> > 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/
>


-- 
Klaus Schliep

Senior Scientist
Institute of Computational Biotechnology
TU Graz
https://icbt.tugraz.at
https://www.phangorn.org/ <http://www.phangorn.org/>

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

Reply via email to