This is an archived static version of the original phylobabble.org discussion site.

Geophylogenies using GeoJSON

rdmpage

I’ve been experimenting with drawing “geophylogenies” on web maps and have created a live demo at GeoJSON phylogeny demo All a bit crude, but the idea is to take either a NEXUS tree file with added geographical coordinates, or query the BOLD database of DNA barcodes (most of which are geotagged) and create an interactive phylogeny on a map. The demo uses OpenStreeMap, I’ve code for Google Maps as well (hope to add this to the demo shortly). The layout borrows from GenGIS (see GenGIS: A geospatial information system for genomic data and The GenGIS wiki ) but doesn’t need a standalone program. There are some other advantages to using GeoJSON, such as storage in document databases like CouchDB, but I’ll blog about these.

To give you a sense of the visualisation, below is the classic Banza example that I used in 2007 when I started playing with trees on Google Earth iPhylo: Google Earth phylogenies, inspired by Bill Piel’s pioneering experiments.

rob_beiko

Looks good! We’ve been asked a few times to put together a Web version of GenGIS, but have never been able to prioritize this idea. Ditto for BOLD, although we’ve had lots of fun with GBIF (which is not perfect of course, but has its uses)

I think it would be very exciting if we could push data into this, or pull data down from it into GenGIS. Please keep sharing your examples!

rdmpage

@rob_beiko The demo is all API driven. If you have NEXUS in the format shown in the demos, a POST call will return GeoJSON with some embedded CSS. So one approach is to call the API and have GenGIS render the GeoJSON. I could add other input formats, but NEXUS makes it easy to manually tweak stuff when debugging. The BOLD API is slow, and at the moment you have to step through each part via API calls until you get NEXUS with geographic coordinates. Caching results in a database would make things faster, as well as enable some fun spatial queries (find me all phylogenies from Hawaii).

rob_beiko

I think Alex reengineered the GBIF plugin to use JSON although he may not have gotten around to it yet (he’s having fun with cartogram algorithms these days) but the GeoJSON element will probably pique his interest. I don’t see licensing information on your website, but is it OK with you if we potentially reuse some of your code for interfacing with BOLD? With attribution of course. You’re of course welcome to rip any code out of GenGIS should it be useful to you.

NEXUS is no problem - I spent my postdoc mucking around with NEXUS files for MrBayes etc., so building and working with them will be pretty straightforward

rdmpage

Feel free to play with the code. The BOLD API stuff is fragile, as I’ve discovered this morning. I’ll need to add some error handling code for this. I hope to add the BLAST pipeline shortly(ish).

rdmpage

I’ve added some background to this project on iPhylo http://iphylo.blogspot.co.uk/2015/01/geojson-and-geophylogenies.html