Skip to content
Snippets Groups Projects
Commit 21fa8bca authored by Ian Longden's avatar Ian Longden
Browse files

load_registry_from_db will now only load the databases that match the correct...

load_registry_from_db will now only load the databases that match the correct software version and not necessarily the latest versions
parent a1bcdd93
No related branches found
No related tags found
No related merge requests found
...@@ -822,8 +822,9 @@ my $self = shift; ...@@ -822,8 +822,9 @@ my $self = shift;
-user => 'anonymous', -user => 'anonymous',
-verbose => "1" ); -verbose => "1" );
Description: Will load the latest versions of the ensembl databases it Description: Will load the correct versions of the ensembl databases fro the
can find on a database instance into the registry. software release it can find on a database instance into the
registry.
Exceptions : None. Exceptions : None.
Status : Stable Status : Stable
...@@ -847,25 +848,21 @@ sub load_registry_from_db{ ...@@ -847,25 +848,21 @@ sub load_registry_from_db{
my @dbnames = map {$_->[0] } @$res; my @dbnames = map {$_->[0] } @$res;
my %temp; my %temp;
my $software_version = Bio::EnsEMBL::Utils::ConfigRegistry->software_version;
print "Will only load $software_version databases\n" if ($verbose);
for my $db (@dbnames){ for my $db (@dbnames){
if($db =~ /^([a-z]+_[a-z]+_[a-z]+)_(\d+)_(\d+[a-z]*)/){ if($db =~ /^([a-z]+_[a-z]+_[a-z]+)_(\d+)_(\d+[a-z]*)/){
if(defined($temp{$1})){ if($2 eq $software_version){
my ($r1,$r2) = split("_",$temp{$1});
if($r1 < $2){
$temp{$1} = $2."_".$3;
}
}
else{
$temp{$1} = $2."_".$3; $temp{$1} = $2."_".$3;
} }
} }
elsif($db =~ /^ensembl_compara_(\d+)/){ elsif($db =~ /^ensembl_compara_(\d+)/){
if($compara_version < $1){ if($1 eq $software_version){
$compara_version = $1; $compara_version = $1;
} }
} }
elsif($db =~ /^ensembl_go_(\d+)/){ elsif($db =~ /^ensembl_go_(\d+)/){
if($go_version < $1){ if($1 eq $software_version){
$go_version = $1; $go_version = $1;
} }
} }
...@@ -965,10 +962,11 @@ sub load_registry_from_db{ ...@@ -965,10 +962,11 @@ sub load_registry_from_db{
#GO #GO
if($go_version){ if($go_version){
eval "use Bio::EnsEMBL::ExternalData::GO::GOAdaptor"; eval "require Bio::EnsEMBL::ExternalData::GO::GOAdaptor";
if($@) { if($@) {
#ignore go as code required not there for this #ignore go as code required not there for this
print "Bio::EnsEMBL::ExternalData::GO::GOAdaptor::DBAdaptor not found so go database ensemb_go_$go_version will be ignored\n" if ($verbose); # print $@;
print "GO software not installed so go database ensemb_go_$go_version will be ignored\n" if ($verbose);
} }
else{ else{
my $go_db = "ensembl_go_".$go_version; my $go_db = "ensembl_go_".$go_version;
......
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