Lincoln D. Stein > GBrowse-2.54 > cgi-bin/gbrowse_gmap

Download:
GBrowse-2.54.tar.gz

Annotate this POD

CPAN RT

New  6
Open  1
View/Report Bugs
Source   Latest Release: GBrowse-2.55

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.

Installation ^

PhyloGeoViz

PhyloGeoViz is a Google Maps/Population data mashup. It does the heavy lifting of displaying the diversity data on Google Maps. This means that PhyloGeoViz (or something functionally equivalent) is required for the gbrowse_gmap script to work.

Fortunately, PhyloGeoViz is freely available and easy to install.

PhyloGeoViz Web Sites

More detailed and up to date information on PhyloGeoViz is available at its web site, http://phylogeoviz.org/. The code is available at http://code.google.com/p/phylogeoviz/ .

PhyloGeoViz Installation

PhyloGeoViz Configuration

In the top directory of your new PhyloGeoViz installation is a file called config.php. This is a php file where information is set to customize PhyloGeoViz.

Open it with your favorite editor.

Example:

  vim /var/www/html/phylogeoviz/config.php

Test PhyloGeoViz

To check that the installation worked, go to your web site:

http://localhost/phylo/

This will give you a page that says "Input Your Data".

Click the "Autofill some example data" link to get some example data and click "Draw Map!".

If a Google Map appears with several pie charts, then you have successfully installed Phylogeoviz.

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

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

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.

Interesting Methods ^

print_pop_details

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.

syntax highlighting: