Please report comments or bugs to Pierre Lefeuvre - pierre.lefeuvre@cirad.fr
The "inside-out" circular tree is made to facilitate the visualisation of interactions between individuals in a tree. It is very important to notice that the phylogenetic tree must not be re-rooted or transformed after import in R using the ape read_tree function (i.e. node and tip numbering must be that obtained from the ape read_tree function).
library("ape") library("BoSSA")
test_tree <- rtree(20)
circular_tree(test_tree)
This plot was actually design to offer a conveniant way to display tip to tip, tip to node and node to node interactions. The coordinates of the tips and nodes can be obtained after drawing the tree using the pos_out=TRUE option and use to plot lines (or whatever else) over the tree.
coord <- circular_tree(test_tree,pos_out=TRUE,tip_labels=FALSE) # lines between tips 1 and tips 6, 9 and 12 lines(c(coord[coord[,2]==1,4],coord[coord[,2]==6,4]),c(coord[coord[,2]==1,6],coord[coord[,2]==6,6]),col="red") lines(c(coord[coord[,2]==1,4],coord[coord[,2]==9,4]),c(coord[coord[,2]==1,6],coord[coord[,2]==9,6]),col="red") lines(c(coord[coord[,2]==1,4],coord[coord[,2]==12,4]),c(coord[coord[,2]==1,6],coord[coord[,2]==12,6]),col="red") # lines between tip 19 and node 5 lines(c(coord[coord[,2]==19,4],coord[coord[,2]==length(test_tree$t)+5,4]),c(coord[coord[,2]==19,6],coord[coord[,2]==length(test_tree$t)+5,6]),col="blue")
If you find BoSSA and/or its tutorials useful, you may cite:
citation("BoSSA")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.