Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl
Commits
a6dc2b1c
Commit
a6dc2b1c
authored
Feb 16, 2009
by
Andreas Kusalananda Kähäri
Browse files
Clean up get_adaptor().
parent
5d312df5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
27 deletions
+40
-27
modules/Bio/EnsEMBL/Registry.pm
modules/Bio/EnsEMBL/Registry.pm
+40
-27
No files found.
modules/Bio/EnsEMBL/Registry.pm
View file @
a6dc2b1c
...
...
@@ -887,49 +887,62 @@ sub add_adaptor {
=cut
sub
get_adaptor
{
my
(
$class
,
$species
,
$group
,
$type
)
=
@_
;
sub
get_adaptor
{
my
(
$class
,
$species
,
$group
,
$type
)
=
@_
;
$species
=
$class
->
get_alias
(
$species
);
my
%dnadb_adaptors
=
qw(sequence 1 assemblymapper 1 karyotypeband 1 repeatfeature 1 coordsystem 1 assemblyexceptionfeature 1 )
;
my
%dnadb_adaptors
=
(
'
sequence
'
=>
1
,
'
assemblymapper
'
=>
1
,
'
karyotypeband
'
=>
1
,
'
repeatfeature
'
=>
1
,
'
coordsystem
'
=>
1
,
'
assemblyexceptionfeature
'
=>
1
);
#warn "$species, $group, $type";
## warn "$species, $group, $type";
$type
=
lc
(
$type
);
my
$dnadb_group
=
$registry_register
{
$species
}{
lc
(
$group
)}{
_DNA
};
my
$dnadb_group
=
$registry_register
{
$species
}{
lc
(
$group
)
}{
'
_DNA
'
};
if
(
defined
(
$dnadb_group
)
&&
defined
(
$dnadb_adaptors
{
lc
(
$type
)})
)
{
$species
=
$registry_register
{
$species
}{
lc
(
$group
)}{'
_DNA2
'};
$group
=
$dnadb_group
;
if
(
defined
(
$dnadb_group
)
&&
defined
(
$dnadb_adaptors
{
lc
(
$type
)
}
)
)
{
$species
=
$registry_register
{
$species
}{
lc
(
$group
)
}{'
_DNA2
'};
$group
=
$dnadb_group
;
}
my
$ret
=
$registry_register
{
$species
}{
lc
(
$group
)
}{
lc
(
$type
)
};
if
(
!
defined
(
$ret
)
)
{
return
undef
;
}
if
(
!
defined
(
$ret
)
)
{
return
undef
}
if
(
ref
(
$ret
)
)
{
return
$ret
}
if
(
!
ref
(
$ret
)){
# not instantiated yet
my
$dba
=
$registry_register
{
$species
}{
lc
(
$group
)}{'
_DB
'};
my
$module
=
$ret
;
eval
"
require
$module
";
# Not instantiated yet
if
(
$@
)
{
warning
("
$module
cannot be found.
\n
Exception $@
\n
");
return
undef
;
}
if
(
!
defined
(
$registry_register
{
$species
}{
lc
(
$group
)}{'
CHECKED
'})){
$registry_register
{
$species
}{
lc
(
$group
)}{'
CHECKED
'}
=
1
;
$class
->
version_check
(
$dba
);
}
my
$adap
=
"
$module
"
->
new
(
$dba
);
Bio::EnsEMBL::
Registry
->
add_adaptor
(
$species
,
$group
,
$type
,
$adap
,
"
reset
");
$ret
=
$adap
;
my
$dba
=
$registry_register
{
$species
}{
lc
(
$group
)
}{'
_DB
'};
my
$module
=
$ret
;
eval
"
require
$module
";
if
(
$@
)
{
warning
("
'
$module
' cannot be found.
\n
Exception $@
\n
");
return
undef
;
}
if
(
!
defined
(
$registry_register
{
$species
}{
lc
(
$group
)
}{'
CHECKED
'}
)
)
{
$registry_register
{
$species
}{
lc
(
$group
)
}{'
CHECKED
'}
=
1
;
$class
->
version_check
(
$dba
);
}
my
$adap
=
"
$module
"
->
new
(
$dba
);
Bio::EnsEMBL::
Registry
->
add_adaptor
(
$species
,
$group
,
$type
,
$adap
,
'
reset
'
);
$ret
=
$adap
;
return
$ret
;
}
}
## end sub get_adaptor
=head2 get_all_adaptors
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment