Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
126b0867
Commit
126b0867
authored
Nov 02, 2010
by
Andreas Kusalananda Kähäri
Browse files
Make get_species_and_object_type() multi-species aware.
parent
34377e8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
modules/Bio/EnsEMBL/Registry.pm
modules/Bio/EnsEMBL/Registry.pm
+21
-9
No files found.
modules/Bio/EnsEMBL/Registry.pm
View file @
126b0867
...
...
@@ -2470,7 +2470,7 @@ sub get_species_and_object_type {
$dbc
=
$dba
->
dbc
();
}
my
$dbh
=
$dbc
->
db_handle
();
my
$dbh
=
$dbc
->
db_handle
();
my
$dbname
=
$dbc
->
dbname
();
my
$statement
=
sprintf
(
...
...
@@ -2481,7 +2481,6 @@ sub get_species_and_object_type {
$dbh
->
quote_identifier
(
undef
,
$dbname
,
'
meta
'
)
);
my
$sth
=
$dbh
->
prepare
(
$statement
);
$sth
->
{'
PrintError
'}
=
0
;
...
...
@@ -2607,21 +2606,34 @@ SECONDLOOP:
$dbc
=
$dba
->
dbc
();
}
my
$dbh
=
$dbc
->
db_handle
();
my
$dbh
=
$dbc
->
db_handle
();
my
$dbname
=
$dbc
->
dbname
();
foreach
my
$type
(
'
Gene
',
'
Transcript
',
'
Translation
',
'
Exon
'
)
{
foreach
my
$type
(
defined
(
$known_type
)
?
$known_type
:
'
Gene
',
'
Transcript
',
'
Translation
',
'
Exon
'
)
{
my
$type_lc
=
lc
(
$type
);
my
$statement
=
sprintf
(
"
SELECT COUNT(1)
"
.
"
FROM %s
"
.
"
WHERE stable_id = ?
",
.
"
FROM %s si
"
.
"
JOIN %s USING (%s)
"
.
"
JOIN seq_region USING (seq_region_id)
"
.
"
JOIN coord_system cs USING (coord_system_id)
"
.
"
WHERE si.stable_id = ?
"
.
"
AND cs.species_id = ?
",
$dbh
->
quote_identifier
(
undef
,
$dbname
,
sprintf
(
"
%s_stable_id
",
lc
(
$type
)
)
)
);
sprintf
(
"
%s_stable_id
",
$type_lc
)
),
$dbh
->
quote_identifier
(
undef
,
$dbname
,
$type_lc
),
$dbh
->
quote_identifier
(
undef
,
$dbname
,
sprintf
(
"
%s_id
",
$type_lc
)
)
);
my
$sth
=
$dbh
->
prepare
(
$statement
);
$sth
->
bind_param
(
1
,
$stable_id
,
SQL_VARCHAR
);
$sth
->
bind_param
(
1
,
$stable_id
,
SQL_VARCHAR
);
$sth
->
bind_param
(
1
,
$dba
->
species_id
(),
SQL_INTEGER
);
$sth
->
execute
();
my
$count
=
$sth
->
fetchall_arrayref
()
->
[
0
][
0
];
...
...
@@ -2632,7 +2644,7 @@ SECONDLOOP:
@match
=
(
$species
,
$type
,
'
Core
'
);
last
SECONDLOOP
;
}
}
}
## end foreach my $type ( defined(...))
}
## end foreach my $dba ( @{ $self->get_all_DBAdaptors...})
}
## end foreach my $species (@nonstandard_prefix_species)
...
...
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