Reputation: 1
I have a file with the phylogenetic tree that is the output of doing RAxML.
I want to plot this tree with the R package ggtree
and show the bootstrap values and the internal numbers of the nodes.
The actual code plots the tree with the node numbers, but I don't know if I have to calculate the bootstrap values or get them from the RAxML file. If I have to calculate them, how can I do it? I have searched for ape
package functions but I can't find anything.
treeR <- treeio::read.tree("RAxML_bipartitionsBranchLabels.tre")
treeplot <- function(tree, x){
ggtree(tree) +
geom_tiplab(align=TRUE, size=3, color='#609ECF', linesize=.5) +
hexpand(.3) +
labs(title = x) +
# geom_text(aes(label=bootstrap), hjust=-.25, size = 3) +
geom_text2(aes(subset=!isTip, label=node), # subset=!isTip
size = 3.5,
color = "#0063B1",
hjust = 1,
vjust = -1.5
)
}
treeplot(treeR, "Phylogenetic tree")
RAxML file: https://drive.google.com/drive/folders/1KcOnFWUcLetkDj5Q9Y2KQaSHdsQf2isR?usp=sharing
Upvotes: 0
Views: 925
Reputation: 1
Your script looks ok, the only thing is that you should read the tree using the read.raxml function
https://rdrr.io/bioc/treeio/man/read.raxml.html
This should reveal your bootstrap values
Upvotes: 0