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
36da09d0
Commit
36da09d0
authored
20 years ago
by
Ian Longden
Browse files
Options
Downloads
Patches
Plain Diff
get_all_db fix
parent
a56d25b8
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
+33
-23
33 additions, 23 deletions
modules/Bio/EnsEMBL/Registry.pm
with
33 additions
and
23 deletions
modules/Bio/EnsEMBL/Registry.pm
+
33
−
23
View file @
36da09d0
...
...
@@ -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
be used to get the adaptors needed.
The registry can be loaded from a configuration file. If the enviroment
variable ENSEMBL_REGISTRY is set then the file pointed to by it is executed.
If not set then if the file ~/.ensembl_init exists then this will be executed.
An example of such configuration file can be found in
ensembl/modules/Bio/EnsEMBL/Utils/ensembl_init.example
For the Web server ENSEMBL_REGISTRY should be set in SiteDefs.pm.
The registry can be loaded from a configuration file using the method load_all.
If a file is passed to load_all then this is used.
Else if the enviroment variable ENSEMBL_REGISTRY is set then this is used
Else if the file .ensembl_init in your home directory exist it is used.
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
and the standard type.
...
...
@@ -158,23 +159,23 @@ sub load_all{
# }
}
=head2 check_if_already_there
Arg [DBNAME] : string
The name of the database to check for.
Arg [HOST] : (optional) string
The domain name of the database host to check for
Arg [PORT] : int
The port to check for when connecting to the database
Arg [DRIVER] : (optional) string
The type of database driver to check for
Description: Check to see if the database is already stored.
Returntype : 0 if not found else the species and group.
Exceptions : none
=cut
#
=head2 check_if_already_there
#
#
Arg [DBNAME] : string
#
The name of the database to check for.
#
Arg [HOST] : (optional) string
#
The domain name of the database host to check for
#
Arg [PORT] : int
#
The port to check for when connecting to the database
#
Arg [DRIVER] : (optional) string
#
The type of database driver to check for
#
#
Description: Check to see if the database is already stored.
#
Returntype : 0 if not found else the species and group.
#
Exceptions : none
#
#
#
=cut
#sub check_if_already_there{
...
...
@@ -276,6 +277,15 @@ sub get_all_db_adaptors{
my
(
$class
,
$db
)
=
@_
;
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
'}}){
$ret
{
$key
}
=
$registry_register
{
$class
->
get_alias
(
$db
->
species
())}{
$db
->
group
()}{'
_special
'}{
$key
};
}
...
...
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