How to automate creation of many geom_taxalink arcs?

34 views
Skip to first unread message

mathew...@googlemail.com

unread,
Aug 18, 2017, 5:20:27 AM8/18/17
to ggtree
Hi,

I want to generate geom_taxalink arcs between many (potentially hundreds) of taxa in my trees.  However, it seems like you need to script each one individually e.g. + geom_taxalink(A,B,curvature=-0.5).  Is there way to feed a data frame or multiple lists to this part of the command? Maybe a 'for' loop?

Many thanks,

Mat
Message has been deleted

mathew...@googlemail.com

unread,
Aug 18, 2017, 11:03:58 AM8/18/17
to ggtree
Never mind, I figured out how to add them using a loop (below if anyone is interested):


mytree <- treedata
for(row in c(1:nrow(linklist))){
  mytree <- mytree + geom_taxalink(linklist$taxa1[row],linklist$taxa2[row],color='red')
}
mytree
Reply all
Reply to author
Forward
0 new messages