3 See the NOTICE file distributed with
this work
for additional information
4 regarding copyright ownership.
6 Licensed under the Apache License, Version 2.0 (the
"License");
7 you may not use
this file except in compliance with the License.
8 You may obtain a copy of the License at
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an
"AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License
for the specific language governing permissions and
16 limitations under the License.
23 Please email comments or questions to the
public Ensembl
24 developers list at <http:
26 Questions may also be sent to the Ensembl help desk at
31 package Bio::EnsEMBL::DBSQL::SeqRegionSynonymAdaptor;
40 @ISA = (
'Bio::EnsEMBL::DBSQL::BaseAdaptor');
44 my ($self, $seq_id) = @_;
45 $self->bind_param_generic_fetch($seq_id, SQL_INTEGER);
46 return $self->generic_fetch(qq{srs.seq_region_id = ?});
53 return if($syn->is_stored($self->db));
55 if(!defined($syn->seq_region_id)){
56 throw(
"seq_region_id is needed to store a seq_region_synoym");
59 my $insert_ignore = $self->insert_ignore_clause();
60 my $sth = $self->prepare(
"${insert_ignore} INTO seq_region_synonym (seq_region_id, synonym, external_db_id) VALUES (?, ?, ?)");
61 $sth->bind_param(1, $syn->seq_region_id, SQL_INTEGER);
62 $sth->bind_param(2, $syn->name , SQL_VARCHAR);
63 $sth->bind_param(3, $syn->external_db_id, SQL_INTEGER);
65 $syn->{
'dbID'} = $self->last_insert_id(
'seq_region_synonym_id', undef,
'seq_region_synonym');
70 return ([
'seq_region_synonym',
'srs'], [
'external_db',
'exdb']);
74 return qw(srs.seq_region_synonym_id srs.seq_region_id srs.synonym srs.external_db_id exdb.db_name exdb.db_display_name);
78 return ([
'external_db',
"exdb.external_db_id = srs.external_db_id"]);
82 my ($self, $sth) = @_;
85 my ($seq_id, $dbid, $alt_name, $ex_db, $dbname, $db_display_name);
86 $sth->bind_columns(\$dbid, \$seq_id, \$alt_name, \$ex_db, \$dbname, \$db_display_name);
90 -synonym => $alt_name,
92 -external_db_id => $ex_db,
93 -seq_region_id => $seq_id,
95 -db_display_name => $db_display_name,
96 )
while $sth->fetch();
104 return ' ORDER BY srs.seq_region_synonym_id'