Geophylogeny plots in R for Dummies

Amid basting my tofurky, here’s a follow-up to my previous post on quick-fix overlays of admixture plots on geographical maps in R. I recently discovered a wonderful R package called “phytools” from Liam Revell, which makes really neat phylogenetic trees (with several new functions added to the “ape” package). I highly recommend Liam’s blog which has a wealth of examples and hacks to make cool figures. “phytools” also has a function called “” which lets you make some neat geophylogenies. I will use the same example from my previous post (you’ll need the same and files) to show you how. You will also need a NEWICK tree string for your phylogeny – I am assuming here that you have a population tree created using your method of choice. Importantly, the ID’s of your GIS coordinates for each locale (here described by the “ID” column) should be the same as the labels in your NEWICK string.

Eg. (3:0.6,(4:0.1,(1:0.03,2:0.03):0.08):0.5);

gps<-read.csv(“”,header=TRUE) #Read input files

Now you should have your tree, GPS coordinates, and admixture proportions read. To plot them all in one figure:

for (x in 1:nrow(gps)){ floating.pie(gps$Lon[x],gps$Lat[x],
col=c("red","blue") }

And tada!

usa-geophyloThere are a lot of way cooler tools that do the same thing, including GeoPhyloBuilder and GenGIS, but hey – if you can do it in four lines of code in R, why not? Happy Thanksgiving from all of us at The Molecular Ecologist! This year, like every year, I am very thankful for R.



About Arun Sethuraman

I am a computational biologist, and I build statistical models and tools for population genetics. I am particularly interested in studying the dynamics of structured populations, genetic admixture, and ancestral demography.
This entry was posted in howto, phylogenetics, population genetics, R, software, STRUCTURE and tagged , . Bookmark the permalink.