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
34 Object representing an external reference (xref)
38 This
object holds information
about external references (xrefs) to
45 package Bio::EnsEMBL::DBEntry;
49 no warnings qw(uninitialized);
52 use Bio::Annotation::DBLink;
60 Args [...] : list of named parameters
68 -description => $description,
69 -priority => $priority,
70 -db_display_name => $db_display_name,
71 -info_type => $info_type,
72 -info_text => $info_text,
74 -secondary_db_name => $secondary_db_name,
75 -secondary_db_table => $secondary_db_table
76 -linkage_annotation => $object_xref_text);
77 Description: Creates a
new DBEntry object
80 Caller : Bio::EnsEMBL::DBEntryAdaptor
83 'INFO_TYPE',
'INFO_TEXT',
''DB_DISPLAY_NAME
', 'TYPE
',
84 'SECONDARY_DB_NAME
', 'SECONDARY_DB_TABLE
'
85 being under development - if you don't use any of these the
86 method can be considered Stable
91 my ($class, @args) = @_;
93 my $self = bless {},$class;
95 my ( $adaptor, $dbID, $primary_id, $version,
96 $dbname, $release, $display_id, $description,
98 $db_display_name, $info_type, $info_text, $type,
99 $secondary_db_name, $secondary_db_table, $link_annotation, $analysis) =
100 rearrange ( [
'ADAPTOR',
'DBID',
'PRIMARY_ID',
'VERSION',
101 'DBNAME',
'RELEASE',
'DISPLAY_ID',
'DESCRIPTION',
103 'DB_DISPLAY_NAME',
'INFO_TYPE',
'INFO_TEXT',
'TYPE',
104 'SECONDARY_DB_NAME',
'SECONDARY_DB_TABLE',
'LINKAGE_ANNOTATION',
'ANALYSIS'], @args );
106 $self->adaptor($adaptor);
107 $self->{
'dbID'} = $dbID;
109 if( defined $primary_id ) { $self->primary_id( $primary_id ) }
110 if( defined $version ) { $self->version( $version ) }
else
111 { $self->version( 0 ); }
112 if( defined $dbname ) { $self->dbname( $dbname ) }
113 if( defined $release) { $self->release( $release ) }
114 if( defined $display_id) { $self->display_id( $display_id ) }
115 if( defined $description) { $self->description($description) }
116 if( defined $priority) { $self->priority($priority) }
117 if( defined $db_display_name) { $self->db_display_name($db_display_name) }
118 if( defined $info_type) { $self->info_type($info_type) }
119 if( defined $info_text) { $self->info_text($info_text) }
120 if( defined $type) { $self->type($type) }
121 if( defined $secondary_db_name) { $self->secondary_db_name($secondary_db_name) }
122 if( defined $secondary_db_table) { $self->secondary_db_table($secondary_db_table) }
124 $self->linkage_annotation($link_annotation)
if defined $link_annotation;
125 $self->analysis($analysis)
if defined $analysis;
134 Arg [1] : (optional) String $arg - value to set
136 Description: Getter/setter
for attribute
'primary_id'.
137 This is the
object's primary id in the external database.
146 my ( $self, $arg ) = @_;
148 $self->{primary_id} = $arg;
150 return $self->{primary_id};
156 Arg [1] : (optional) String $arg - value to set
158 Description: Getter/setter for attribute 'display_id
'.
159 The object's preferred display name. This can be the same
160 as primary_id or ensembl-specific.
169 my ( $self, $arg ) = @_;
171 $self->{display_id} = $arg;
173 return $self->{display_id};
181 Description: Additional getter
for attribute
'display_id'.
182 The
object's preferred display name.
183 Only include for BioPerl interface compliance, please use
194 return $self->display_id;
200 Arg [1] : (optional) String $arg - value to set
202 Description: Getter/setter for attribute 'dbname
'.
203 The name of the external database.
212 my ( $self, $arg ) = @_;
214 $self->{dbname} = $arg;
216 return $self->{dbname};
224 Description: Additional getter for attribute 'dbname
'.
225 The name of the external database.
226 Only include for BioPerl interface compliance, please use
237 return $self->dbname();
243 Arg [1] : (optional) String $arg - value to set
245 Description: Getter/setter for attribute 'release
'.
246 The external database release name.
255 my ( $self, $arg ) = @_;
257 $self->{release} = $arg;
259 return $self->{release};
265 Arg [1] : (optional) String $arg - value to set
267 Description: Getter/setter for attribute 'version
'.
268 The object's version in the external database.
277 my ( $self, $arg ) = @_;
279 $self->{version} = $arg;
281 return $self->{version};
286 Arg [1] : (optional) String $arg - value to set
288 Description: Alias
for release(). The release/version of the external DB
297 my ( $self, $arg ) = @_;
298 return $self->release($arg);
305 Arg [1] : (optional) String $arg - value to set
307 Description: Getter/setter
for attribute
'description'.
308 The
object's description, from the xref table
317 my ( $self, $arg ) = @_;
319 if ( defined($arg) ) { $self->{'description
'} = $arg }
321 return $self->{description};
326 Arg [1] : Bio::EnsEMBL::Analysis $analysis
328 Description: get/set for attribute analysis
329 Returntype : Bio::EnsEMBL::Analysis
338 $self->{analysis} = shift if( @_ );
339 return $self->{analysis};
346 Description: Additional getter for attribute 'description
'.
347 The object's description.
348 Only include
for BioPerl interface compliance, please use
349 $self->description().
359 return $self->description();
365 Arg [1] :
int $priority
367 Priority : Getter/setter
for attribute
'priority'.
368 The external database priority.
373 : due to it being under development
378 my ( $self, $arg ) = @_;
380 $self->{priority} = $arg;
382 return $self->{priority};
386 =head2 db_display_name
388 Arg [1] : String $db_display_name
390 Description: Getter/setter
for attribute
'db_display_name'.
391 The preferred display name
for the external database. Has
392 "Projected " prepended
if info_type=
'PROJECTION'.
399 sub db_display_name {
400 my ( $self, $arg ) = @_;
402 $self->{db_display_name} = $arg;
406 if ($self->{info_type} && $self->{info_type} eq
"PROJECTION") {
407 $name =
"Projected " . $self->{db_display_name};
409 $name = $self->{db_display_name};
418 Arg [1] : String $info_type
420 Description: Getter/setter
for attribute
'info_type'.
421 Defines the method by which the linked
object was
422 connected to
this xref. Available types are:
423 'CHECKSUM',
'COORDINATE_OVERLAP',
'DEPENDENT',
424 'DIRECT',
'INFERRED_PAIR',
'MISC',
'NONE',
'PROBE',
425 'PROJECTION',
'SEQUENCE_MATCH' AND
'UNMAPPED'.
433 my ( $self, $arg ) = @_;
435 $self->{info_type} = $arg;
437 return $self->{info_type};
443 Arg [1] : String $info_text
445 Description: Getter/setter
for attribute
'info_text'.
446 Additional information recorded during the xref
447 association. Intended to be used as metadata.
455 my ( $self, $arg ) = @_;
457 $self->{info_text} = $arg;
459 return $self->{info_text};
462 =head2 linkage_annotation
464 Arg [1] : String $object_xref_text
466 Description: Getter/setter
for attribute
'linkage_annotation'.
467 The
object xref
'linkage annotation'.
474 sub linkage_annotation {
475 my ( $self, $arg ) = @_;
477 $self->{linkage_annotation} = $arg
if defined $arg;
479 return $self->{linkage_annotation};
485 Arg [1] : String $type
487 Description: Getter/setter
for attribute
'type'.
488 The external database type.
496 my ( $self, $arg ) = @_;
498 $self->{type} = $arg;
500 return $self->{type};
503 =head2 secondary_db_name
505 Arg [1] : String $secondary_db_name
506 Description: Getter/setter
for attribute
'secondary_db_name'.
507 The external database
'secondary' database name.
514 sub secondary_db_name {
515 my ( $self, $arg ) = @_;
517 $self->{secondary_db_name} = $arg;
519 return $self->{secondary_db_name};
523 =head2 secondary_db_table
525 Arg [1] : String $secondary_db_table
526 Description: Getter/setter
for attribute
'secondary_db_table'.
527 The external database
'secondary' database table.
534 sub secondary_db_table {
535 my ( $self, $arg ) = @_;
537 $self->{secondary_db_table} = $arg;
539 return $self->{secondary_db_table};
545 Arg [1] : String $arg - synonym to add
546 Description: Add a synonym
for the external
object.
555 my ( $self, $arg ) = @_;
557 push( @{$self->{synonyms}}, $arg );
562 =head2 get_all_synonyms
565 Example : my @synonyms = @{ $db_entry->get_all_synonyms };
566 Description: Get a list of synonyms known
for this object.
567 Synonyms are lazy-loaded
if required.
568 Returntype : listref of strings. May be empty.
575 sub get_all_synonyms {
579 # lazy-load synonyms if required
580 if (!$self->{synonyms} && $self->adaptor()) {
581 $self->{synonyms} = $self->adaptor()->fetch_all_synonyms($self->dbID());
584 return $self->{synonyms};
588 =head2 get_all_dependents
591 Example : my @dependents = @{ $db_entry->get_all_dependents };
592 Description: Get a list of DBEntrys that are depenednet on the DBEntry.
593 if an ensembl gene
transcript or translation is given then only
594 the ones on that
object will be given
595 Returntype : listref of DBEntrys. May be empty.
602 sub get_all_dependents {
604 my $ensembl_object = shift;
606 return $self->adaptor()->get_all_dependents($self->dbID(), $ensembl_object);
609 =head2 get_all_masters
612 Example : my @masters = @{ $db_entry->get_all_masters };
613 Description: Get a list of DBEntrys that are the masters of the DBEntry.
614 if an ensembl gene
transcript or translation is given then only
615 the ones on that
object will be given.
616 Returntype : listref of DBEntrys. May be empty.
623 sub get_all_masters {
625 my $ensembl_object = shift;
627 return $self->adaptor()->get_all_masters($self->dbID(), $ensembl_object);
631 =head2 flush_synonyms
634 Description: Remove all synonyms from
this object.
644 $self->{synonyms} = [];
650 Arg [1] : (optional) String $arg - value to set
651 Description: Getter/setter
for attribute
'status'.
652 The external database status.
661 my ( $self, $arg ) = @_;
663 $self->{status} = $arg;
665 return $self->{status};