Automatically Attaching DAS Tracks to the Ensembl Genome Browser with BioMart Perl 0.7

2 Comments
Posted 09 Mar 2010 in biomart, ensembl

In this blog post, we describe how BioMart Perl 0.7 needs to be patched in order to create self-configuring DAS sources, which can then be automagically attached to the Ensembl Genome Browser using only a single URL.

BioMart is versatile framework that primarily addresses the denormalisation of very large databases in order to optimise query performance, but it also comes with various interfaces which permit an easy access to the optimised data sources (a.k.a the marts). One of the numerous interfaces is a Distributed Annotation System (DAS) server, which permits the integration of marts into remote systems and services. The most comprehensive marts are currently derived from the Ensembl genome databases, for which (among many other choices) the Ensembl Genome Browser provides an easy to use user interface. It is possible to manually attach BioMart DAS tracks to the Ensembl Genome Browser, so that annotation data from marts can be visualised in the browser on a gene and chromosome level of a genome besides the already existing features in the Ensembl databases.

BioMart DAS sources can be manually added as a DAS track in the Ensembl Genome Browser by

  1. clicking on ‘Manage your data’ in the panel to the left-hand side in the browser,
  2. then clicking on ‘Attach DAS’,
  3. entering the URL of the DAS server (e.g. http://www.biomart.org/biomart/das/default__hsapiens_gene_ensembl__ensembl_das_chr),
  4. clicking ‘Next’,
  5. explicitly selecting the DAS source you want to add,
  6. clicking ‘Next’,
  7. selecting the species this DAS source applies to,
  8. clicking ‘Next’,
  9. selecting the coordinate system the DAS source uses,
  10. clicking ‘Next’,
  11. and finally the configuration dialog needs to be closed.

Here, we provide two patch files, configureBioMart.pl.patch and ConfBuilder.pm.patch, which modify BioMart Perl 0.7 in such a way that a mart’s DAS track can be added using a similar URL to:

  • http://www.ensembl.org/Homo_sapiens/Location/View?r=6:133017695-133161157;contigviewbottom=das:http://your_host/biomart/das/default__hsapiens_gene_ensembl__ensembl_das_chr

This URL will instruct the Ensembl Genome Browser to add the DAS track given by the parameter contigviewbottom. The browser in return then confirms the successful operation with the following message:

For this example we have just taken a copy of the Ensembl mart as the DAS source, so the data we are displaying is a mirror image of the already existing genes in the Ensembl database. Nevertheless, the DAS track ‘Your Source’ — the name is configurable: see below — appears now in the genome browser like this:

If we try the same with the Ensembl mart from www.biomart.org, i.e. if we provide the DAS track URL http://www.biomart.org/biomart/das/default__hsapiens_gene_ensembl__ensembl_das_chr above, then the operation will fail and the genome browser will notify us with the message:

Patching BioMart Perl 0.7

In order to apply the patch, simply copy both patch files into the parent directory of your BioMart Perl installation and then carry out the following steps:

computer:legacy joachim$ lsConfBuilder.pm.patchbiomart-perlconfigureBioMart.pl.patch
computer:legacy joachim$ patch --verbose -p1 < ConfBuilder.pm.patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- old/biomart-perl/bin/ConfBuilder.pm 2009-01-10 13:21:32.000000000 +0000
|+++ new/biomart-perl/bin/ConfBuilder.pm 2010-02-10 20:25:26.000000000 +0000
--------------------------
Patching file biomart-perl/bin/ConfBuilder.pm using Plan A...
Hunk #1 succeeded at 26.
Hunk #2 succeeded at 703.
done
computer:legacy joachim$ patch --verbose -p1 < configureBioMart.pl.patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- old/biomart-perl/bin/configureBioMart.pl 2010-02-08 11:40:07.000000000 +0000
|+++ new/biomart-perl/bin/configureBioMart.pl 2010-02-10 20:25:40.000000000 +0000
--------------------------
Patching file biomart-perl/bin/configureBioMart.pl using Plan A...
Hunk #1 succeeded at 137.
done
computer:legacy joachim$

Of course, the --verbose parameter can be omitted.

Our patch introduces a few new parameters in biomart-perl/conf/settings.conf:

[databaseSettings]
username=mysql_username
password=mysql_password
host=mysql_host
port=mysql_port
[ensemblDAS]
sourcename=Your Source
version=56

Our Perl modifications will try to connect to your MySQL database (can be easily adapted for Oracle and Postgres: change ‘DBI:mysql:’ in ConfBuilder.pm) and read the contents of ensembl_compara_version. For this, the database settings and the Ensembl version are needed. The parameter sourcename defines simply the string that is displayed as the DAS track’s name in the genome browser.

The Juice

We achieved the implementation of a self-configuring DAS track by modifying the value of the MAPMASTER XML element in BioMart’s DSN listing. For each DAS track, the map master’s URL now points to the Ensembl web-site where specific information about the track’s species and coordinate system are located. Access to the compara database is required in order to retrieve the assembly version of the genome the track is working on. The latter is required to form a proper URL for the MAPMASTER XML element.

Contributors

Max: DAS insights and Ensembl self-configuring DAS-track knowledge
Joachim: BioMart patches


2 Comments

  1. Hi

    Nice work.

    Can you modify this patch to create a sources.xml response for a biomart DAS source?

    This way urls should work, manually adding sources is easier and also automatically adding Biomart DAS sources to the DASRegistry would be possible.

    If this could then be added to the biomart source code that would be great.

    Cheers

    Jonathan

  2. joachimbaran

    Hello Jonathan,

    I might implement your suggestion in the future. Basically, I will do so as soon as time permits it.

    Best Wishes,
    Joachim