Skip to content

Instantly share code, notes, and snippets.

@thanhleviet
Created December 8, 2021 15:49
Show Gist options
  • Save thanhleviet/2fd14fd5f895c16793ce19cc449199f9 to your computer and use it in GitHub Desktop.
Save thanhleviet/2fd14fd5f895c16793ce19cc449199f9 to your computer and use it in GitHub Desktop.
Colour tips by sample
library(dplyr)
library(ggtree)
tree <- read.tree("Benchmarking_tree_07Dec21.nwk")
tips <- tree$tip.label %>%
tibble(tip = .) %>%
mutate(sample = gsub("_[a-zA-Z\\_]+","",tip))
p <- ggtree(tree) %<+% tips
p + geom_tippoint(aes(color= sample), show.legend = F)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment