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
57bfe61a
Commit
57bfe61a
authored
8 years ago
by
Magali Ruffier
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
https://github.com/Ensembl/ensembl
parents
16191d64
b1a8772c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Bio/EnsEMBL/DBSQL/SeqRegionSynonymAdaptor.pm
+31
-23
31 additions, 23 deletions
modules/Bio/EnsEMBL/DBSQL/SeqRegionSynonymAdaptor.pm
modules/t/slice.t
+4
-0
4 additions, 0 deletions
modules/t/slice.t
with
35 additions
and
23 deletions
modules/Bio/EnsEMBL/DBSQL/SeqRegionSynonymAdaptor.pm
+
31
−
23
View file @
57bfe61a
...
...
@@ -40,29 +40,10 @@ use Bio::EnsEMBL::SeqRegionSynonym;
@ISA
=
('
Bio::EnsEMBL::DBSQL::BaseAdaptor
');
sub
get_synonyms
{
my
$self
=
shift
;
my
$seq_id
=
shift
;
my
@results
;
my
$sth
=
$self
->
prepare
("
select seq_region_synonym_id, synonym, external_db_id from seq_region_synonym where seq_region_id = ?
");
$sth
->
bind_param
(
1
,
$seq_id
,
SQL_INTEGER
);
$sth
->
execute
();
my
$dbid
;
my
$alt_name
;
my
$ex_db
;
$sth
->
bind_columns
(
\
$dbid
,
\
$alt_name
,
\
$ex_db
);
while
(
$sth
->
fetch
()){
push
@results
,
Bio::EnsEMBL::
SeqRegionSynonym
->
new
(
-
adaptor
=>
$self
,
-
synonym
=>
$alt_name
,
-
dbID
=>
$dbid
,
-
external_db_id
=>
$ex_db
,
-
seq_region_id
=>
$seq_id
);
}
$sth
->
finish
;
return
\
@results
;
sub
get_synonyms
{
my
(
$self
,
$seq_id
)
=
@_
;
$self
->
bind_param_generic_fetch
(
$seq_id
,
SQL_INTEGER
);
return
$self
->
generic_fetch
(
qq{srs.seq_region_id = ?}
);
}
sub
store
{
...
...
@@ -85,6 +66,33 @@ sub store {
$sth
->
finish
;
}
sub
_tables
{
return
(['
seq_region_synonym
',
'
srs
']);
}
sub
_columns
{
return
qw(srs.seq_region_synonym_id srs.seq_region_id srs.synonym srs.external_db_id)
;
}
sub
_objs_from_sth
{
my
(
$self
,
$sth
)
=
@_
;
my
@results
;
my
(
$seq_id
,
$dbid
,
$alt_name
,
$ex_db
);
$sth
->
bind_columns
(
\
$dbid
,
\
$seq_id
,
\
$alt_name
,
\
$ex_db
);
push
@results
,
Bio::EnsEMBL::
SeqRegionSynonym
->
new
(
-
adaptor
=>
$self
,
-
synonym
=>
$alt_name
,
-
dbID
=>
$dbid
,
-
external_db_id
=>
$ex_db
,
-
seq_region_id
=>
$seq_id
)
while
$sth
->
fetch
();
$sth
->
finish
;
return
\
@results
;
}
1
;
This diff is collapsed.
Click to expand it.
modules/t/slice.t
+
4
−
0
View file @
57bfe61a
...
...
@@ -508,6 +508,10 @@ $multi->restore();
is
(
$syn
->
name
(),
'
anoth_20
',
'
We have the right synonym
');
}
# test fetch_all on synonym adaptor
my
$all_synonyms
=
$syn_adap
->
fetch_all
();
is
(
@$all_synonyms
,
3
,
'
fetch_all on synonym adaptor
');
#Test assembly exception type on HAP
my
$hap_slice
=
$slice_adaptor
->
fetch_by_region
(
undef
,
'
20_HAP1
');
...
...
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