The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

GBrowse/GMap Mashup

The purpose of this code is to create a mash up of GBrowse data and Google Maps that displays diversity data of a feature in the locations that they were sampled.

Code

This code was started as a modification of the gbrowse_details script.

Template Toolkit is used to generate the html for the page. The template is encased after the __DATA__ token.

Usage

GMap API Key (Depricated)

Since this script is now using PhyloGeoViz for the GMap interactions, we no longer need the api key. I'm keeping this section of comments in case we ever need it again.

To use this, a GMap API key must be supplied in the GBrowse configuration file. As of writing, keys are freely available from Google at http://code.google.com/apis/maps/.

The configuration option name is "gmap_api_key" and is specified like the following:

  gmap_api_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Configuration

To place the mashup in a balloon, simply add a modified version of the following to the track configuration.

  balloon click = http://localhost/cgi-bin/gbrowse_gmap/yeast_chr1?ref=$ref;start=$start;end=$end;name=$name;class=$class;balloon=1

Similarly, to set the mashup as a feature link add a modified version of the following to the track configuration.

  link = http://localhost/cgi-bin/gbrowse_gmap/yeast_chr1?ref=$ref;start=$start;end=$end;name=$name;class=$class;

Note that the only difference between the two URLs was the balloon option. The balloon option needs to be set to 1 if it will be popped up in a balloon.

The "yeast_chr1" portion should be replaced with the coorect data source.

Also, "localhost" should be changed to your url. A relative url may not work because Google ties the api key to a URL.

Current Data Requirements

  • Different Populations will have different track types.

  • Latitude and Longitude

    A track is identified as being a population if it has latitude and longitude values assigned in the configuration file.

  • Haplotypes

    Each haplotype of a population is stored as a feature with the "score" value deterimining its weight. The feature "name" is the haplotype name. For features to be considered as part of the same population group, they must all share the same start and end.

  • Start and end of all used features the same.

    Only features that have the same start and end as the chosen feature will be displayed. If a feature has a different start or end, it will be excluded.

  • SeqFeature::Store is being used.

    I'm pretty sure that this won't work for anything other than SeqFeature::Store. I haven't tested that assumption though. There should be a way to generalize this. The feature searching is where I'm conserned about it.

Example Data

  contig1       Contig  scaffold        1       793     .       .       .       Name=contig1
  contig1       POPA    SNP     50      50      8       .       .       ID=snp.POPA.contig1.50.AA;Name=AA
  contig1       POPA    SNP     50      50      4       .       .       ID=snp.POPA.contig1.50.AG;Name=AG
  contig1       POPB    SNP     50      50      1       .       .       ID=snp.POPB.contig1.50.AA;Name=AA
  contig1       POPB    SNP     50      50      4       .       .       ID=snp.POPB.contig1.50.AG;Name=AG
  contig1       POPB    SNP     50      50      5       .       .       ID=snp.POPB.contig1.50.NN;Name=NN
  contig1       POPC    SNP     50      50      3       .       .       ID=snp.POPC.contig1.50.AA;Name=AA
  contig1       POPC    SNP     50      50      2       .       .       ID=snp.POPC.contig1.50.AG;Name=AG

TODO

This is currently a work in progress.

  • PhyloGeoViz location

    Add a config option for the where the PhyloGeoViz newviewer.php file is located.

  • Demo Data

    Need to create a dummy dataset and config file that can be shared as a demo.

  • Doesn't load correctly in balloon

    Currently the local phylogeoviz doesn't correctly load in the balloon.

  • Other Interesting Features

Interesting Methods

This method prints out the population details for the given feature. This is to be presented in a smallish popup balloon. It presents population information and creates links to GBrowse.

The reason that this is not it's own script is that it is just a small portion of the gbrowse_gmap project. I'm trying to minimize the file footprint of this project.