Problem annotating bootstrap values

6 views
Skip to first unread message

Yarabi Ignacio

unread,
May 28, 2024, 6:08:45 PMMay 28
to ggtree
Hello everybody. I am making a phylogenetic tree but when I add the bootstrap values ​​I get some greater than 100. I leave you the code I am using:

library(ggtree)
library(viridis)
library(gdata)
library(dplyr)
library(readxl)
library(ggplot2)
library(ggnewscale)
library(gplots)
library(paletteer)
library(scales)
library(ape)



arbol_seg_s <- read.tree("arbol_segmento_s_ref_SN.fa.treefile")

# Enraizar el árbol en un nodo específico (por ejemplo, en la raíz)
arbol_enraizado <- root(arbol_seg_s, outgroup = "L37904.1")



datos <- read_excel("metadata_segmento_S_sn.xlsx")


Pais <- data.frame("Pais" = factor(datos$Pais))
Año <- data.frame("Año" = factor(datos$Año))

rownames(Pais) <- datos$ID_nuevo
rownames(Año) <- datos$ID_nuevo

arbol_enraizado$tip.label <- datos$ID_nuevo


p1 <- ggtree(arbol_enraizado, layout = 'rectangular') +
    geom_tiplab(size = 2.0) +
    geom_text2(aes(subset = !isTip, label = as.numeric(node.labels)), hjust = -0.3) + 
   
    theme(
        legend.position = "none",
        axis.title.x = element_blank(),
        axis.title.y = element_blank(),
        plot.title = element_text(
            size = 15,
            face = "bold",
            hjust = 0.9,
            vjust = -15
        )
    )

p1 <- p1 + theme(plot.margin = margin(0, 0, 0, 0, "cm")) # Ajustar según necesidades


p2 <- gheatmap(p1, Pais,
               offset = 0.01,
               width = 0.20,
               color = NULL,
               colnames = FALSE) +
    scale_fill_manual(name = "Pais",
                      values = c("chile" = alpha("#5499C7", 0.5),  # Ajustar transparencia con alpha
                                 "argentina" = alpha("#A569BD", 0.5)),  # Ajustar transparencia con alpha
                      breaks = c("chile", "argentina"),
                      labels = c("Chile", "Argentina")) +
    theme(legend.position = "right",
          legend.title = element_text(size = 12),
          legend.text = element_text(size = 12),
          legend.box = "vertical",
          legend.margin = margin()) +
    guides(fill = guide_legend(keywidth = 0.7, keyheight = 0.7)) # Ajusta keywidth según tus necesidades

p3 <- p2 + new_scale_fill()

print(p3)

I would be very grateful if you could help me



arbol_segmento_s_ref_SN.fa.treefile
metadata_segmento_S_sn.xlsx
Reply all
Reply to author
Forward
0 new messages