Annotated dendogram (tree) from tbl_graph
0
0
Entering edit mode
@ee934b4b
Last seen 20 months ago
France

Hello,

I have a problem because I have little experience with the tbl_graph format and how to use it well with ggtree (or other script to draw a tree). I have created a tbl_graph (from clustree) of this type (object named trees)

# A tbl_graph: 386 nodes and 385 edges
#
# A rooted tree
#
# A tibble: 385 × 10
from to from_clust to_clust from_TVD to_TVD count in_prop width is_core
<int> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <lgl>
1 1 2 1 1 1 2 2139 1 1.5 TRUE
2 1 3 1 3 1 2 984 1 1.5 TRUE
#
# A tibble: 386 × 5
node COL cluster size sc3_stability
<chr> <fct> <fct> <int> <dbl>
1 COL1C1 1 1 3123 0.120
2 COL2C1 2 1 2139 0.240
3 COL2C3 2 3 984 0.225

by doing ggtree(trees), I easily get a dendogram but I can't (yet) manage to "annotate" this dendogram (I would like to be able to put the names of the clusters of the last level - leaves - and possibly a color code. For the moment I only have the dendogram.

Would you have a solution? I've been looking around and I've seen something around geom_nodepoint(), geom_tippoint(), which could work, but I don't understand it yet. In my example, I have a data.frame with the names of the end sheets (end nodes) ... and possibly colors.

Thanks in advance

Christian

Translated with www.DeepL.com/Translator (free version)

dendogram ggtreeExtra ggtree annotation Annotation • 990 views
ADD COMMENT
0
Entering edit mode

Does the annotation part of the vignette not suit your needs?

ADD REPLY
0
Entering edit mode

Thx,

actually I have started reading it and think at some point I'll get it. However, I was looking for something that would not need me to recapitulate the tree and add the annotations inside. Like annotate individuals of the last clustering (which is the last level of the tree).

Thanks a lot for pointing this to me

ADD REPLY
0
Entering edit mode

And another pb, is that I am not able to reach the Newick format of the tree, so not sure how easy it is, as I do not have the distances, for me to write the annotations in a Newick format. Again, I am such a beginner than it may be a lost cause before a year.

ADD REPLY

Login before adding your answer.

Traffic: 393 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6