Cartogram and GCPD Tutorial

From The GenGIS wiki
Revision as of 16:05, 16 May 2017 by Beiko (Talk | contribs)

Jump to: navigation, search



California is a global hotspot for salamander diversity owing to its climate and geography, including the arboreal salamander Aneides lugubris, which lives in western California. A 2015 study by Reilly et al. used BEAST Drummond et al., 2012) to construct a phylogenetic tree relating mitochondrial DNA from 35 salamanders at 26 locations in California, combined with 43 additional samples associated with 27 locations from GenBank. Using phylogeography, the authors classified individuals into Northern, SF Bay/Sierra Nevada, Santa Cruz, Pinnacles, Central Coast and Southern clades.

In this short tutorial, we illustrate the application of point-based cartograms in GenGIS to the phylogeographic visualization of this dataset.

Loading Data and Changing Visual Properties

The Salamander data consists of a map (Cali.tiff), location data (Aneides_Locations_Filtered.csv) and a phylogenetic tree (Aneides_Filtered.tre). The zip archive containing these files can be found *here.

For basic information on using the GenGIS interface and loading data please see the Banza Katydid Tutorial.

To recreate the image below, do the following steps in order. Note that the aesthetic changes (colours, vertical exaggeration) are optional, and you will get the same cartograms no matter what.

(1) Load the "Cali.tif" map

(2) Change the map colours according to the following scheme:


(3) Change the vertical exaggeration to 5.

(4) Load the location file, and edit the colours as follows:


This is the "Continuous: Scientific" colour scale, with the Northern clade set to yellow to increase the contrast.

(5) Load the tree, and choose "propagate discrete colours", set the default colour to black, and change the line thickness to 5 in the Properties menu

You should end up with an image that looks like this:


Creating Cartograms

In this section we will create cartograms based on the location density and phylogenetic information in our data.

Location density

By default the count of samples at each location is used to transform the map, which defaults to one per location if no Sequence file is loaded. To create a cartogram right click the Map in the menu under the "Layers" tab and select the Cartogram tab from the Properties menu.

Let's go with 10 and 10 for location radius and variable multiplier now. Let's also choose "Resize Density Map" at 50% to increase the speed of the procedure. The percentage controls the decrease when the map is resized, with 60% as the maximum value (in practice, values over 60% give cartograms that are unusable). In general, the larger the values of location radius and variable multiplier, the more pronounced the effect of resizing will be, and the points will track the map less well.


Click "Go!" to create the cartogram. Note that "Apply" has no effect in this menu.

If we hide the tree, then the cartogram should look like this:


To fine tune the cartogram two parameters can be adjusted: Location Radius and Variable Multiplier. The Location Radius adjusts the size of the grid cells the map is divided into when the cartogram is created, while the Variable Multiplier amplifies the value of populated grid cells by a X times multiple of the stored value.

You can click "Restore Map" in the cartogram tab to reset the map to its original state. Now try setting the location radius to 100 and re-running.


Phylogenetic transformations using the GCPD

GenGIS can use data besides location count to adjust the map. We have developed the Geographically Coupled Phylogenetic Distance to adjust the distortion effects based on phylogenetic diversity.

Figure 1. A cartogram created using Aneides lugubris and a Location Radius value of 15 and a Variable Multiplier of 5.

Contact Information

We encourage you to send us suggestions for new features. GenGIS is in active development and we are interested in discussing all potential applications of this software. Suggestions, comments, and bug reports can be sent to Rob Beiko ( If reporting a bug, please provide as much information as possible and, if possible, a simplified version of the data set which causes the bug. This will allow us to quickly resolve the issue.