Questions tagged [ggtree]

For questions about ggtree, the R package for visualization and annotation of phylogenetic trees.

ggtree is a R package dealing with phylogenetic data object and created in order to facilitate and enhance the representation of phylogeny tree using ggplot

source and guide: https://guangchuangyu.github.io/ggtree-book/chapter-ggtree.html

103 questions
0
votes
0 answers

How can I choose which panel(s) in a facet_plot graph are highlighted/labelled?

I want to visualise a tree in ggtree with clades highlighted and genera labelled. This is working fine. I also want to add a dotplot next to the tree, showing the number of studies each species has been used in and which stressors they were…
0
votes
0 answers

Error: ! Can't subset `.data` outside of a data mask context

this is my code: p <- ggtree(tree, mrsd="2022-11-26", as.Date=TRUE,color='black',size=0.3) %<+% metadata_df + theme_tree2() When I run this, it returns this error: Error: ! Can't subset `.data` outside of a data mask context. Run…
Rocha
  • 1
0
votes
0 answers

Phylogeny Building in R from FASTA files error with msa function

Im working on building a phylogeny from scratch with downloaded FASTA sequences from GeneBank. I think Im doing alright up until the multi sequence alignment in the msa package where I get an error Error in convertAlnRows(result$msa, type) : There…
I Del Toro
  • 913
  • 4
  • 15
  • 36
0
votes
0 answers

How to assign branch color according to tip labels in R using ggtree?

I have been searching an answer on the net for a long time. How to color a branch by the tip labels it associated with? For example, if a branch contains n tips and all of their tip label contains a string "USA", I would like to color this branch in…
FunnyFunkyBuggy
  • 495
  • 1
  • 7
  • 21
0
votes
0 answers

Averaging color on branches of phylogenetic trees in R

I want to plot a phylogenetic tree where tips are colored according to a specific variable branches are colored based on the average colors of the tips (or branches) below The idea is that if two tips have a blue and a red color, the branch…
P. Denelle
  • 790
  • 10
  • 24
0
votes
0 answers

The phylo tree can not display the color

The following code generates a phylo tree, which you can see here: , But I have no idea why the tree can't display the color. coul <- brewer.pal(4, "PuOr");coul ReSo<-metadata %>% select(c("id","region","source" ));ReSo colR <-…
sigular
  • 1
  • 1
0
votes
0 answers

gheatmap seems to close open.angle for ggtree

I am creating a tree like this: simple_plot <- ggtree::ggtree(phyloobj, layout = "fan", open.angle = 20, ladderize = T, lwd = .2) And I add a gheatmap like this: h1 <-…
0
votes
1 answer

no applicable method for 'offspring' applied to an object of class "phylo"

I think my issue is actually with future and exporting methods rather than tidytree, but if someone could explain to me what is actually happening and how I should be writing my code to avoid this problem it would be greatly appreciated. I am using…
august
  • 725
  • 5
  • 15
0
votes
0 answers

Issue with overlapping labels in phylogenetic trees in R

I use R shiny and I want to build an interactive phylogenetic tree, but geom_label_repel function or guide_axis doesn’t seem to work. Any solutions on this? I use ggplotly and this is a newick file that I didn’t create myself. Here is some of my…
gforg34
  • 13
  • 5
0
votes
0 answers

Error in `check_aesthetics() using ggtree package

I want to make a hierarchial clustering - dendogram using my dataset by the code in this website https://github.com/YuLab-SMU/treedata-book/blob/master/09_ggtree_tree_objects.Rmd in ggtree for Dendrograms {#dendrogram} section Here's my code…
0
votes
1 answer

Is there a way to highlight multiple clades of an unrooted phylogenetic tree using one geom_highlight() layer and "type='encircle'"?

This is my first post so please tell me if I am breaking your rules! My problem is described in the comments of this simplified version of my code. I want to plot an unrooted phylogenetic tree that neatly highlights selected clades. I like the…
0
votes
1 answer

Compute and plot bootstrap values with ggtree

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,…
Marta N
  • 1
  • 1
0
votes
1 answer

ggtree: highlighting clades by tip labels

Is it possible to highlight clade by tip labels in ggtree (A_ and B_ in the example below)? Finding node numbers is really annoying especially when you have more than 1000 tips. set.seed(2015-12-21) tree <- rtree(30) tree$tip.label <-…
trilisser
  • 170
  • 8
0
votes
0 answers

R: How to remove internal nodes label=NA in treedata

I would like to know if there is a way to remove the internal node labels in my treedata file. Right now I have 'NA's showing up in my phylogenetic tree when visualizing the treedata using ggtree since there is no external data associated with these…
metsteps
  • 1
  • 1
0
votes
0 answers

app$vspace error in building phylogenetic tree in R

I am working with phylogenetic trees. Import the phylogenetic tree file with ggtree::read.tree and get the information with readxl::read_xlsx. I want to visualize in tree. When I try to add color and shape information (from xlsx, I tried assigning…