Path: | lib/bio/io/registry.rb |
Last Update: | Thu Feb 18 18:16:45 +0000 2010 |
Copyright: | Copyright (C) 2002, 2003, 2004, 2005 Toshiaki Katayama <k@bioruby.org> |
License: | The Ruby License |
$Id:$
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.
e.g. OBDA_SEARCH_PATH="http://example.org/obda.ini+$HOME/lib/myobda.ini"
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.
pp | -> | p |