BrowseDev/Using a Database With JBrowse

From GMOD
Revision as of 22:26, 29 July 2011 by RSCummings (Talk | contribs)

Jump to: navigation, search

This page describes how to create a JBrowse configuration file by using an example with inline comments.

Summary

In the context of JBrowse, a config file is a set of instructions in JSON syntax that first indicates the location of the feature data, and then specifies a list of JBrowse tracks that can use the referenced feature data. The options for the feature tracks are virtually the same in the config file as they are in flatfile-to-json.pl. The difference is that, instead of inputting the feature tracks one at a time with flatfile-to-json.pl, the tracks are specified all at once in a file. This greatly reduces the amount of typing needed to change a track, especially for tracks that use several options. It also makes it easier to manage a large number of tracks, since the options used for those tracks are all recorded in a human-readable way.

Example

Here is a sample config file with each line explained. Note that, in order for this config file to work, it would be necessary to remove the grey comments (since JSON does not support them).

{
  This is the header. It contains information about the database.
description: a brief textual description of the data source. "description": "D. melanogaster (release 5.37)", db_adaptor: a perl module with methods for opening databases and extracting
information. This will normally be either Bio::DB::SeqFeature::Store,
Bio::DB::Das::Chado, or Bio::DB::GFF, but it can also be the name of any
other perl module that implements the Bio::SeqFeatureI interface.
"db_adaptor": "Bio::DB::SeqFeature::Store", db_args: arguments required to produce an instance of the db_adaptor. The
required arguments can be found by searching for the db_adaptor on the CPAN
website.
"db_args": { adaptor: With Bio::DB::SeqFeature::Store, a value of "memory"
for the adaptor indicates that the data is stored somewhere in
the file system. Alternatively, it might have been stored in a
database such as MySQL or BerkeleyDB.
"-adaptor": "memory", dir: given the "memory" argument for the adaptor, this is the
file system path to the location in memory where the data is
stored. Data will automatically be extracted from any *.gff
or *.gff3 files in this directory.
"-dir": "/Users/stephen/Downloads/dmel_r5.37" },
This is the body. It contains information about the feature tracks.
TRACK DEFAULTS: The default options for every track. "TRACK DEFAULTS": { class: same as 'cssClass' in flatfile-to-json.pl. "class": "feature" }, tracks: information about each individual track. "tracks": [ Information about the first track. { track: same as 'tracklabel' in flatfile-to-json.pl. "track": "gene", key: same meaning as in flatfile-to-json.pl. "key": "Gene Span", feature: an array of the feature types that will be used for the track.
Similar to 'type' in flatfile-to-json.pl.
"feature": ["gene"], autocomplete: same meaning as in flatfile-to-json.pl. "autocomplete": "all", "class": "feature2", urlTemplate: same meaning as in flatfile-to-json.pl. Note how
urlTemplate is being used with a variable called "feature_id" defined
in extraData. In this way, different features in the same track can
be linked to different pages on FlyBase.
"urlTemplate": "http://flybase.org/cgi-bin/fbidq.html?{feature_id}", extraData: same as in flatfile-to-json.pl. "extraData": {"feature_id": "sub {shift->attributes(\"load_id\");}"} }, Information about the second track. { "track": "mRNA", "feature": ["mRNA"], "autocomplete": "alias", subfeatures: similar to 'getSubs' in flatfile-to-json.pl. "subfeatures": true, "key": "mRNA", "class": "transcript", subfeature_classes: same as 'subfeatureClasses' in flatfile-to-json.pl. "subfeature_classes": { "CDS": "transcript-CDS", "five_prime_UTR": "transcript-five_prime_UTR", "three_prime_UTR": "transcript-three_prime_UTR" }, arrowheadClass: same meaning as in flatfile-to-json.pl. "arrowheadClass": "transcript-arrowhead", clientConfig: same meaning as in flatfile-to-json.pl. "clientConfig": { "histScale":5 }, "urlTemplate": "http://flybase.org/cgi-bin/fbidq.html?{feature_id}", "extraData": {"feature_id": "sub {shift->attributes(\"load_id\");}"} } ] }

Note how the config file is divided into two parts, a header section that contains information about the database, and a body section that contains information about the feature tracks.

See also

JBrowseDev/Current

External Links

Configuration File Documentation From the JBrowse Package