Integration

Other topics that may be of interest: Integrating as editor and Communicating with GenomeView

This page tries to explain how to integrate GenomeView in your website with your data. You can either make it available through Java Webstart, or as an Applet. Whenever possible we recommend using Java Web Start as it has better cross-platform and cross-browser support.

General considerations

To present your data in GenomeView optimally, there are a number of things you have to keep in mind.

Indexing

You will want to index your reference sequence to reduce loading times.

You may want to index feature files, but this is not recommended unless they are over 10 Mb when compressed with gzip.

To load an indexed file, you point GenomeView to the main file and GenomeView will try to find the index by itself.

Compression

GenomeView supports GZIP compression transparently on all non-indexed file formats, i.e. compression and indexing are mutually exclusive. However as part of the indexing process, many file formats will be compressed.

Short read data

Depending on what information you want to get out of the visualization, there are basically two ways to load short read data. The first one is the Short Read Track which will give you a detailed view with all individual reads. The second one is the Pile up track which will give a more of a summary view/ coverage plot based on your sequence reads.

Instructions to prepare data for the short read track

Instructions to prepare data for the pile up track

Present your data through a Java Web Start link

First of all you need to know the URL of a GenomeView installation. The default one, that is kept up to date by us is located at http://genomeview.org/start/launch.jnlp. For most integration works I would strongly suggest using this installation.

The next step is constructing your URL to load sequence and features. Below a sample URL, which will load some sequence with annotation and some short reads. It will start with the [100000,200000] region visible.

http://genomeview.org/start/launch.jnlp?--position 100000:200000 --url http://www.broadinstitute.org/software/genomeview/demo/c_elegans/IV.fasta http://www.broadinstitute.org/software/genomeview/demo/c_elegans/IV.gff.gz http://www.broadinstitute.org/software/genomeview/demo/c_elegans/uwgs-rw_L2_FC6218_3.CHROMOSOME_IV.sorted.bam.bai

Start URL, right click to copy entire url

Pasting this URL in your browser will start GenomeView with data from C. elegans loaded.

Command line options to GenomeView can be added after the question mark after the installation URL.

So the formalized version of the integration URL looks like this: http://genomeview.org/start/launch.jnlp?[command line options for GenomeView seperated with spaces]

Important:You should use the JNLP file we provide as it will integrate the parameters into the start-up parameters of the webstart application.

Present your data through a Java Web Start session (recommended)

Instead of putting all files in the URL as explained in the previous section, you can also point GenomeView to a so called session file which contains a list of files which need to be loaded.

An example session file:
http://www.broadinstitute.org/software/genomeview/genomes/mtb_h37rv_v2/session.php

You can use 'View source', or something similar, in your browser to see the actual file structure. It is a plain text file with on each line a file that needs to be loaded.

Make sure it starts with the line ##GenomeView session -- DO NOT...., as in the example. This header is used to detect the file format by GenomeView.

You can add a C line at the top which would contain the link to the configuration file. It is important this line is the first one after the header.

The U lines are links to data files, you can include as many as you want.

The URL to start GenomeView with this sesssion would be:
http://genomeview.org/start/launch.jnlp?--session http://www.broadinstitute.org/software/genomeview/genomes/mtb_h37rv_v2/session.php

Important: You should use the JNLP file we provide as it will integrate the parameters into the start-up parameters of the webstart application.

Typically you don't even have to expose this URL and you can use an index.php that redirects to that location.
header("Location: http://genomeview.org/start/launch.jnlp?--session http://www.broadinstitute.org/software/genomeview/genomes/mtb_h37rv_v2/session.php");

Session file format specification

A session files consists out of 1 header line and 1 or more information lines.

The header line should start with ##GenomeView session. This should be included literally (case-sensitive). The first line is the information GenomeView will use to detect the file format, in this case a session.

The information lines consists of a letter key and the actual data. The different key letters are defined in the table below. The key and the data are separated with a single space or tab.

Key letter*Data
CURL or local file path to the configuration file. This line should be the first in the session file, otherwise some data may not have the correct configuration file when initializing.
U,F**URL or local file path for a data file. This file will be loaded. You do not need to specify the index, GenomeView will look for it in the same folder.
* Must be upper-case
** Both U and F work for both URLs and local file paths, this used to be different, but they are equivalent now.

Example session file:
##GenomeView session -- DO NOT DELETE THIS LINE
C http://www.broadinstitute.org/software/genomeview/genomes/mtb_h37rv_v2/tbconfig.txt
U http://www.broadinstitute.org/software/genomeview/genomes/mtb_h37rv_v2/MT_H37RV_V2.fasta
U http://www.broadinstitute.org/software/genomeview/genomes/mtb_h37rv_v2/annotation.gff
U http://www.broadinstitute.org/software/genomeview/genomes/mtb_h37rv_v2/operon.gff
U http://www.broadinstitute.org/software/genomeview/genomes/mtb_h37rv_v2/sRNA.gff
U http://www.broadinstitute.org/software/genomeview/genomes/mtb_h37rv_v2/rRNA.gff

Present your data through a Java Applet

Embedding GenomeView as an applet

The key code that needs to be included in the body of your web page is:
<script type="text/javascript" src="http://www.java.com/js/deployJava.js"></script>
<script type="text/javascript" src="http://genomeview.org/start/genomeview.js"></script>

<script type="text/javascript">
    	var gv_url		= null;
     	var gv_config	= 'http://genomeview.org/jsdemo/democonfig.txt';    
     	var gv_extra	= null;
       	var gv_location	= null;
        startGV(gv_url,gv_location,gv_config,gv_extra,500,400);
</script>

The gv_url can be used to pre-load a reference sequence. This file will be loaded first and only then will GenomeView proceed with loading additional data.

The configuration file you want to use, can be specified using the gv_config option.

All other data that you want to have loaded can be specified in a space separated list in gv_extra. These data sets will be loaded in parallel.

The location that will initially be visible, can be set by gv_location. The position is in the format <entry>:<start position>:<end position> The entry part is optional can be omitted in which case it becomes <start position>:<end position>

Note: we strongly recommend you use the genomeview.js we provide as that's the one we keep up to date with progressing releases.