[Open-bio-l] bioperl-live Bio::DB::Registry.pm bug finding
"/etc/bioinformatics/seqdatabase.ini" and suggestion for discovery of
new database adaptors
Malcolm Cook
malcolm.cook@genxy.com
Fri, 14 Jun 2002 10:51:00 -0700
This module loads the user's registry in his $HOME directory after testing for
one in /etc/bioinformatics...
Oh, the woes of cut and paste...
the 2nd instance of the line
open(F,"$home/.bioinformatics/seqdatabase.ini");
should read
open(F,"/etc/bioinformatics/seqdatabase.ini");
Can fix?
On the subject, elsewhere in the module, the approach of hardwiring the
implementations in the hash %implements can be usefully extended to 'discover'
new BioDatabaseAdaptor modules (a borrowed naming convention) allowing their
dynamic loading from sub-directory of Bio::DB named identically after the
protocol as it appears in seqdatabase.ini.
As follows...
put this in the modules header:
use UNIVERSAL::require;
and apply the following patch to _load_registry
if (defined $implement{$hash->{'protocol'}}) {
$class = $implement{$hash->{'protocol'}};
} elsif (($class =
"Bio::DB::".$hash->{'protocol'}."::BioDatabaseAdaptor")[0]->require) {
$class->import;
} elsif ($UNIVERSAL::require::ERROR !~ m/Can\'t locate .* in \@INC/) {
die "Error while requiring $class: $UNIVERSAL::require::ERROR";
}
else {
$self->warn("Registry does not support protocol ".$hash->{'protocol'});
next;
Why the trouble? I'm considering the approach creating/registering/using an
adaptor for SRS/getz.
Comments? Criticism?
Thanks & Regards,
--
Malcolm Cook – Software Engineer
Genset, Inc – San Diego, USA
Tel: 858-597-2664
(Some day I'll request a CVS account and also start to use patch / diff...)