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

Is it possible to use geom_insert() in ggtree for circular trees?

I am trying to to include my results of ancestral state estimation as pie charts at the nodes of a phylogenetic tree. It works fine for rectangular trees but I would really prefer a circular one. When I try that though, I get an error…
saucer33
  • 33
  • 1
  • 4
0
votes
0 answers

problems with ggtree and ggtreExtra in R

I'm following the next example to generate a phylogenetic tree with the next code library(ggtreeExtra) library(ggtree) library(treeio) library(ggplot2) The data are available in: https://github.com/YuLab-SMU/ggtree/tree/master/inst/examples tree <-…
abraham
  • 661
  • 8
  • 14
0
votes
1 answer

newick format: number directly after closed parenthesis?

I have a phylogenetic tree in Newick format. A sample from the full string looks like this: "...(tet_rpg.hmm_GCA_000638155.1_seq1:0.001565531,tet_rpg.hmm_GCA_000507745.1_seq1:0.001565235)0.000:5e-09,...". I understand that distances are given by the…
Gragas
  • 19
  • 4
0
votes
1 answer

Tip labels not appearing when reading Newick tree into R with read.tree() and read.newick()

I'm trying to read a Newick-format tree into R. My tree file looks like…
0
votes
1 answer

Adding multiple labels to a branch in a phylogenetic tree using geom_label

I am very new to R, so I am sorry if this question is obvious. I would like to add multiple labels to branches in a phylogenetic tree, but I can only figure out how to add one label per branch. I am using the following code: treetext =…
0
votes
1 answer

ggtree issue with coloring both tips and branches

I'm trying to make a plot using ggtree - but I'm having some issues when I try to have both the tip points and branches colored. The tree works with both of these independently, but when I try them together the fill for the nodes is overrided by the…
Mulligan
  • 85
  • 7
0
votes
1 answer

How to change range of heatmap using gheatmap in R

Im trying to add a heatmap to my phylogenetic tree. The range of the heatmap should be from 0 to 100 instead it only covers the the min and max of the values. Can I reset the range of the…
ghs101
  • 103
  • 6
0
votes
0 answers

how to reduce branch length in ggtree

I am trying to reduce branch length of the tree in ggtree with the following code: ggtree(tree) + geom_tiplab() + xlim(0, 0.08) But it does not work. How to regulate branch length? I manage to produce this picture. Could you please help with…
Anna
  • 53
  • 6
0
votes
1 answer

Add a new column to a list of lists of treedata objects in R

I would need help in order to add some column to a list of lists of treedata objects looking like : . (You can find the data at the end of the post) [The context] > The_dataframe [[1]] [[1]][[1]] 'treedata' S4 object'. ...@ phylo: Phylogenetic…
chippycentra
  • 3,396
  • 1
  • 6
  • 24
0
votes
1 answer

Create a circular phylogeny with stacked bar in R

I'm attempting to create a circular phylogeny with a stacked bar chart at the end of each tree tip. Below is some example code & data at my feeble attempt. I can create the circular phylogeny as well as the stacked bar-chart, but I can't seem to…
Gunther
  • 129
  • 7
0
votes
1 answer

'Error: Must request at least one colour from a hue palette' when using ggtree

I am attempting to create a phylogeny tree that shows different coloured tip points for different dorsal patterns, when I first attempted this a few weeks ago it worked perfectly but trying it now I get the above error code. The only thing I have…
0
votes
1 answer

Using ggtree to color tips of phylogenetic tree

I have very limited experience coding so please bear with me! I have a newick tree and a .txt file with various cell numbers assigned to various clone numbers, shown here: I've followed the steps from the PHE: Bioinformatics page and all I am…
np0119
  • 1
0
votes
1 answer

how to set specific tip label color in ggtree

I knew that I can set tip color by grouping the tip labels like this: library(ggtree) tree<-read.tree(text="(A,(B,C));" dd <-data.frame(taxa=c("A","B","C"),place=c("s1","s1","s2")) p<-ggtree(tree) p<-p %<+% dd +geom_tiplab(aes(color=place)) p So…
Cai Bian
  • 141
  • 1
  • 6
0
votes
0 answers

Add a legend to ggtree plot

I'm using the R package ggtree to plot phylogenetic tree in R. I have sucessfully produced the phylogenetic tree I was interested in, however, I have difficulties in adding a 'legend' to my figures. I have tried the suggestions present in this post…
CafféSospeso
  • 1,101
  • 3
  • 11
  • 28
0
votes
2 answers

ggtree: coloured tree branches AND tip points

Dear stack overflow community, I would like to ask you for help with my problem. I am using package ggtree to plot phylogenetic trees and I would like to show on these plots more information as it is usual in papers. I am especially interested in…