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
2
votes
1 answer

Add legend into ggtree (ggplot) R

I'm building a tree with ggtree on R. library(ggtree) here is the newick file content: tree = read.newick("newick_tree") Here is the code I use: colfunc <- colorRampPalette(c("red", "blue")) col=colfunc(110) for (i in…
chippycentra
  • 879
  • 1
  • 6
  • 15
2
votes
1 answer

How do I annotate a ggtree object with bootstrap values?

I have a phylogenetic tree of the class phylo with 24 tips and 23 internal nodes. I ran a bootstrap analysis on this tree and the data using boot.phylo, which returned a vector of 23 bootstrap values. I created a ggtree object from my original tree…
Namenlos
  • 475
  • 5
  • 17
2
votes
1 answer

Adding a ggtree object to already existing ggplot with shared y-axis

I have the following data and plot: Data: structure(list(type = c("mut", "mut", "mut", "mut", "mut", "mut", "mut", "mut", "gene", "gene", "gene", "gene"), gene = c("gyrA", "gyrA", "gyrB", "gyrB", "parC", "parC", "parE", "parE", "qnrA1", "qnrA1",…
Haakonkas
  • 961
  • 9
  • 26
2
votes
2 answers

ggtree::facet_plot - Second panel uses xlim parameter from first one

I have performed statistical tests on lots of genera that are hierarchically structured with a tree, so I have a p-value for each of the genus in the tree. I want to visualize both the tree and the p-value in a panel plot, as it's possible to do…
abichat
  • 2,317
  • 2
  • 21
  • 39
1
vote
1 answer

How to colour specific lines in ggtree/ggplot2 plot using geom_line?

How do I colour specific lines joined by taxa? The lines connect through matching tip labels on individual trees and I want to colour the lines via pre defined groups. e.g G1, G2 etc. I have been following this guide: guide I have managed to create…
bmolle
  • 11
  • 2
1
vote
1 answer

How to plot a large ggtree/ggplot over multiple pdf pages in R?

I managed to plot a phylogenetic tree using ggtree and pdf() but cant break it down to fit on multiple pages to make it readable for users. You can make a tree following this link Heres the code for the tree and its output : make_tree_plot <-…
1
vote
0 answers

How can I label internal nodes with SHaLRT and UFBoot values using ggtree?

I am trying to construct a phylogenomic tree in ggtree, and would like to present a few different versions. The tree was constructed using IQTree, and the UFBoot and SHaLRT values are stored as a list of characters called "node.label". I have…
1
vote
0 answers

How do I fix my tree after dropping tip on a phylogenetic tree :0 character label?

After using drop.tip command from the APE package on a phylogenetic tree, I plotted my tree using R and everything looked ok. After exporting the newick file, I found that the tips I dropped ended up dropping just the labels and were replaced by…
1
vote
0 answers

How to attach numbers next to nodes and tips in a tree illustration produced by ggtree? The numbers are imported from an external tsv file

This is a bioinformatic question. For those of you familiar with ggtree, how do I go about annotating numerical information per node and tip in ggtree? Say for example I have a phylogenetic tree, and for each node and tip I have a gene-count. How…
Sudoh
  • 313
  • 2
  • 11
1
vote
0 answers

ggtree setting height scale

I'm doing microssatellite analysis to understand genetic relationship between fungal isolates. For that I first calculated the Jaccard’s coefficient and then want to generate a dendrogram using UPGMA cluster analysis. I did the following: Distance…
DarynaP
  • 11
  • 1
1
vote
1 answer

Add families annotation to ggtree next to geom_bar in r

I would need help in order to add information within a plot. Here is the plot : (Code to get this plot below) And I would like to add a new element with families information stored in this tab: labels family 1 t2 Hominidae 2 t4 …
chippycentra
  • 3,396
  • 1
  • 6
  • 24
1
vote
1 answer

ggtree: how to label tree branches in the simplest way

I want to label a specific branch (e.g., "Group 1") on the tree, but I didn't found a specific function to do that. Any ideas? set.seed(123) tree <- rtree(30) plot(tree)
trilisser
  • 170
  • 8
1
vote
0 answers

scale_color_gradient2 in gheatmap

I am drawing phylogenetic tree and added heatmap with gheatmap(). I would like to change color scale bar using low, mid, and high point. I thought scale_color_gradient2() made that possible, but it doesn't work. p <- ggtree(tree.c$scenario.1,…
marie
  • 315
  • 1
  • 9
1
vote
1 answer

Reposition the labels on ggtree

I am trying to visualize my ggtree and I seem to be stuck on the last final step; repositioning the tree labels from horizontal to verticle so that they do not overlap. If I change the geom = "text" on the geom_tiplab function, I get what I want but…
1
vote
1 answer

set x axis on ggtree heatmap in R

I would like to set x axis on a heatmap ggtree. This is my code ggtree(working_tree,open.angle=15, size=0.1) %<+% avian %<+% color + aes(color = I(colour)) + geom_tippoint(size = 2,) + geom_tiplab(size = 3, colour = "black") + …
Anh
  • 735
  • 2
  • 11