Data frame error when visualizing tree with MSA on different Newick tree file

227 views
Skip to first unread message

Benjy Jek Yang Tan

unread,
Dec 28, 2018, 4:08:43 AM12/28/18
to ggtree
Hi, 

I was wondering if you could help me with this error.

I was trying to visualize a MSA together with my tree using 2 different Newick tree files. On the first one, I was able to make the figure. 

However, when I used it on the second Newick file, with the same FASTA file, I received an error as below.

Error in data.frame(name = names(seqs)[i], xmin = xmin, xmax = xmax, ymin = ymin[i],  : arguments imply differing number of rows: 1, 8985, 0

I tried to look into the error but I don't really understand what caused this error as I was using the same FASTA file. 
Could it be because of the strange results of Newick2.nwk?

I attached the Newick files and FASTA file I used as below.

Hope to hear back soon. Thank you very much.


Newick1.nwk
Newick2.nwk
Alignment.fasta
Rplot_Newick1.jpg

Yu, Guangchuang

unread,
Dec 28, 2018, 4:47:15 AM12/28/18
to Benjy Jek Yang Tan, ggtree

if you use latest version of ggtree, it will throw the following error:

Error in msaplot(ggtree(y), fa) :
  taxa name in input sequences are not match with the ones on the tree, please check your input files...

Based on this msg, you should know what’s going on here.


--
1. G Yu, DK Smith, H Zhu, Y Guan, TTY Lam*. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data, Methods in Ecology and Evolution, 2017, 8(1):28-36. doi:10.1111/2041-210X.12628
 
2. G Yu*, TTY Lam, H Zhu, Y Guan*. Two methods for mapping and visualizing associated data on phylogeny using ggtree. Molecular Biology and Evolution, 2018, 35(2):3041-3043. doi: 10.1093/molbev/msy194
 
Homepage: https://guangchuangyu.github.io/software/ggtree
---
You received this message because you are subscribed to the Google Groups "ggtree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bioc-ggtree...@googlegroups.com.
To post to this group, send email to bioc-...@googlegroups.com.
Visit this group at https://groups.google.com/group/bioc-ggtree.
To view this discussion on the web visit https://groups.google.com/d/msgid/bioc-ggtree/374da320-54ee-4c94-9116-e72de565c30b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
--~--~---------~--~----~------------~-------~--~----~
Guangchuang Yu PhD
Professor
School of Basic Medical Sciences
Southern Medical University
Guangzhou, China
-~----------~----~----~----~------~----~------~--~---

Benjy Jek Yang Tan

unread,
Dec 28, 2018, 4:55:25 AM12/28/18
to ggtree
Thank you Prof. Yu for your prompt reply. 

I see now. That makes things clearer. I will have a look at it. 

However, just to note, I am using the latest version of ggtree (1.14.4) and also the latest version of R. But I did not see the message as mentioned by you. Perhaps there is a bug somewhere? 

Benjy Jek Yang Tan

unread,
Dec 28, 2018, 5:30:55 AM12/28/18
to ggtree
Thank you very much for your reply. 

I was able to solve the issue. It was indeed a mistake of inconsistent taxa name. 

Thanks again!
Reply all
Reply to author
Forward
0 new messages