Displaying discrete character data on a phylogeny using R

838 views Asked by At

Does anyone know how I can display character data on phylogeny tips, represented as geometric shapes in different colors?
I'm looking for something like this:
http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0086231#pone-0086231-g003

I've tried several R packages, but couldn't find an easy way to do that.
Any ideas?
Thanks!

1

There are 1 answers

0
soungalo On BEST ANSWER

After some more effort, I managed to do it. It's not that hard, actually, but the exact details depend on your data.
Basically, I used the ape package, with this as template:

data(bird.orders)
plot(bird.orders, "c", FALSE, font = 1, label.offset = 3,
     x.lim = 31, no.margin = TRUE)
tiplabels(pch = 23, bg = gray(1:23/23), cex = 2, adj = 1.4)
tiplabels(pch = 22, col = c("yellow", "red", "blue"), adj = 2.5, cex = 2)

bg can take a vector of colors, corresponding to your traits data, such as c(1,1,0,0,0,1,...)
Worked great for me.