ggtree icon indicating copy to clipboard operation
ggtree copied to clipboard

errors in using viewClade

Open hongzhonglu opened this issue 5 years ago • 4 comments
trafficstars

Hi Guangchuang, When i run the followed code, i can not obtain the clade subtree. Do you know the reason? Thanks for your help!

library(ggtree) library(tidytree) nwk <- system.file("extdata", "sample.nwk", package="treeio") tree <- read.tree(nwk) p <- ggtree(tree) + geom_tiplab() viewClade(p, MRCA(p, tip=c("I", "L")))

The error information is as followed: Error in UseMethod("MRCA") : no applicable method for 'MRCA' applied to an object of class "c('ggtree', 'gg', 'ggplot')" In addition: Warning messages: 1: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation 2: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation 3: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation

hongzhonglu avatar Dec 12 '19 14:12 hongzhonglu

You need to remove the tip= part. Try replacing the line beginning with viewClade with:

viewClade(p, MRCA(p, "I", "L"))

brj1 avatar Dec 12 '19 19:12 brj1

@brj1 Thanks for your help! When i run the code, it still has errors. Do you know the reason? Error in MRCA(p, "I", "L") : unused argument ("L") In addition: Warning messages: 1: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation 2: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation 3: In get_clade_position_(treeview$data, node) : restarting interrupted promise evaluation

hongzhonglu avatar Dec 12 '19 20:12 hongzhonglu

if you really follow the guideline, you will figure it out.

  • [ ] make sure your are using the latest release version

GuangchuangYu avatar Dec 13 '19 02:12 GuangchuangYu

@GuangchuangYu it might be best to change:

* [ ]  make sure your are using the latest release version

to

* [ ]  make sure your are using the latest GitHub version

The release (BioConductor) version is often very out of date, though I admit that this has recently changed.

brj1 avatar Dec 13 '19 18:12 brj1