NorwegianVeterinaryInstitute / ALPPACA

A tooL for Prokaryotic Phylogeny And Clustering Analysis
BSD 3-Clause "New" or "Revised" License
10 stars 3 forks source link

bootstrap display on branches #115

Open evezeyl opened 7 months ago

evezeyl commented 7 months ago

Hi, I know how to do that now, should we modify the scripts to be able to display on branches at next update ? That would facilate interpretation for our user who do not know how to manipulate trees ...

evezeyl commented 5 months ago

To plot the bootstrap at the branch and not at the node, here is an example to put the bootrap value on the branch with text label (but ok we can transform into points also ... have link scripts bellow that do that

rooted_tree_simple_plot_list$simple_plot  +
 # get the nodes labels on the branches 
   ggplot2::geom_text(mapping = aes(x = branch, 
                                   label = label, 
                                   color = "label_monophy_large"),
                     data = . %>% 
                       filter(!isTip, 
                            as.numeric(node_depth) >= 5,
                            as.numeric(labels_bootstrap) >= 95,
                            !inNorway),
                     size = 2) ...

All the examples can be found in https://github.com/NorwegianVeterinaryInstitute/WTE_AI_article/tree/main/code/quarto in any of the ...HxNx scripts

just adding that note: If in case we need to root the tree based on outgroup - edgelabel is important to avoid shifting of position

rooted_tree <- ape::root(tree, 
                         outgroup = c("labeloftip1", "labeloftip21"),
                         resolve.root = T,
                         edgelabel = T)
evezeyl commented 5 months ago

just actually what is important is to use a first plot data to get the segment....