# registry.rb

Path: | lib/bio/io/registry.rb
Last Update: | Thu Nov 19 15:47:02 +0000 2009

# bio/io/registry.rb - OBDA BioRegistry module

Copyright: | Copyright (C) 2002, 2003, 2004, 2005 Toshiaki Katayama <k@bioruby.org>
License: | The Ruby License

$Id:$

## Description

BioRegistry read the OBDA (Open Bio Database Access) configuration file (seqdatabase.ini) and create a registry object. OBDA is created during the BioHackathon held in Tucson and South Africa in 2002 as a project independent set of protocols to access biological databases. The spec is refined in the BioHackathon 2003 held in Singapore.

By using the OBDA, user can access to the database by get_database method without knowing where and how the database is stored, and each database has the get_by_id method to obtain a sequence entry.

Sample configuration file is distributed with BioRuby package which consists of stanza format entries as following:

      VERSION=1.00

      [myembl]
      protocol=biofetch
      location=http://www.ebi.ac.uk/cgi-bin/dbfetch
      dbname=embl

      [mysp]
      protocol=biosql
      location=db.bioruby.org
      dbname=biosql
      driver=mysql
      user=root
      pass=
      biodbname=swissprot

The first line means that this configration file is version 1.00.

The [myembl] line defines a user defined database name ‘myembl’ and following block indicates how the database can be accessed. In this example, the ‘myembl’ database is accecced via the OBDA‘s BioFetch protocol to the dbfetch server at EBI, where the EMBL database is accessed by the name ‘embl’ on the server side.

The [mysp] line defines another database ‘mysp’ which accesses the RDB (Relational Database) at the db.bioruby.org via the OBDA‘s BioSQL protocol. This BioSQL server is running MySQL database as its backend and stores the SwissProt database by the name ‘swissprot’ and which can be accessed by ‘root’ user without password. Note that the db.bioruby.org server is a dummy for the explanation.

The configuration file is searched by the following order.

1. Local file name given to the Bio::Registry.new(filename).
2. Remote or local file list given by the environmenetal variable ‘OBDA_SEARCH_PATH’, which is a ’+’ separated string of the remote (HTTP) and/or local files.

         e.g. OBDA_SEARCH_PATH="http://example.org/obda.ini+$HOME/lib/myobda.ini"

3. Local file "$HOME/.bioinformatics/seqdatabase.ini" in the user‘s home directory.
4. Local file "/etc/bioinformatics/seqdatabase.ini" in the system configuration directry.

All these configuration files are loaded. If there are database definitions having the same name, the first one is used.

If none of these files can be found, Bio::Registry.new will try to use www.open-bio.org/registry/seqdatabase.ini file.

## References

- obda.open-bio.org/
- cvs.open-bio.org/cgi-bin/viewcvs/viewcvs.cgi/obda-specs/?cvsroot=obf-common
- www.open-bio.org/registry/seqdatabase.ini

### Required files

uri net/http bio/command pp

### External Aliases

pp | -> | p

[Validate]