GBrowse 2.0 HOWTO

Jump to: navigation, search

GBrowse 2.0 is a complete rewrite of the original GBrowse version. In addition to making the code base more maintainable, GBrowse 2.0 adds the following major features:

  • User Interface: The user interface uses AJAX to provide a smoother user experience. Tracks turn on and off immediately, and updates affect only the tracks that have changed.
  • More rational configuration: Most configuration options have been moved into a single shared configuration file. This allows data source-specific files to be shorter and more concise. This also increases the performance for sites that use hundreds of configuration files to display annotations on multiple species because only the global configuration file and the source-specific configuration file need to be read.
  • Multiple database support: You can now declare multiple databases for each data source and attach them to different tracks. This allows you to add and remove genome annotation data sets far more easily than in earlier versions.
  • Slave renderer support: If you have a multi-CPU processor, or access to several machines, you can distribute the tasks of reading the databases and rendering tracks across multiple processes and machines via a series of "slave" renderers. This greatly increases performance.

This document describes how to install and configure GBrowse 2.0 on your system. Readers familiar with GBrowse 1.70 or earlier should start with the next section, which is a quick summary of what is different. Readers who have not installed or configured GBrowse before should skip to GBrowse Installation.


GBrowse Installation

This section describes the various ways to get GBrowse up and running.

GBrowse Virtual Machines

The easiest way to get started using GBrowse2 is to use one of the pre-packaged virtual machines with all libraries, tools and other dependencies preinstalled. There are two standard GBrowse VMs, one for running on your desktop using VirtualBox, and the other for running on Amazon Web Services.

Please see GBrowse2 VMs for a list of the VMs that are available to use, plus a quick start guide to using these virtual machines.

Ubuntu 11.10 and higher Binary Installs

In Ubuntu versions 11.10 and higher, you can install GBrowse2 and all its dependencies from the Software Center or from the command line. From the Software Center, search for "gbrowse" and click the "install" button. You may also wish to install the "gbrowse_data" package, which includes example data files and tutorials.

From the command line, run the following:

> apt-get install gbrowse gbrowse_data

Debian "sid" Binary Installs

In Debian and Debian-related systems, run the following command:

>aptitude install gbrowse gbrowse_data

You might also wish to browse the GBrowse Debian package pages.

The current version in the Debian package is 2.39, which is a bit old but quite stable. The package will be updated at some point in the not-so-distant future.

Debian "wheezy" Binary Installs

In Debian and Debian-related systems, run the following command:

>aptitude install gbrowse gbrowse-data gbrowse-calign

You might also wish to browse the GBrowse Debian package pages.

Installation on Older Ubuntu and Debian Systems

First install prerequisites following the instructions at GBrowse_2.0_Prerequisites#DEB Systems (apt). Then perform the last steps manually as described in GBrowse_2.0_Install_HOWTO#Installing_via_the_CPAN_Shell.

Installation on RedHat, CentOS and other RPM Systems

First install prerequisites following the instructions at GBrowse_2.0_Prerequisites#RPM Systems (yum). Then perform the last steps using the CPAN shell as described in GBrowse_2.0_Install_HOWTO#Installing_via_the_CPAN_Shell.

Installation on MacOSX Systems

Install the prerequisites following the instructions at GBrowse_2.0_Prerequisites#MacOSX. Then perform the last steps using the CPAN shell as described in GBrowse_2.0_Install_HOWTO#Installing_via_the_CPAN_Shell and GBrowse_2.0_Install_HOWTO#Configure_in_Mac_OS_X_10.6.6.

Installation from Source Code

Installation from source code is described in GBrowse_2.0_Install_HOWTO#Installing_Manually.

Users of GBrowse 1.X

GBrowse 2.0 is largely backward compatible with GBrowse 1.X, but you will need to do some modest work in order to port existing sources to the new system. Please see Migrating from GBrowse 1.X to 2.X for a guide to the process.

For GBrowse 1.X configuration, see: GBrowse Configuration HOWTO.

Configuring GBrowse

GBrowse is controlled by a set of text configuration files. You will log into the web server machine and edit these files using a text editor. Alternatively you can use WebGBrowse, which is a web-based system for initializing, configuring and customizing GBrowse databases. It is an add-on to GBrowse and should only be installed after GBrowse is up and running.

This section discusses manual editing of GBrowse's configuration files.

GBrowse's options are controlled by a master config file, GBrowse.conf which contains site-specific options that apply to all data sources, and one or more Data source-specific configuration files that define the options needed to create a specific genome browser.


When you installed GBrowse, it created an initial GBrowse.conf configuration file in the directory you specified at configure time. The default location of this directory is /etc/gbrowse2. This file contains two types of information:

  1. Global configuration options to apply to all data sources that you want to make available to users.
  2. A list of the data sources, including their names and their source-specific configuration files.

Here is the default GBrowse.conf:

# This is the global configuration for gbrowse
# It contains setting common to all data sources as well
# as the various constants formerly scattered amongst scripts and libraries

config_base            = /etc/gbrowse2   # overridden by environment variable GBROWSE_CONF
htdocs_base            = /var/www/gbrowse2
url_base               = /gbrowse2
db_base                = /var/www/gbrowse2/databases
tmp_base               = /var/tmp/gbrowse2

# These paths are relative to the url base
buttons       = images/buttons
balloons      = images/balloons
gbrowse_help  = .
js            = js

# These paths are relative to the config base
plugin_path    = plugins
language_path  = languages
templates_path = templates
moby_path      = MobyServices

# session settings
session lock type = default
session driver = driver:file;serializer:default
session args   = Directory /var/tmp/gbrowse2/sessions

# to use the berkeley DB driver comment out the previous
# line and uncomment these two
#session driver = driver:db_file;serializer:default
#session args   = FileName /var/tmp/gbrowse2/sessions.db

# Debug settings
debug                  = 0
debug_external         = 0
debug_plugins          = 0

# Performance settings
renderfarm             = 1
slave_timeout          = 45
global_timeout         = 60

# Clean up settings (used by the gbrowse_clean script)
expire session  = 1M  # expire unused sessions after a month
expire cache    = 2h  # expire cached data if unmodified for >2 hours
expire uploads  = 6w  # expire uploaded data if unused for >6 weeks

# Appearance settings
truecolor     =  1    # better appearance at the expense of larger image files
#truetype      = 1    # use truetype fonts for rendering tracks; disabled by default.

# The #include line following this one defines a transparent theme.
# Replace "transparent_colors" with "solid_gray_colors"
# or "warm_colors" for different themes.

#include "themes/transparent_colors"

balloon tips        = 1
titles are balloons = 1
plugins             = FastaDumper RestrictionAnnotator SequenceDumper TrackDumper
overview grid       = 0
region grid         = 0
detail grid         = 1
image widths        = 450 640 800 1024
default width       = 800
pad_left            = 60
pad_right           = 30
too many landmarks  = 100

instructions section   = open
upload_tracks section  = closed
search section         = open
overview section       = open
region section         = open
detail section         = open
tracks section         = open
display_settings section = closed

# where to link to when user clicks in detailed view
link          = AUTO

# HTML to insert inside the <head></head> section
head =

# At the top of the HTML...
header =

# At the footer
footer = <hr />
         <p style="font-size:small">Generic Genome Browser version 1.99. For questions about the data
         at this site, please contact its webmaster. For support of the
         browser software <i>only</i>, send email to
         <a href=""></a>
         or visit the <a href="">GMOD Project</a> web pages.

# Various places where you can insert your own HTML -- see configuration docs
html1 =
html2 =
html3 =
html4 =
html5 =
html6 =

# Limits on genomic regions (can be overridden in datasource config files)
region segment         = 200000
max segment            = 5000000
default segment        = 5000
zoom levels            = 100 200 1000 2000 5000 10000 20000 50000 100000 200000 5000000 1000000
region sizes           = 1000 5000 10000 20000
default region         = 5000
fine zoom              = 10%

# keyword search maxima
max keyword results    = 1000

# One stanza for each configured data source
default source = yeast

description   = Yeast chromosomes 1+2 (basic)
path          = yeast_simple.conf

description   = Yeast chromosomes 1+2 (advanced)
path          = yeast_chr1+2.conf

description  = Renderfarm demo (gbrowse_slave must be running!)
path         = yeast_renderfarm.conf

GBrowse.conf consists of several sections. The [GENERAL] section is the largest, and describes options that apply to GBrowse globally. Below this are one or more source-specific sections with short descriptive names like [yeast]. Each of these short sections describes a genome datasource which you will make available for browsing.

There are two include directives that allow you to break up GBrowse configuration files into smaller logically-related bits. The directive:

 #include "path/to/file"

will import the file at the named path into the configuration file. Relative path names are treated as relative to the location of the configuration file. Wildcards are also allowed. For example #include "/etc/gbrowse2/conf.d/*.conf" will include all files that match the wildcard pattern. This mechanism is currently used to defined a variety of GBrowse "themes" that set page background patterns and colors.

The directive:

#exec "/usr/bin/script_to_execute"

will cause the command "script_to_execute" to be executed each time the configuration file is loaded. The output of this script will be included into the configuration file.

The GBrowse.conf [GENERAL] Section

The [GENERAL] section defines a large number of options, most of which you will never need to change. The format of an option is the option name, an equals sign, and the value of the option. There may be whitespace before and after the equals sign. To continue long option values across multiple lines, begin the second and subsequent lines with one or more spaces or tabs; the additional whitespace will be treated as a single space. Lines beginning with the hash (#) symbol are comments. Please note that for historical reasons, some options separate words by underscores ("remember_settings_time") and others separate words by spaces ("cache time"). The two forms are not interchangeable.

Several options take true/false values. A false value is numeric 0. A true value is numeric 1, or indeed any other non-zero value (including the word true).

Paths and Directories

config_base, htdocs_base, url_base, db_base, tmp_base
The first six options describe the location of GBrowse's configuration and support files. config_base is the location of GBrowse's datasource-specific configuration files, typically /etc/gbrowse2. htdocs_base specifies the location of GBrowse's static HTML files, stylesheets and javascript libraries. url_base is similar to htdocs_base and gives the location of same HTML files, stylesheets and javascript libraries in URL form. So, for example, if GBrowse's static files are located in /var/www/html/GBrowse and this maps in URL space to, then htdocs_base will be /var/www/html/GBrowse and url_base will be /GBrowse. db_base describes the default location of in-memory databases. tmp_base points to the directory used for user sessions, uploads and other temporary files.
The config_base directive is overridden by the environment variable GBROWSE_CONF. This variable is set when Apache starts up, and can be found in /etc/apache2/conf.d/gbrowse2.conf, /etc/httpd/conf.d, or /etc/apache/conf.d, depending on how your system is layed out.
buttons, balloons, gbrowse_help, js
These four configuration options tell GBrowse where to find the images for its navigation buttons, popup balloons, help pages, and javascript libraries. Ordinarily you will not need to change these locations. The default locations are subdirectories of htdocs_base. If you specify a relative path, they will be taken as relative to htdocs_base (in filesystem space) and url_base (in URL space).
plugin_path, language_path, templates_path, moby_path
These configuration options specify where plugins, language translation files, templates and MOBY configuration files are located. If relative paths are given here, they are taken relative to the config_base. The default is to place them in subdirectories of config_base.

Session Settings

session driver, session args

These two options pass settings to the CGI::Session module, which is responsible for GBrowse's persistent user settings. As described in the CGI::Session documentation, session driver selects the driver to be used for storing and retrieving user session information, and session args passes additional arguments to the selected driver. The default is to use the standard "file" driver. To use the faster (but not universally available) DB_File driver, the options might look like this:

 session driver = driver:db_file;serializer:default
 session args   = FileName /var/tmp/gbrowse2/sessions.db
session lock type

Since GBrowse runs several processes in parallel, it needs to flag when another instance of it is working on session data in order to avoid another process from clobbering the same session. This option controls the type of locking to perform. Valid values are:

Use standard file locking. This works fine in most cases, but can cause GBrowse to get very slow if its temporary directory is mounted on a shared NFS filesystem.
Use the File::NFSLock module for locking. This is fast and works across NFS, but requires you to install the File::NFSLock module from CPAN.
Use the locking in the MySQL database. It is handy if you already have a MySQL database up and running. The full format of this value is:
session lock type = mysql:dbi:mysql:my_db;host=hostname;port=portnum;user=user;password=pass
for simplicity, you can leave off the initial "mysql:".
A value of default will choose the File::NFSLock module if it is available, and otherwise fall back onto standard flock.

Performance Settings

This section contains a variety of performance-related settings that you may want to change in order to tune GBrowse for your needs.


This configuration directive turns on and off GBrowse's support for a rendering farm (see Running a GBrowse2 Render Farm). By default this support is enabled, but there no particular performance penalty if you choose not to take advantage of it. If you plan never to use the feature, set it to a false (zero) value:

 renderfarm = 0
When running a GBrowse2 render farm, this option controls how long the master server will wait for one of its slaves before it times out and considers the slave "down". The units are seconds, 45 seconds by default.
If a database query, search or plugin takes longer than the number of seconds given by this option, GBrowse will time out and return an error to the user. The default is 60 seconds.
allow remote callbacks
If this option is set to a true (non-zero) value, then uploaded and remote track files will be able to contain configuration stanzas with Perl callbacks. The callbacks will be executed if and only if the Perl Safe::World module is installed on your server. This module provides a restricted execution environment that mitigates (but does not eliminate) the risk from untrusted code accessing local files and other sensitive content. Note that Safe::World does not currently work with Perl 5.10 and higher.

GBrowse launches a subprocess for each track it renders. This option will limit the number of simultaneous subprocesses that can be launched in order to avoid overloading the system. The default is four; you may wish to adjust this upward on a system with 4 or more CPUs. A good choice is between one and two times the number of CPUs/cores on the server system:

max_render_processes = 8

Appearance Settings

The following options control the appearance and behavior of GBrowse. Unlike the earlier options, any of them can be overridden on a per-datasource basis in datasource-specific configuration files simply by inserting the option into the [GENERAL] section of the datasource-specific config file.

This is a true/false option. If true, then any databases that have the "autocomplete" option set will be searched when the user types three or more letters into the GBrowse search field. Proposed matches will be displayed in a popup menu. Please see Database Search Options for more information.
The autocomplete setting also applies to the "Custom Tracks" and "Community Tracks" sections, and allows users to search the user account database for public tracks via autocomplete. See GBrowse_Configuration/Authentication for more information on the user account database.
balloon tips
This is a true/false option. If true, popup balloons are activated such that when the user mouses over a feature, additional information about that feature appears in a balloon.
titles are balloons
This is a true/false option. If true, popup balloons are automatically populated by default information about the feature unless a track has a balloon hover option that overrides the content. If false, then you will need to set the balloon hover option for the track in order for balloons to appear at all.

This option sets the path to the GBrowse cascading stylesheet (CSS) file. This sets such options as the page background color, font size, background image, and so forth. Edit this option here to change the appearance of all data sources, or add a stylesheet option to the [GENERAL] section of datasource-specific configuration files to change the appearance on a case-by-case basis.

You can also specify multiple stylesheets by separating them by spaces or newlines. To associate specific stylesheets with different media types, place the media type(s) in parentheses and append them to the stylesheet, as in the following example:

 stylesheet = css/gbrowse.css(screen)
If set to a true value, then the tracks will be rendered as full-color 24-bit images, improving appearance at the cost of larger images. The effect may be noticeable on a slow internet connection.
If set to a true value, then the fonts in track images will be rendered using truetype fonts installed on the server. A value of "1" selects a safe default font. A string value can be used to select a particular font, such as "Droid Sans" or "Helvetica-9". This option only works on versions of GBrowse from 2.55 onward, and only if Bio::Graphics 2.33 or higher is installed.
This option selects which, if any, of the GBrowse plugins to offer to the user. It is a space-delimited list of plugin names. Plugins are Perl .pm modules that can be found in the plugins subdirectory of the GBrowse2 configuration directory. Select the ones you wish to activate, and put their in this configuration directive, minus the ".pm" extension. See GBrowse2 Plugins for a description of what each plugin does.
overview grid, region grid, detail grid
These three options control whether the background grid should be displayed in the overview, region, and detail panels by default. They are either true (1) or false (0) values. The user can later turn the detail panel grid on and off, but currently there is no user interface for deselecting the overview and region grids.
image widths, default width

These two options control the width of the panels displayed to the user. image widths is a space-delimited list of numeric widths to be made available to the user to select from. default width is a single numeric value indicating the default width when the user first loads the browser. In this example, the browser assumes a default width of 1024 pixels, but offers the user a menu of five widths ranging from 450 to 1280 pixels.

image widths    = 450 640 800 1024 1280
default width   = 1024
pad_left, pad_right
These options control how much additional whitespace (in pixels) to surround the detail panel with on the left and the right. This is sometimes necessary for glyphs that need extra space to the left or right for additional information. An example of this is the UCSC multiple alignment glyph.
too many landmarks
This option controls the maximum number of results to return when the user performs a wildcard search on the database. The default is 100.
hilite fill
This option controls the interior color of the selection rectangle that appears when the user clicks and drags on a scalebar, as well as the highlighted region of the currently selected region. It accepts a Bio::Graphics color value, such as "beige:0.8" for a beige background at 80% opacity.
hilite outline
This option controls the outline color of the selection rectangle that appears when the user clicks and drags on a scalebar, as well as the highlighted region of the currently selected region. It accepts a Bio::Graphics color value, such as "red:0.8".
hilite height
This option controls the height of the draggable region marker, which highlights the currently selected region
overview bgcolor, region bgcolor, detail bgcolor
These three options control the background colors of the overview, region and detail panels respectively. They each accept Bio::Graphics color value.
grid color, grid major color
These options control the appearance of the grid lines in the overview, region and detail panels. The first controls the color of the minor grid lines, and the second controls the color of the major grid lines. They each accept a Bio::Graphics color value.
show sources
Ordinarily GBrowse generates a popup menu showing all configured data sources; the user can change the datasource by selecting from this menu. To inhibit generation of this menu, set show sources to zero.
instructions section, upload_tracks section, search section, overview section, region section, detail section, tracks section, display_settings section
These options control whether a section is toggled open initially ("open"), or toggled closed ("closed"). In addition, for the "overview section", "region section" and "detail section", you can specify a value of "hide" in which case the section isn't shown at all. Generally this only makes sense for the region section.
category default state
As described in the track configuration section, a track can be placed in a category or subcategory. The categories can be toggled open and closed. The "category state" option, described next, allows you to configure the toggle state of each category and subcategory when the user first accesses the page. If a category is not explicitly named, then this option is consulted to find the default. Values are either "open" to make each category open by default, or "closed". For convenience, you may use the integer value 0 for "closed" or 1 for "open".
category state

This option controls whether a category or subcategory is open or closed when the user first visits the page, or resets his state with the "Reset" menu choice. The format is as shown in this example:

category state = Genes           open
                 Genes:Coding    open
                 Genes:Noncoding closed

Categories are identified by their names; subcategories and sub-subcategories are indicated by dividing the subcategories by ":" characters. You may use "open" to indicate that a category is open at first, or "closed" to collapse it on the first page load. "1" and "0" can be used instead of "open" and "closed".

Fast Track Panning (new in version 2.20)

This configures fast track panning, the ability for a user to drag/pan the details tracks back and forth to instantly see more of the image. Extra wide images are preloaded from the server to accomplish this, so it may affect the initial image load time.

details multiplier
How much extra image data to load. A value of 3.0 means that three times the viewable image width will be loaded. The default is 1.0, which means that fast track panning is turned off and GBrowse behaves as usual.

Cleanup Settings

These settings are used by the script to remove stale temporary files of various sorts.

expire cache
How long generated tracks will be cached before they are regenerated. This speeds up page load speed for frequently-accessed pages. The format is a number followed by a time unit, where units are s for second, m for minute, h for hour, d for day, w for week, and M for month. The default is "2h", or two hours.
expire sessions
This option controls how long the user's track configuration, which includes which tracks are turned on and their customized settings, will be remembered in his or her session. The format is the same as expire cache and is set to one month by default.
expire uploads
This option controls controls how long to keep user uploaded data for custom tracks on disk. It makes sense to keep it on disk for as long or longer than the session. Even if the user’s session expires, he can still get at the uploaded data if he bookmarked his session or shared the uploaded track at any point. The format is the same as expire cache and defaults to six weeks.

Upload Database Settings

These options configure the backend database that is used to store the information that a user uploads when he or she creates custom tracks. The default is to choose a workable database system based on the Perl DBI drivers installed on the system. See Configuring the Uploaded Track Database for detailed configuration information.

Which database backend to use for custom tracks. Valid options are "DBI::SQLite", "DBI::mysql", "berkeleydb" and "memory". The SQLite database backend combines great performance with little or no maintenance, but does require the perl DBI::SQLite module to be installed. The memory backend requires no additional Perl modules, but is only appropriate for very small uploads (less than 10,000 features). The DBI::mysql backend has the best performance, but needs additional configuration in order to make it possible for GBrowse to create and drop databases dynamically.
When using the DBI::mysql backend, this specifies the host on which the mysql DBMS is running. (Default "localhost").
When using the DBI::mysql backend, this specifies the user that has access to the mysql server. This user must have database create/drop privileges for databases beginning with the string "userdata_". (Default "gbrowse").
When using the DBI::mysql backend, this specifies the password for the user named by upload_db_user. (Default no password).
The name of the administrator account that has privileges to upload and configure public tracks. See The Admin Interface for more details.
The path used to store data files uploaded by the administrator named in admin_account. See The Admin Interface for more details.

Debug Settings

The next set of options toggles on or off various debug flags, enabling you to watch what GBrowse2 is doing and help the developers catch and fix bugs. Their values are either 0 (no debugging messages) or 1 (activate debugging messages). When debugging is active, the messages will appear in the Apache error log, typically /var/log/apache2/error_log.

This turns on messages about general GBrowse operations.
This turns on messages concerning the uploading and processing of user-supplied tracks, as well as tracks fetched from remote sources via the DAS protocol.
This turns on debugging messages concerning the operation of GBrowse's user-contributed plugins.

Configuring Genomic Regions

Several options allow you to configure the behaviour of genomic regions, such as the levels of zoom you wish to offer and the largest segment of genome that it is safe to display in the detail panel.

option default value description
region segment 50000 (?) NOT DESCRIBED HERE PREVIOUSLY! DOES IT APPLY TO 2.0?? DESCRIBED ELSEWHERE (If this configuration option is set, a new "region panel" will appear that is intermediate in size between the overview and the detail panel. The value of this option becomes the size of the region panel in base pairs.)
max segment 5000000 (?) The maximum size (in base pairs) that the detail panel can display. If the user tries to display a region that is too large, he will be given a message to select a smaller region. GBrowse performance degrades as the number of features per track increases, so you can use this setting to avoid making the user wait unreasonable lengths of time for the region to display.
zoom levels 100 500 1000 5000 50000 100000 (?) A space-delimited list of region sizes (in base pair) that the user can zoom through. Each zoom level will be listed in a popup menu in the navigation bar.
fine zoom 10% This option controls the increment that the user will zoom in or out when pressing the "+" and "-" buttons in the navigation bar.
default segment 5000 (?) If the user has selected a region that is too large to display, then single-clicks on one of the scale bars, he will be centered on a region this many base pairs in length.
region sizes 1000 5000 10000 20000 (?) This option is similar to zoom levels except that the list of zoom levels applies to the region panel.
default region 5000 (?) This option specifies the default length of the region panel, in bp.
max keyword results (?) If the user does a wildcard or keyword search, this option limits the maximum number of results that can be displayed.

HTML Customization Settings

Several settings in the [GENERAL] section allow you to insert fragments of HTML (including images) into the GBrowse screen. This lets you create banners and other cutomizations for visual integration with other pages on your site.

header, footer

These two options place HTML at the top or bottom of the page. Example:

 header = <img src="/banner.jpg">
 footer = <hr>For help please see the <a href="help.html">help pages.</a>
html1, html2, html3, html4, html5, html6

These options insert snippets of HTML in various strategic places on the page:

Option Where it goes
html1 between the title and the instructions bar
html2 between the instructions and the navigation bar
html3 between the navigation bar and the overview
html4 between the detail view and the tracks table
html5 between the tracks table and the add custom tracks section
html6 between the add custom tracks section and the display settings

These can be used with callbacks to bring in local or external html files, e.g.

header = sub{
       open FILEHANDLE, 'somefile.txt' or die $!;
       my $html_header = do { local $/; <FILEHANDLE> };
       return $html_header;


header = sub{
       use LWP::Simple;
       my $html_header = get("");
       return $html_header;

Configured Data Source Sections

After the [GENERAL] section comes a list of all the data sources that you can make visible to the user. The format of each data source is as follows:

description = human readable description of this data source
path        = path_to_the_source_config_file.conf

Each data source declaration begins with the name of the data source, enclosed in square brackets. Any name is allowed, provided that it does not contain newlines. The name "GENERAL" is also disallowed, to avoid conflicts with the [GENERAL] section.

Each data source has description and path options. The first provides a human-readable description of the source; this description will appear in the menu offered to the user in the navigation bar. The path option indicates the location of the configuration file for this data source. Relative paths are interpreted relative to GBrowse.conf. In the usual case, you will store all your data source config files in the same directory as GBrowse.conf.

To specify a default data source to show when the user first visits GBrowse, place a default source option before the first data sources stanza. For example, to specify the zebrafish v2 data source as the default, create a data source config section like the following:

default source = zebrafish v2

[zebrafish v3]
description    = Zebrafish genome, build 2
path           = zebra3.conf

[zebrafish v2]
description    = Zebrafish genome, build 1 (deprecated)
path           = zebra2.conf

If no default source option is defined, GBrowse will pick the first data source stanza as default.

GBrowse will place the descriptions of all configured datasources into its Sources popup menu. To hide a source from the menu, simply place hide=1 into its stanza:

[zebrafish v2]
description    = Zebrafish genome, build 1 (deprecated)
path           = zebra2.conf
hide           = 1


GBrowse has a simple theming system that allows you to change colors and background patterns. This is done by #include-ing a themes file from the directory /etc/gbrowse2/themes. Each themes file contains the "stylesheet" option, and one or more options for setting the colors of the overview, region and details sections. Three different themes are currently available:

A pleasantly professional "button-down" look.
A funky theme which makes extensive use of transparency.
An earth-themed color set.

You can switch between themes by finding this GBrowse.conf line:

#include "themes/transparent_colors"

and changing it to one of the other theme files. Each theme file is associated with a stylesheet located in /var/www/gbrowse2/css. You are encouraged to customize these stylesheets or add new ones.

Data Source Configuration Files

Each data source has a configuration file listed in the main GBrowse.conf configuration file. This configuration file specifies the databases to connect to, defines the tracks to show, and allows you to customize some of the appearance options specified in GBrowse.conf. Each data source configuration file has three sections: the [GENERAL] section, the Database Definitions section, and the Track Sections. In addition there are some special sections that allow you to configure Advanced Options.

The following shows a basic data source configuration file:

description   = Yeast chromosomes 1+2 (basic)
database      = scaffolds

initial landmark = chrI:143000..180000

default tracks = Genes

# examples to show in the introduction
examples = chrI
	   "membrane trafficking"

# database definitions

db_adaptor    = Bio::DB::SeqFeature::Store
db_args       = -adaptor memory
                -dir    $DATABASES/yeast_scaffolds

db_adaptor    = Bio::DB::SeqFeature::Store
db_args       = -adaptor memory
                -dir    $DATABASES/yeast_chr1+2

# Default glyph settings
glyph       = generic
database    = annotations
height      = 8
bgcolor     = cyan
fgcolor     = black
label density = 25
bump density  = 100

# the remainder of the sections configure individual tracks

feature       = centromere
bgcolor       = blue
glyph         = dot
fgcolor       = black
height        = 8
point         = 1
key           = Centromeres

feature       = tRNA
glyph         = generic
bgcolor       = lightgray
fgcolor       = black
height        = 4
stranded      = 1
description   = 1
key           = tRNAs

glyph        = dna
global feature = 1
database     = scaffolds
height       = 40
gc_window    = auto
do_gc        = 1
strand       = both
fgcolor      = red
axis_color   = blue
key          = GC Content

feature      = gene
glyph        = so_transcript
bgcolor      = yellow
height       = 6
description  = 0
key          = Named gene

feature      = CDS
glyph        = cds
description  = 0
height       = 26
sixframe     = 1
label        = sub {shift->name . " reading frame"}
key          = CDS
citation     = This track shows CDS reading frames.

feature       = tRNA
glyph         = generic
bgcolor       = lightgray
fgcolor       = black
height        = 4
stranded      = 1
description   = 1
key           = tRNAs

The GENERAL Section

In the [GENERAL] section, you can override all the display options specified in GBrowse.conf, including the stylesheet, panel colors, genomic region length, zoom levels, and so forth. In addition, this section recognizes the following source-specific options:

This option sets the default database to use when searching and displaying features. See Database Definitions below.
default tracks,default features

The default tracks options control which tracks are turned on by default when the user visits the browser for the first time. Its value is a whitespace-delimited list of track names, for example:

default tracks = Genes ORFs tRNAs CDS Centro:overview

An earlier (deprecated) name for this option was default features and this name is recognized for backward compatibility.


This option designates a list of searches that the user can click on to see sample regions. For example:

examples = chrI

chrII chrI:80,000..120,000 "membrane trafficking" NUT21 YAL063C

initial landmark

If an initial landmark option is present, then its value will be used to populate the navigation box when the user initially visits GBrowse. For example, to start with a view of chromosome 1 from base pairs 50,000 to 150,000:

initial landmark = chr1:50000..150000

You can use this option to create machine- and human-readable information about your database. It is used to populate the information that appears when the user selects the "About this database" menu item. The full format is as follows:

 metadata =
       -description             Example GBrowse database containing information from WormBase and modENCODE.
       -maintainer              Lincoln Stein <>
       -created                 2010-1-4
       -modified                2009-9-1
       -authority               WS
       -coordinates_version     170
       -source                  Chromosome
       -testrange               I:7385068..7387651
       -species                 Caenorhabditis elegans
       -taxid                   6239

All the fields are optional. -description provides a human-readable description of the database. -maintainer provides a name and contact address for users. -created and -modified give the date (in year-month-day format) when the database was created and modified. -species and -taxid provide the systematic species name and NCBI taxon ID for the species.

-authority, -coordinates, and -coordinates_version together provide information on the genome build used for this database. -authority is a prefix to be added to the coordinates_version that indicates the organization that performed the build. You can make one up, but it is better to consult a growing registry of these prefixes at; you can easily add a new one using the registry service. Registered coordinate systems receive a URL from the registry, which you can use for the -coordinates option.

-source indicates the type of the coordinate system you are using, usually either "Chromosome" or "Contig."

-testrange provides an example coordinate range that users can try out.

Should you wish to continue a long description across multiple lines, simply leave whitespace in front of the second and subsequent lines.

automatic classes
This option can be used in conjunction with the Bio::DB::GFF database adaptor in order to designate one or more namespaces to use when searching for features by name. This option is not needed unless you are using a legacy database.

It sometimes happens that different web databases disagree about how chromosomes are named. For example, in C. elegans, WormBase data dumps use chromosomes named "I", "II", etc, while the UCSC Genome Browser uses "chrI", "chrII", etc. This makes interoperation difficult via Galaxy and other workflow managers. If seqid_prefix is defined, then the prefix will be added to the chromosome names for all data dumps from the browser and stripped from all data uploads. For example, WormBase can specify:

 seqid_prefix = chr

to add "chr" to all its chromosome names on the way to Galaxy/UCSC and to strip "chr" from all chromosome names received from Galaxy/UCSC.

Database Definitions

Following the [GENERAL] section, each data source config file must have one or more database definition stanzas. This type of stanza begins with the heading [dbname:database], where dbname is any symbolic name you choose. The body of the stanza has db_adaptor and db_args options, where db_adaptor is the name of a Perl database adaptor module for accessing the sequence annotation database and db_args are a series of arguments to pass to the module's new() method in order to open and initialize the database. The symbolic names are used in track configuration stanzas to attach databases to particular tracks.

There are a variety of database backends that work with GBrowse 2; the major ones are Bio::DB::SeqFeature::Store, a database designed for rapid access to GFF3-format annotation data, Bio::DB::Das::Chado, an interface to the powerful Chado database, Bio::Das, an interface to the Distributed Annotation System, Bio::DB::Das::BioSQL, an interface to the BioSQL system, and lastly Bio::DB::GFF, a quick and dirty interface to GFF2-formatted annotation data. See GBrowse Backends for more information about these adaptors.

A typical Bio::DB::SeqFeature::Store database configured to run directly from flat files is configured like this:

db_adaptor    = Bio::DB::SeqFeature::Store
db_args       = -adaptor memory
                -dir    /home/fred/gbrowse/databases/yeast_scaffolds

The symbolic name for this database is scaffolds. It uses the Bio::DB::SeqFeature::Store module as its backend, and when initialized is created by calling:

Bio::DB::SeqFeature::Store->new(-adaptor=> 'memory',
                                -dir    => '/home/fred/gbrowse/databases/yeast_scaffolds').

Referring to the Bio::DB::SeqFeature::Store documentation (by using perldoc Bio::DB::SeqFeature::Store) we find that this is the invocation to create an in-memory database from the annotation file(s) located in /home/fred/gbrowse/databases/yeast_scaffolds.

A database option that is named in the [GENERAL] section is the default database, used for any tracks that do not explicitly specify a database option of their own. For example:

database = scaffolds

If the browser uses a single database only, you can implify the configuration file slightly by incorporating the appropriate db_adaptor and db_args options directly in the [GENERAL] section in lieue of a database option and corresponding [...:database] stanza. This creates an anonymous backend that does not need to be specifically named in a database stanza. For example:

db_adaptor    = Bio::DB::SeqFeature::Store
db_args       = -adaptor memory
                -dir    /home/fred/gbrowse/databases/yeast_scaffolds

Note: Plugins are temporarily limited to run on the default database indicated by the database option in the [GENERAL] section. This means that the default database must contain the DNA sequence in order for DNA analysis plugins, such as the restriction site annotator, to work properly.

Database Search Options

Ordinarily when the user types a search term into the landmarks text field, GBrowse will search through all configured databases for matches. You can control this behavior to restrict the behavior of the search or to disable searching entirely. This behavior is controlled through the search options option:

db_adaptor    = Bio::DB::SeqFeature::Store
db_args       = -adaptor memory
                -dir    /home/fred/gbrowse/databases/yeast_scaffolds
search options = exact, -fulltext, +autocomplete
db_adaptor    = Bio::DB::SeqFeature::Store
db_args       = -adaptor DBI::mysql
                -dsn yeast_expression_data
search options = none

The value of this option is a comma-delimited list of choices. Choices are processed from left to right. The option "none" turns off all search options, "all" turns them all on, and a list of search types activates exactly those types. A +optionname will turn that option on, and a -optionname will turn it off.

Turn all searches on, except for the full text search:

search options = all -fulltext

Add autocomplete to the default searches:

search options = default +autocomplete

Only do exact searching:

search options = exact

The search types are:

Enable all search types.
Disable all searching on this database. Equivalent to a keyword list of ""
Equivalent to "exact, wildcard, stem, fulltext, heuristic".
Allow exact matches on feature names and aliases. Wildcard characters will be ignored.
Allow wildcards to be used in search terms. Only feature names and aliases will be searched.
If an exact match does not work, and the user did not already include a wildcard, then add a wildcard to the end of the search term and try again.
If more restricted searches are not successful, search through the notes, attributes and descriptions of the features for potential matches. This search may be time consuming!
If this option is set, and none of the previous searches were successful, GBrowse will attempt to add or remove the prefixes "Chr", "chr" and "CHROMOSOME_" from the search term in an attempt to help a user who is using "X" to search for "ChrX" or vice-versa.
Allow the features in this database to be used for landmark autocompletion, provided that autocomplete is set to a true value in the general configuration section.

Track Definitions

To add tracks to a data source, you will create a series of one or more track definition stanzas. Alternatively, if you have the user account login system running, you can use the admin interface to upload, configure and manage tracks remotely. This section describes the direct method of configuring tracks by directly editing the data source configuration file.

Following the database stanzas in the data source configuration file come a series of one or more track definition stanzas. Track definition stanzas are used to configure annotation tracks that appear in the browser details panel (the main panel) as well as those that appear in the overview and region panels. Track definition stanzas are also used to configure semantic zooming (in which the appearance of the track changes at different magnification levels) and tracks generated by plugins.

A typical track definition looks like this:

database     = annotations
feature      = gene
glyph        = generic
bgcolor      = yellow
height       = 6
link         =$name
key          = Named genes

This track is named "Genes"; this name will be used if the user bookmarks or shares the track. Its features reside in a backend database named "annotations" (which would have been previously defined in a track definition stanza named "[annotations:database]"). The features retrieved from the database are of type "gene". The "generic" glyph is used to display the feature, and it is drawn with a background color of yellow and a height of 6 pixels. The human-readable key printed at the top of the track is "Named genes". Finally, when the user clicks on a feature in this track, his web browser will link to a Google search link created using the gene's name.

Track names can contain almost any character, including whitespace, but cannot contain the "-" or "+" signs because these are used to separate track names in the URL when bookmarking. ([My Genes] is OK, but [My-Genes] is not). As in the general configuration section, the track declaration contains multiple name=value option pairs. You can create a special track configuration section named [TRACK DEFAULTS] to define default fallback options used for all tracks. For example, if you want all tracks to show features of height 10 using the generic glyph, then you can create a [TRACK DEFAULTS] section like follows:

glyph  = generic
height = 10

Individual tracks can override these defaults simply by changing the "glyph" and "height" options.

Database and Rendering Backend Options

Several track options affect the connection between the gbrowser and the underlying database backend(s):

This option relates the track to a database that was previously defined with a database definition stanza. If this option is not present, then the default database indicated in the [GENERAL] section will be used.

This relates the track to one or more feature types as they appear in the database. Recall that each feature has a type and a source. This is represented in the form primary_tag:source_tag, where primary_tag describes the feature's type (e.g. "mRNA") and source_tag describes where the provenance of the feature. (In GFF files, these are called "type" and "source" respectively). For example, a feature of type "gene:sgd" has the primary_tag "gene" and the source_tag "sgd". It is possible to omit the source. A feature of type "gene" will include all features whose primary_tags are "gene", regardless of the source_tag field. It is not possible to omit the method.

It is possible to have several feature types displayed on a single track. Simply provide the feature option with a space-delimited list of the features you want to include. For example:

feature = gene:sgd stRNA:sgd

This will include features of type "gene:sgd" and "stRNA:sgd" in the same track and display them in a similar fashion.

global feature
If this option is present and set to a true value (e.g. "1"), GBrowse will automatically generate a pseudo-feature that starts at the beginning of the currently displayed region and extends to the end. This is often used in conjunction with the "translation" and "dna" glyphs in order to display global characteristics of the sequence. If this option is set, then you do not need to specify a "feature" option.
remote feature
This relates the track to a remote feature track somewhere on the Internet. The value is a http: or ftp: URL, and may correspond to a static file of features in GFF format, gbrowse upload format, a CGI script, or a DAS source. When this option is active, the "feature" option and most of the glyph control options described below are ignored, but the "citation" and "key" options are honored.


remote feature =
remote renderer
This option, if present, indicates that this track is to be rendered by one or more remote rendering daemons. See Running a GBrowse2 Render Farm for information on using this option.
This option is new in version 2.44. In previous versions, the imagemap data, which tells the browser what to do when the user hovers over a feature or clicks on it, was generated at the time the track is generated. However, this slows down track generation when there are many features, such as when showing next generation sequencing data. In version 2.44, the imagemaps are only generated as needed when the use clicks or hovers over a feature. The downside of this is that popup balloons are slightly delayed when GBrowse is running as a vanilla CGI application (there is no noticeable delay under FastCGI). Set inline_imagemaps to a true value to restore the original behavior. This can be done on a per-track basis or globally in [TRACK DEFAULTS].
das category, das landmark, das flatten, das subparts, das superparts, das glyph, das type
All these options pertain to exporting the GBrowse database as a DAS data source. Please see the GBrowse DAS HOWTO for more information.

Glyph and Appearance Options

These options control the rendering of features onto the track, including their size, shape and color.This section descrbes the most commonly used options. Please see Glyphs and Glyph Options for a full description of GBrowse's many and diverse rendering options.

This controls the background color of the glyph. The format of colors is explained in Glyphs and Glyph Options.
This controls the foreground color (outline color) of the glyph. The format of colors is explained in Glyphs and Glyph Options.
This is a true or false value, where true is 1 and false is 0. If the option is set to true, then the description of the feature (any Note fields) is printed below the feature, space allowing.
This controls the color of the primary font of text drawn in the glyph. This is the font used for the features labels drawn at the top of the glyph.
This controls the color of the secondary font of text drawn in the glyph. This is the font used for the longish feature descriptions drawn at the bottom of the glyphs.
This controls the glyph (graphical icon) that is used to represent the feature. There are many glyphs ranging from simple to complex. The complete list of glyphs and glyph-specific options are listed Glyphs and Glyph Options. The "generic" glyph is the default.
This option sets the height of the glyph. It is expressed in pixels.
This is a true or false value, where true is 1 and false is 0. If the option is set to true, then the name of the feature (i.e. its group name) is printed above the feature, space allowing.
This is a true or false value, where true is 1 and false is 0. If this option is set to true, then the glyph will indicate the strandedness of the feature, usually by drawing an arrow of some sort. Some glyphs are inherently stranded, or inherently non-stranded and simply ignore this option.
This option will limit the number of features displayed in the track to a maximum. It can be useful in situations such as mRNA alignments where regions around highly-expressed genes contain orders of magnitude more features than typical regions. You may also place this option into [TRACK DEFAULTS] as a safety mechanism:
feature_limit = 500
This option controls the default visibility of the track and is one of show, hide or collapsed. If present, it overrides the general "default tracks" setting.
label density
This is a numeric option. When there are more features visible in the track than the indicated number, their labels will be turned off to save space. This can be overridden by the user.
bump density
This is a numeric option. When there are more features than the number indicated, vertical collision control will be turned off; all features will be confined to a single horizontal line at the top of the track. This can be overridden by the user.
show summary
This is a numeric option. When the region being displayed is larger than the indicated length (in base pairs), then the track will go into summary mode and show a density gram of the number of features in the track. This will greatly speed up the display of dense tracks over large regions and increases legibility. A value of zero disables summary mode. See Summary Mode for more information.
This option controls the packing of features. Possible values are:
0        no collision control
1        ordinary collision control; optimal tight packing applied to minimize wasted space
2        simple packing - each feature occupies separate vertical band
fast     faster packing which works best when all features are exactly same height
overlap  strand-specific collision control, and features are render translucent to allow the overlap to be seen
"overlap" bumping (version 2.46 and higher) is designed chiefly for quantitative (xyplot) tracks to show the overlap of quantitative peaks. It is usually combined with the "opacity" and "color_series" options.
The way strand-specific collision control works is that if two features are on the same strand, then they overlap with each other. If they are on different strands, then collision-control goes into effect. This gives you two horizontal bands, one for forward strand features, and one for negative strand features, and is a quick-and-dirty way to create composite features, such as coding genes and their regulatory elements.
opacity (version 2.46 and higher)
This controls the opacity applied to features that collide using "bump=overlap". It is a floating point value between 0.0 and 1.0, where 0.0 is completely transparent, and 1.0 is entirely opaque. The default is 0.3.
color_series (version 2.46 and higher)
This option, if set to a true value, will cause GBrowse to assign background colors to features following a simple color series of (red blue green yellow orange brown aqua black fuchsia green lime maroon navy olive purple silver teal magenta). The color series is changeable using the color_cycle option. The option is usually used in conjunction quantitative tracks and "bump=overlap", so that superimposed xyplots are distinguishable on the basis of their color.
color_cycle (version 2.46 or higher)
This option, when used in conjunction with color_series sets the series of colors that features within the track will cycle among. It is a space-delimited set of Bio::Graphics-style colors.

In addition, there are many glyph-specific options. Please see Glyphs and Glyph Options for details.

Track Table Options

These options control the human-readable track label, as well as the way that tracks are grouped in the GBrowse tracks table.

If present, this option creates a human-readable descriptive paragraph describing the feature and how it was derived. This is the text information that is displayed when the user clicks on the track name in the checkbox group. The value can either be a URL, in which case clicking on the track name invokes the corresponding URL, or a text paragraph, in which case clicking on the track name generates a page containing the text description. Long paragraphs can be continued across multiple lines, provided that continuation lines begin with whitespace.
This option controls the descriptive key that is drawn in the key area at the bottom of the image. It also appears in the checkboxes that the end user uses to switch tracks on and off. If not specified, it defaults to the track name.
This option allows you to restrict who is allowed to view the current track by host name, IP address or username/password. See GBrowse Authentication and Authorization for details.

This option allows you to group tracks into different groups on the GBrowse display in addition to the default group called 'General'. For example, if you wanted several tracks to be in a separate group called "Genes", you would add this to each of the track definitions:

 category = Genes

You can also create nested categories by separating category names by colons:

  category = Genes:Coding

  category = Genes:Non-coding

This will create a section in the tracks panel called "Genes", which will have two subsections called "Coding" and "Non-coding". The track named "label1" will be placed in the first section, while the track named "label2" will be placed in the second.

If all tracks are categorized, then the "General" category will not be displayed. If you have used a "category tables" option in the [GENERAL] section of the configuration file, then the names of the tracks labeled with this category will be placed into a table of the appropriate dimensions. Tracks will be placed into the table in column-major format: you should first list stanzas for all rows of column 1, then all rows of column 2, etc.

See the GBrowse2 Admin Tutorial for more details.

subtrack select, subtrack table, subtrack labels (new in 2.10)
Subtrack selector

These three options together allow you to create a series of named subtracks within a track. The user will be able to individually hide and show the subtracks, as well as to control their order using the user interface shown in the figure to the right. It is currently most useful for organizing a set of single features that span the entire chromosome, such as wiggle tracks.

See Creating Subtracks for a full description of subtrack creation and manipulation.

select (deprecated)

This is an older version of the subtrack creation mechanism, which is still supported for backward compatibility. See Creating Subtracks for the preferred way of doing this.

The form of the "select" option is as follows:

select = method value1 value2 value3'...

method is one of name, display_name, type, source or score. This is followed by a list of selections that will be presented to the user to select among when he clicks on the "menu" icon in the track's title bar. For example, if you have a track in which the features have one of the sources "day 1" , "day 2", and "day 3", you can allow the user to select which of the features are visible with this option:

select = source 'day 1' 'day 2' 'day 3'

The matches are case insensitive regular expressions, so "day 1" will match "Day 1" and "DAY 1a".

Linking Options

These options control what happens when the user clicks on a feature or mouses over it. It is usually convenient to place link options in the [TRACK DEFAULTS] section to generate default linking behavior, and then to override these options as needed on a case-by-case basis inside specific track stanzas.

balloon click, balloon hover
These options control popup balloons that appear when the user clicks or hovers above a feature. See GBrowse Balloon Tips for information on how to generate static and dynamic content in these balloons.
Ordinarily, GBrowse will generate a single link for the entire feature, even if it contains multiple subparts. However, if this option is greater than zero, then gbrowse will generate imagemap rectangles for each of the subparts of a feature (e.g. the exons within a transcript), allowing you to link each subpart separately. The numeric value will control the number of levels of subfeatures that the boxes will descend into. For example, if using the "gene" glyph, set -box_subparts to 2 to create boxes for the whole gene (level 0), the mRNAs (level 1) and the exons (level 2).

The link option creates outgoing links from the GBrowse display. When the user clicks on a feature of interest, he will be taken to the corresponding URL.

The link option's value should be a URL containing one or more variables. Variables begin with a dollar sign ($), and are replaced at run time with the information relating to the selected annotation. Recognized variables include:

Variable Name Value
$name The feature's name (group name)
$id The feature's id (eg, PK from a database)
$class The feature's class (group class)
$method The feature's method
$source The feature's source
$ref The name of the sequence segment (chromosome, contig) on which this feature is located
$description The feature's description (notes)
$start The start position of this feature, relative to $ref
$end The end position of this feature, relative to $ref
$segstart The left end of $ref displayed in the detailed view
$segend The right end of $ref displayed in the detailed view

For example, the wormbase.conf file uses this link rule:

    link =$name;class=$class

At run time, if the user clicks on an EST named yk1234.5, this will generate the URL;class=EST

A special link named AUTO will cause the feature to link to the GBrowse Details Script, which summarizes information about the feature. The default is not to link at all.


By default links will replace the contents of the current window. If you wish, you can specify a new window to pop up when the user clicks on a feature, or designate a named window or frame to receive the contents of the link. To do this, add the "link_target" option to the [TRACK DEFAULTS] section or to a track stanza. The format is this:

      link_target = _blank

The value uses the HTML targeting rules to name/create the window to receive the value of the link. The first time the link is accessed, a window with the specified name is created. The next time the user clicks on a link with the same target, that window will receive the content of the link if it is still present, or it will be created again if it has been closed. A target named "_blank" is special and will always create a new window.

The "link_target" option can also be computed dynamically. See Computed Options for details.

The title option controls the "tooltips" text that pops up when the mouse hovers over a glyph in certain browsers. The rules for generating titles are the same as the "link" option discussed above.The "title" option can also be computed dynamically. See for details.
Note HTML characters such as "<", ">" and "&" are not automatically escaped from the title. This lets you do neat stuff, such as create popup menus, but also means that you need to be careful. In particular, you must not use the quote character (") in the title, but either use the " entity, or the single quote ('). The function CGI::escapeHTML() is available to properly escape HTML characters in dynamically-generated titles.
The special title value "AUTO" causes a default description to appear describing the name, type and position of the feature. This is also assumed if the title option is missing or blank.

Grouping Options

A small number of options allow you to group related features together. This facility is described in more detail in Grouping GBrowse Features.

This option lets you connect related features by dotted lines based on a pattern match in the features' names. A typical example is connecting the 5' and 3' read pairs from ESTs or plasmids.

For Bio::DB::SeqFeature::Store databases only, the group_on field allows you to group features together by display_name, target or any other method. This is mostly useful for XY-plot data, where you may want to dynamically group related data points together so that they share the same vertical scaling.


       group_on = display_name

Subtrack Creation Options

Several options allow you to declare and configure subtracks, which are sets of filtered features organized within band inside the main tracks. These are described at length in Creating and Managing Subtracks with GBrowse2.


If the track contains a small number of features that have distinct display names, such as a set of quantitative (wiggle) features, then use this option to associate an auxiliary "metadata" file with the features contained in this track. The metadata file describes each feature's distinguishing attributes and allows the user to select among them. See Creating and Managing Subtracks with GBrowse2 for yhe file gormat and a worked example.

subtrack select

If, on the other hand, the track contains a large number of features and it is impractical to enumerate them by hand, then use this option to define subtrack filters. Each filter becomes a heading in the subtrack selection dialog box, and combination of filters listed in the subtrack table option define each subtrack.

Each filter declaration consists of two to three white-space separated values, terminated by a semicolon. The first value is the column label. The second column is a method call name to be applied to the feature (discussed at more length later). The optional third argument is an argument to be passed to the method call.

The method name can be any of the methods accepted by Bio::SeqFeatureI feature objects. Typical methods used for the second argument are "display_name" (the name of the feature), "type", "method", "source", "score", "strand", "has_tag", and "tag_value". "has_tag" and "tag_value" both require the third argument to determine which tag to interrogate.


subtrack select = Strand strand ;
                  Status tag_value status

This configuration will apply two filters to each feature to sort them into subtracks. The Strand filter will invoke each feature's strand() method, and the Status filter with call each feature's tag_value() method with an argument of "status", i.e. $feature->tag_value('status').

subtrack table

This option defines the values that the dimensions can take on and specifies how to partition them into subtracks. Lines are separated by semicolons. Within each line are a series of values to be matched against the dimensions specified by "subtrack select" in the following format:

:subtrack_label matchval1 matchval2 matchval3... =id *

The match values are required and must number the same as the dimension filters given in subtrack select. The optional :subtrack label assigns a human-readable label to the subtrack for display purposes. The ":" character will not be displayed. =id assigns an ID to the subtrack for use when turning tracks on and off in the GBrowse URL. The "*" character, if present, will turn this subtrack on by default when the user loads the track for the very first time.

When performing the match, values in this table that look like numbers will be compared using a numeric match. Otherwise they will be compared using a case sensitive exact string match. Values that are proceeded by the ~ symbol (e.g. "~abc") will be matched using a case-insensitive regular expression match.


subtrack table = :"+Strand Curated"    +1 confirmed =fc * ;
                 :"-Strand Curated"    -1 confirmed =rc * ;
                 :"+Strand Predicted"  +1 predicted =fp   ;
                 :"-Strand Predicted"  -1 predicted =rp

The subtrack table option can also be used to highlight one type of feature in a larger collection and assign all others to a separate sub track. The example below filters features by their source tag. All features with a source other than "SpecialSource" will be assigned to the "Other" sub-track.

subtrack select = Source source
subtrack table  = :SpecialLabel SpecialSource;
                  :Other 0;

brief comment
This optional option is a bit of explanatory text to insert at the top of the subtrack selection dialog.
subtrack labels

If you would like to select subtracks based on its type, a tag, or some other method, but you want the user to see a different label for the value when it is displayed in the subtrack selection dialog, you can specify the label here. For example, if you wish the +1 and -1 values in the example above to be displayed using the terms "Forward" and "Reverse", you would define that this way.

subtrack labels = +1 "Forward" ;
                  -1 "Reverse"
hide empty subtracks
If this option is set to a true value, then subtracks that do not contain any data in currently viewed region will be suppressed. Otherwise, their titles will be printed and they will take up a small amount of blank vertical real estate.

See Creating and Managing Subtracks with GBrowse2 for more information.

Adding Tracks to the Overview and Region Panels

You can make any set of tracks appear in the overview by creating a stanza with a title of the format [<label>:overview], where <label> is any unique label of your choice. The format of the stanza is identical to the others, but the indicated track will appear in the overview rather than as an option in the detailed view. For example, this stanza adds to the overview a set of features of method "gene", source "framework":

feature       = gene:framework
label         = 1
glyph         = generic
bgcolor       = lavender
height        = 5
key           = Mapped Genes

Similarly, you can make a track appear in the region panel by appending ":region" to its name:

feature       = gene_density
glyph         = xyplot
graph_type    = boxes
scale         = right
bgcolor       = red
fgcolor       = red
height        = 20
key           = SNP Density

Semantic Zooming

Sometimes you will want to change the appearance of a track when the user has zoomed out or zoomed in beyond a certain level. To indicate this, create a set of "length qualified" stanzas of format [<label>:<zoom level>], where all stanzas share the same <label>, and <zoom level> indicates the minimum size of the region that the stanza will apply to. For example(This section has been edited - "feature" line has been removed from the remaining stanzas):

  feature = transcript:curated
  glyph    = dna
  fgcolor  = blue
  key      = genes
  citation = example semantic zoom track

  glyph   = gene

  glyph   = arrow

  glyph   = generic

This series of stanzas says to use the "gene" glyph when the segment being displayed is 500 bp or longer, to use the "arrow" glyph when the segment being displayed is 100,000 bp or longer, and the "generic" glyph when the region being displayed is 500,000 bp or longer. For all other segment lengths (1 to 499 bp), the ordinary [gene] stanza will be consulted, and the "dna" glyph will be displayed. The bare [gene] stanza is used to set all but the "feature" options for the other stanzas. This means that the fgcolor, key and citation options are shared amongst all the [gene:XXXX] stanzas, but the "feature" option must be repeated.

You can override any options in the length qualified stanzas. For example, if you want to change the color to red in when displaying genes on segments between 500 and 99,999 bp, you can modify the [gene:500] stanza as follows:

 feature = transcript:curated
 glyph   = transcript2
 fgcolor = red

It is also possible to display different features at different zoom levels, although you should handle this potentially confusing feature with care.

If you wish to turn off a track entirely, you can use the "hide" flag to hide the track when the display exceeds a certain size:

 hide = 1

Summary Mode (new in version 2.09)

Normal mode: each feature is rendered separately
Summary mode: a density plot shows the number of features per interval

Summary Mode, which was introduced in version 2.09, is a form of semantic zooming in which the regular display of individual features is replaced by a density graph or histogram showing the number of features across the displayed region. Because the rendering is very fast, users can zoom out to view the entire chromosome without waiting for a long redisplay. The two figures to the right show how a track appears in regular and summary mode.

There are certain limitations on summary mode:

  1. It only works with Bio::DB::SeqFeature::Store databases, although support for the Chado and Bio::DB::GFF adaptors is pending. It does work with all flavors of Bio::DB::SeqFeature::Store, including the in-memory and Berkeleydb implementations.
  2. You will need BioPerl version 1.6.2 or higher. The currently released version of BioPerl is 1.6.1, so you will need to get a newer version from the BioPerl source code repository (see below).
  3. Bio::DB::SeqFeature::Store databases created with older versions of BioPerl will need to be upgraded to support summary mode. This is done easily and quickly with a command-line utility described below. The databases created by newer versions of BioPerl support summary mode automatically.

Step-by-step instructions:

Install the development version of BioPerl

Download the latest "snapshot" of BioPerl from The BioPerl Web Site. Alternatively, you may use the "git" source code control command to make a local copy of the developers' repository. This will enable you to update BioPerl regularly. See [for downloading BioPerl via Github]. Follow the directions to run "perl Build.PL; Build; Build install".

Upgrade preexisting Bio::DB::SeqFeature::Store databases

You will need to upgrade your preexisting databases to take advantage of summary mode. This is done using the script with the --summary command line option. Make sure you are using the new version of the script that comes with the developer's release of BioPerl.

For a MySQL database named "my_genome" located on the localhost: -a DBI::mysql -d my_genome --summary

The same, but with a username and password: -a DBI::mysql -d my_genome -u myname -p secret --summary

The same, but on a remote host named "beehive": -a DBI::mysql -d my_genome:host=beehive -u myname -p secret --summary

A SQLite database located at /usr/local/share/my_genome.sqlite: -a DBI::SQLite -d /usr/local/share/my_genome.sqlite --summary

A Berkeleydb database located at /usr/local/share/my_genome.berkeley: -a berkeleydb -d /usr/local/share/my_genome.berkeley --summary

In-memory databases do not need to be upgraded, nor do new databases created by with the --create option.

Enable summary mode in your datasource configuration file(s)

Insert the show summary option within the [TRACK DEFAULTS] stanza:

 show summary = 1000000

The value of "show summary" specifies the region length, in base pairs, at which to switch into summary mode. The example above specifies to switch into summary mode at a level of 1 Mb or higher (1,000,000 bp), but the appropriate value will be depend on the genome size and average number of features per chromosome.

You may change this value on a track-by-track basis by adding "show summary" options to the track stanzas you wish to override. To turn summary mode off completely for a track, either set the value to something ridiculously high, or specify a value of "0".

Creating Subtracks (new in version 2.09)

Subtrack selector

You can create an unlimited number of subtracks within a single major track in order to group a series of datasets that are logically linked, such as a timecourse. You can choose which subtracks to show by default and the order in which they will appear. The user can use a dialog box to select which subtracks to make visible and to reorder the subtracks.

See Creating and Managing Subtracks with GBrowse2 for full details.

Advanced Datasource Configuration Topics

This section describes how to further customize your GBrowse data sources to provide for an exceptional end-user experience.

Computed Options

Many configuration file options can be computed at run time by using Perl subroutines as their values. These are known as "callbacks." Currently callbacks work with all options that can be placed in a [TRACK] section except for the "database" and "remote renderer" options. In addition, the "header", "footer" and "html1" through "html6" options in the GBrowse.conf and datasource [GENERAL] sections accept callbacks.

You need to know the Perl programming language to take advantage of this feature. The general format of this type of option is:

  option name = sub {
              some perl code;
              some more perl code;
              even more perl code;

The value must begin with the sequence "sub {" in order to be recognized as a subroutine declaration. After this, you can have one or more lines of Perl code followed by a closing brace. Continuation lines must begin with whitespace.

When the browser first encounters an option like this one, it will attempt to compile it into Perl runtime code. If successful, the compiled code will be stored for later use and invoked whenever the value of the option is needed. (Otherwise, an error message will appear in your server error log).

For options of type "footer", "header", and "html1" through "html6", the subroutine is passed no arguments. It is expected to produce some HTML and return it as a string value.

For glyph-specific features, such as "bgcolor" the subroutine will be called at run time with five arguments consisting of the feature, the name of the option, the current part number of the feature, the total number of parts in this feature, and the glyph corresponding to the feature. Usually you will just look at the first argument. The return value is treated as the value of the corresponding option. For example, this bgcolor subroutine will call the feature's primary_tag() method, and return "blue" if it is an exon, "orange" otherwise:

  bgcolor = sub {
          my $feature = shift;
          return "blue" if $feature->primary_tag eq 'exon';
          return "orange";

See the manual page for Bio::Graphics::Feature and Bio::SeqFeature::Lite for information on how to interrogate the feature object.

For special effects, such as coloring the first and last exons differently, you may need access to all five arguments. Here is an example that draws the first and last parts of a feature in blue and the rest in red:

   sub {
         my($feature,$option_name,$part_no,$total_parts,$glyph) = @_;
         return 'blue' if $part_no == 0;                # zero-based indexing!
         return 'blue' if $part_no == $total_parts-1;   # zero-based indexing!
         return 'red';

If you need access to information in the parent of the feature (e.g. in a multipart feature), you can call the glyph's parent_feature() method:

  sub {
         my($feature,$option_name,$part_no,$total_parts,$glyph) = @_;
         my $parent = $glyph->parent_feature;
         return 'blue' if $parent->name =~ /Blue\d+/;
         return 'red';

The parent_feature() method was added to Bioperl on 17 April 2008. If you are using an earlier version, parent_feature() will not be available.

See the Bio::Graphics::Panel manual page for more details.

Callbacks for the "link", "title", and "link_target" options have a slightly different call signature. They receive three arguments consisting of the feature, the Bio::Graphics::Panel object, and the Bio::Graphics::Glyph object corresponding to the current track within the panel:

  link = sub {
             my ($feature, $panel, $track) = @_;
             ... do something

Ordinarily you will only need to use the feature object. The other arguments are useful to look up panel-specific settings such as the pixel width of the panel or the state of the "flip" setting:

  title = sub {
          my ($feature,$panel,$track) = @_;
          my $name = $feature->display_name;
          return $panel->flip ? "$name (flipped)" : $name;

Named Subroutine References

If you use a version of BioPerl after April 15, 2003, you can also use references to named subroutines as option arguments. To use named subroutines, add an init_code section to the [GENERAL] section of the configuration file. init_code should contain nothing but subroutine definitions and other initialization routines. For example:

  init_code = sub score_color {
                my $feature = shift;
                if ($feature->score > 50) {
                  return 'red';
                } else {
                  return 'green';
              sub score_height {
                my $feature = shift;
                if ($feature->score > 50) {
                  return 10;
                } else {
                  return 5;

Then simply refer to these subroutines using the \&name syntax:

   glyph = generic
   bgcolor = \&score_color
   height  = \&score_height

You can declare global variables in the init_code subroutine if you use "no strict 'vars';" at the top of the section:

    init_code = no strict 'vars';
                $HEIGHT = 10;
                sub score_height {
                  my $feature = shift;
                  if ($feature->score > 50) {
                    return $HEIGHT*2;
                  } else {
                    return $HEIGHT;

Due to the way the configuration file is parsed, there must be no empty lines in the init_code section. Either use comments to introduce white space, or "use" a .pm file to do anything fancy.

Subroutines that you define in the init_code section, as well as anonymous subroutines, will go into a package that changes unpredictably each time you load the page. If you need a predictable package name, you can define it this way:

   init_code = package My; sub score_height { .... }

   height = \&My::score_height

Using Pipes in the GBrowse.conf Data Source Name

It is sometimes convenient to generate datasource files programatically rather than using a static file. To do this, you can give GBrowse.conf a "path" option that uses Perl's "piped open" syntax to read the output of a script. For example:

 # this is in GBrowse.conf
 description = modENCODE preview database
 path        = /usr/local/modencode/bin/ |

The script ( in this example) must print a correctly formatted GBrowse datasource configuration file to its standard output.

[Available in 2.09 and higher] To get even more elaborate than this, you can use a regular expression as the stanza datasource name, allowing you to pass extracted subexpressions to the script. For example:

 description = modENCODE preview database
 path        = /usr/local/modencode/bin/ $1 |

The "=~" prefix is required to turn on regular expression scanning. This will match any data source of the format "modENCODE_preview_v123" where "123" is a series of digits. The digits will be extracted using the regular expression and passed to as an argument:

/usr/local/modencode/bin/ 123 |

You can then invoke GBrowse with any of the following URLs and have the indicated script return the appropriate data source configuration data on its standard output:

http: //
http: //
http: //

Controlling the gbrowse_details page

If a track definition's "link" option is set to AUTO, the gbrowse_details script will be invoked when the user clicks on a feature contained within the track. This will generate a simple table of all feature information available in the database. This includes the user-defined tag/value attributes set in Column 9 of the GFF for that feature.

You can control, to some extent, the formatting of the tag value table by providing a configuration stanza with the following format:

 tag1 = formatting rule
 tag2 = formatting rule
 tag3 = formatting rule

"feature_type" is the type of the feature you wish to control. For example, "gene:sgd" or simply "gene". You may also specify a feature_type of "default" to control the formatting for all features. "tag1", "tag2" and so forth are the tags that you wish to control the formatting of. The tags "Name," "Class", "Type", "Source", "Position", and "Length" are valid for all features, while "Target" and "Matches" are valid for all features that have a target alignment. In addition, you can use the names of any attributes that you have defined. Tags names are NOT case sensitive, and you may use a tag named "default" to define a formatting rule that is general to all tags (more specific formatting rules will override less specific ones).

A formatting rule can be a string with (possible) substitution values, or a callback. If a string, it can contain one or more of the substitution variable "$name", "$start", "$end", "$stop", "$strand", "$method", "$type", "$description" and "$class", which are replaced with the corresponding values from the current feature. In addition, the substitution variable "$value" is replaced with the current value of the attribute, and the variable "$tag" is replaced with the current tag (attribute) name. HTML characters are passed through.

For example, here is a simple way to boldface the Type field, italicize the Length field, and turn the Notes into a Google search:

 Type   = <b>$value</b>
 Length = <b>$value</b>
 Note  = <a href="$value">$value</a>

If you provide a callback, the callback subroutine will be invoked with three arguments. WARNING: the three arguments are different from the ones passed to other callbacks, and consist of the tag value, the tag name, and the current feature:

 Note = sub {
            my($value,$tag_name,$feature) = @_;
            do something....

You can use this feature to format sequence attributes nicely. For example, if your features have a Translation attribute which contains their protein translations, then you are probably unsatisified with the default formatting of these features. You can modify this with a callback that word-wraps the value into lines of at most 60 characters, and puts the whole thing in a <pre> section.

Translation = sub {
               my $value = shift;
               $value =~ s/(\S{1,60})/$1\n/g;

Linking out from gbrowse_details

The formatting rule mechanism described in the previous section is the recommended way of creating a link out from the gbrowse_details page. However, an older mechanism is available for backward compatibility.

To use this legacy mechanism, create a stanza header named [TagName:DETAILS], where TagName is the name of the tag (attribute name) whose values you wish to turn into URLs, and where DETAILS must be spelled with capital letters. Put the option "URL" inside this stanza, containing a string to be transformed into the URL.

For example, to link to a local cgi script from the following GFF2 line:

IV     curated exon    518     550     . + .   Transcript B0273.1; local_id 11723

one might add the following stanza to the configuration file:

   URL   = http://localhost/cgi-bin/localLookup.cgi?tag=$tag;id=$value

The URL option's value should be a URL containing one or more variables. Variables begin with a dollar sign ($), and are replaced at run time with the information relating to the selected feature attribute. Recognized variables are:

    $tag        The "tag" of the tag/value pair
    $value      The "value" of the tag/value pair

The value of URL can also be an anonymous subroutine, in which case the subroutine will be invoked with a two-element argument list consisting of the name of the tag and its value. This example, provided by Cyril Pommier, will convert Dbxref tags into links to NCBI, provided that the value of the tag looks like an NCBI GI number:

URL = sub {
      my ($tag,$value)=@_;
      if ($value =~ /NCBI_gi:(.+)/){
       return "$1";

Restricting Access to Data Sources and Tracks with Usernames and Passwords

See: GBrowse Configuration/Authentication

Configuring Balloon Tooltips

See: GBrowse Configuration/Balloons.

Generating Static Images: PNGs, SVGs and PDFs

See: GBrowse Configuration/Images.

Describing a GBrowse data source using structured meta-data

If you wish, you can enter options into the datasource config file that will described the data in a structured way. This in turn can be used by automated scripts to discover the species, genomic build, the name of the maintainer, and other descriptive information about the data source. The information is compatible with the DAS Registration server and in a coming GBrowse release will allow GBrowse instances to automatically register themselves so that users and automated scripts can easily find and extract information from the browser.

To enter metadata about a particular data source, go to the [GENERAL] section of its configuration file and enter a metadata option formatted like this one:

 metadata =
        -description             Example GBrowse database containing information from WormBase
				 ( and modENCODE (
        -maintainer              Lincoln Stein <>
        -created                 2010-1-4
        -modified                2009-9-1
        -authority               WS
        -coordinates_version     180
        -source                  Chromosome
        -testrange               I:7385068..7387651
        -species                 Caenorhabditis elegans
        -taxid                   6239

The metadata option has multiple suboptions (note the required leading whitespace in front of them):

A free text description of the data source. It can span multiple lines.
An email address for the person or mailing list to contact concerning issues with the data source.
The creation and modification date of the resource, in the format YYYY-MM-DD.
-authority,-coordinates_version and -coordinates
These fields establish the genome build and build version. The authority is a short prefix indicating the organization that is responsible for the build, such as "NCBI" (human), "WS" (WormBase), or SGD (Yeast), and coordinates_version indicates the version of the build. In the example above, therefore, the build is described as WS180. For greatest power, you can use -coordinates to provide a DAS registry coordinate system URL so that software that uses the DAS system can reliably combine tracks from different data sources. Many coordinate systems are already registered at the DAS registry; you may register a new one if needed.
This describes the type of coordinate system used, either "Chromosome" or "Contig".
This provides an example range for new users to look at.
These indicate the species name (in long binomial format) and the NCBI taxon id.

Note that the support for automatic registration and discovery of GBrowse data sources is not available in the 2.00 release, but is expected to be added in a subsequent point release.

Advanced Configuration Topics

Maintaining the User Accounts Database

If you have the requisite modules installed (DBI, DBD::SQLite or DBD::mysql), then ./Build install will run a script called "", which creates and initializes a user account database for managing user logins and shared tracks. If you take advantage of the user accounts feature (described in more detail in GBrowse_Configuration/Authentication), you may wish to run periodically. It checks for database inconsistencies, removes unused uploads, and does other routine maintenance on the user accounts database.

Removing Unused Sessions, Uploads and Cached Images

Over time GBrowse will accumulate unused sessions left by users who visit once and never return. Eventually these unused sessions will use up disk space and may adversely affect performance. The same issue affects custom tracks (uploaded files) and cached images.

You can clean up these files using the Unix "find" command:

    cd /var/tmp/gbrowse2
    sudo -u www-data find . -type f -atime +20 -print -exec rm {} \;

This will remove all files that have not been accessed for more than 20 days. Note that the command should run as the Apache web user ("www-data" in this example). The number of days is specified with -atime +20. Change 20 to some other value if you desire.

You may wish to run this as a daily cron job, either by adding it to the web user's cron table, or by running it in root's cron table.

Other Advanced Topics

More installation and maintenance tips, including support for next generation sequencing data, user accounts, and more, are given in GBrowse 2.0 Install HOWTO#Advanced Installation Topics

The GBrowse2 REST API

See: GBrowse2 REST API (section under construction)