Commit 36da09d0 authored by Ian Longden's avatar Ian Longden
Browse files

get_all_db fix

parent a56d25b8
...@@ -21,12 +21,13 @@ $gene_adaptor = Bio::EnsEMBL::Registry->get_adaptor("Homo Sapiens","core","Gene" ...@@ -21,12 +21,13 @@ $gene_adaptor = Bio::EnsEMBL::Registry->get_adaptor("Homo Sapiens","core","Gene"
All Adaptors are stored/registered using this module. This module should then All Adaptors are stored/registered using this module. This module should then
be used to get the adaptors needed. be used to get the adaptors needed.
The registry can be loaded from a configuration file. If the enviroment The registry can be loaded from a configuration file using the method load_all.
variable ENSEMBL_REGISTRY is set then the file pointed to by it is executed. If a file is passed to load_all then this is used.
If not set then if the file ~/.ensembl_init exists then this will be executed. Else if the enviroment variable ENSEMBL_REGISTRY is set then this is used
An example of such configuration file can be found in Else if the file .ensembl_init in your home directory exist it is used.
ensembl/modules/Bio/EnsEMBL/Utils/ensembl_init.example
For the Web server ENSEMBL_REGISTRY should be set in SiteDefs.pm. For the Web server ENSEMBL_REGISTRY should be set in SiteDefs.pm, which will
pass this on to load_all.
The four types of registrys are for db adaptors, dba adaptors, dna adaptors The four types of registrys are for db adaptors, dba adaptors, dna adaptors
and the standard type. and the standard type.
...@@ -158,23 +159,23 @@ sub load_all{ ...@@ -158,23 +159,23 @@ sub load_all{
# } # }
} }
=head2 check_if_already_there #=head2 check_if_already_there
#
Arg [DBNAME] : string # Arg [DBNAME] : string
The name of the database to check for. # The name of the database to check for.
Arg [HOST] : (optional) string # Arg [HOST] : (optional) string
The domain name of the database host to check for # The domain name of the database host to check for
Arg [PORT] : int # Arg [PORT] : int
The port to check for when connecting to the database # The port to check for when connecting to the database
Arg [DRIVER] : (optional) string # Arg [DRIVER] : (optional) string
The type of database driver to check for # The type of database driver to check for
#
Description: Check to see if the database is already stored. # Description: Check to see if the database is already stored.
Returntype : 0 if not found else the species and group. # Returntype : 0 if not found else the species and group.
Exceptions : none # Exceptions : none
#
#
=cut #=cut
#sub check_if_already_there{ #sub check_if_already_there{
...@@ -276,6 +277,15 @@ sub get_all_db_adaptors{ ...@@ -276,6 +277,15 @@ sub get_all_db_adaptors{
my ($class,$db) = @_; my ($class,$db) = @_;
my %ret=(); my %ret=();
# we now also want to add all the DBAdaptors for the same species.
# as add_db_adaptor does not add if it is from the same species.
foreach my $dba (@{$registry_register{'_DBA'}}){
if($dba->species() eq $db->species()){
$ret{$dba->group()} = $dba;
}
}
foreach my $key (keys %{$registry_register{$class->get_alias($db->species())}{$db->group()}{'_special'}}){ foreach my $key (keys %{$registry_register{$class->get_alias($db->species())}{$db->group()}{'_special'}}){
$ret{$key} = $registry_register{$class->get_alias($db->species())}{$db->group()}{'_special'}{$key}; $ret{$key} = $registry_register{$class->get_alias($db->species())}{$db->group()}{'_special'}{$key};
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment