Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
98eeee7e
Commit
98eeee7e
authored
11 years ago
by
Alessandro Vullo
Browse files
Options
Downloads
Patches
Plain Diff
Production DBAdaptor conditional loading, based on the availability of the
Rose ORM framework.
parent
47a82f33
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Registry.pm
+63
-17
63 additions, 17 deletions
modules/Bio/EnsEMBL/Registry.pm
with
63 additions
and
17 deletions
modules/Bio/EnsEMBL/Registry.pm
+
63
−
17
View file @
98eeee7e
...
...
@@ -150,6 +150,7 @@ my %group2adaptor = (
'
ontology
'
=>
'
Bio::EnsEMBL::DBSQL::OntologyDBAdaptor
',
'
otherfeatures
'
=>
'
Bio::EnsEMBL::DBSQL::DBAdaptor
',
'
pipeline
'
=>
'
Bio::EnsEMBL::Pipeline::DBSQL::DBAdaptor
',
'
production
'
=>
'
Bio::EnsEMBL::Production::DBSQL::DBAdaptor
',
'
snp
'
=>
'
Bio::EnsEMBL::ExternalData::SNPSQL::DBAdaptor
',
'
stable_ids
'
=>
'
Bio::EnsEMBL::DBSQL::DBAdaptor
',
'
variation
'
=>
'
Bio::EnsEMBL::Variation::DBSQL::DBAdaptor
',
...
...
@@ -1587,6 +1588,11 @@ sub load_registry_from_db {
my
$ontology_db
;
my
$ontology_version
;
my
$production_dba_ok
=
eval
{
require
Bio::EnsEMBL::Production::DBSQL::
DBAdaptor
;
1
};
my
$production_db
;
my
$production_version
;
my
$stable_ids_db
;
my
$stable_ids_version
;
...
...
@@ -1652,6 +1658,19 @@ sub load_registry_from_db {
$ontology_db
=
$db
;
$ontology_version
=
$
1
;
}
}
elsif
(
$production_dba_ok
and
$db
=~
/^ensembl(?:genomes)?_production(_\d+)?/x
)
{
# production db can come with no version (i.e. that on ens-staging1),
# but it's backed up with a release number
my
$version
=
$
1
;
if
(
$version
)
{
$version
=~
s/_//
;
if
(
$software_version
and
$version
eq
$software_version
)
{
$production_db
=
$db
;
$production_version
=
$version
;
}
}
else
{
# this is the default choice
$production_db
=
$db
if
$db
=~
/^ensembl(?:genomes)?_production$/
;
}
}
elsif
(
$db
=~
/^ensembl(?:genomes)?_stable_ids_(?:\d+_)?(\d+)/x
)
{
if
(
$
1
eq
$software_version
)
{
$stable_ids_db
=
$db
;
...
...
@@ -2065,11 +2084,6 @@ sub load_registry_from_db {
}
}
## end foreach my $compara_db (@compara_dbs)
}
## end else [ if ($@)
Bio::EnsEMBL::Utils::
ConfigRegistry
->
add_alias
(
-
species
=>
'
multi
'
.
$species_suffix
,
-
alias
=>
['
compara
'
.
$species_suffix
]
);
}
elsif
(
$verbose
)
{
print
("
No Compara databases found
\n
");
}
...
...
@@ -2105,11 +2119,6 @@ sub load_registry_from_db {
join
(
'
,
',
@ancestral_dbs
)
);
}
}
Bio::EnsEMBL::Utils::
ConfigRegistry
->
add_alias
(
-
species
=>
'
Ancestral sequences
'
.
$species_suffix
,
-
alias
=>
['
ancestral_sequences
'
.
$species_suffix
]
);
}
elsif
(
$verbose
)
{
print
("
No ancestral database found
\n
");
}
...
...
@@ -2132,16 +2141,35 @@ sub load_registry_from_db {
if
(
$verbose
)
{
printf
(
"
%s loaded
\n
",
$ontology_db
);
}
}
elsif
(
$verbose
)
{
print
("
No ontology database found
\n
");
}
Bio::EnsEMBL::Utils::
ConfigRegistry
->
add_alias
(
-
species
=>
'
multi
'
.
$species_suffix
,
-
alias
=>
['
ontology
'
.
$species_suffix
]
);
# Production
if
(
$production_dba_ok
and
defined
(
$production_db
)
)
{
# require Bio::EnsEMBL::Production::DBSQL::DBAdaptor;
my
$dba
=
Bio::EnsEMBL::Production::DBSQL::
DBAdaptor
->
new
(
'
-species
'
=>
'
multi
'
.
$species_suffix
,
'
-group
'
=>
'
production
',
'
-host
'
=>
$host
,
'
-port
'
=>
$port
,
'
-user
'
=>
$user
,
'
-pass
'
=>
$pass
,
'
-dbname
'
=>
$production_db
,
);
if
(
$verbose
)
{
printf
(
"
%s loaded
\n
",
$production_db
);
}
}
elsif
(
$verbose
)
{
print
("
No
ontology database
found
\n
");
print
("
No
production database or adaptor
found
\n
");
}
# Stable IDs
if
(
defined
(
$stable_ids_db
)
&&
$stable_ids_version
!=
0
)
{
...
...
@@ -2159,11 +2187,29 @@ sub load_registry_from_db {
printf
(
"
%s loaded
\n
",
$stable_ids_db
);
}
}
Bio::EnsEMBL::Utils::
ConfigRegistry
->
add_alias
(
-
species
=>
'
multi
'
.
$species_suffix
,
-
alias
=>
['
compara
'
.
$species_suffix
]
);
Bio::EnsEMBL::Utils::
ConfigRegistry
->
add_alias
(
-
species
=>
'
multi
'
.
$species_suffix
,
-
alias
=>
['
ontology
'
.
$species_suffix
]
);
$production_dba_ok
and
Bio::EnsEMBL::Utils::
ConfigRegistry
->
add_alias
(
-
species
=>
'
multi
'
.
$species_suffix
,
-
alias
=>
['
stable_ids
'
.
$species_suffix
]
);
-
species
=>
'
multi
'
.
$species_suffix
,
-
alias
=>
['
production
'
.
$species_suffix
]
);
}
Bio::EnsEMBL::Utils::
ConfigRegistry
->
add_alias
(
-
species
=>
'
multi
'
.
$species_suffix
,
-
alias
=>
['
stable_ids
'
.
$species_suffix
]
);
Bio::EnsEMBL::Utils::
ConfigRegistry
->
add_alias
(
-
species
=>
'
Ancestral sequences
'
.
$species_suffix
,
-
alias
=>
['
ancestral_sequences
'
.
$species_suffix
]
);
# Register aliases as found in adaptor meta tables.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment