DBEntry.pm 16.5 KB
Newer Older
1
=head1 LICENSE
2

3
Copyright [1999-2013] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
4

5 6 7 8 9 10 11 12 13 14 15 16 17
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut
18

Patrick Meidl's avatar
Patrick Meidl committed
19

20
=head1 CONTACT
21

22
  Please email comments or questions to the public Ensembl
Magali Ruffier's avatar
Magali Ruffier committed
23
  developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.
Graham McVicker's avatar
PODs  
Graham McVicker committed
24

25
  Questions may also be sent to the Ensembl help desk at
Magali Ruffier's avatar
Magali Ruffier committed
26
  <http://www.ensembl.org/Help/Contact>.
27

28
=cut
29

30
=head1 NAME
31

32 33
Bio::EnsEMBL::DBEntry -
Object representing an external reference (xref)
34

35
=head1 DESCRIPTION
36

37 38
This object holds information about external references (xrefs) to
Ensembl objects.
David Barnwell's avatar
David Barnwell committed
39

40
=head1 METHODS
41

Patrick Meidl's avatar
Patrick Meidl committed
42
=cut
43

44 45
package Bio::EnsEMBL::DBEntry;

46
use strict;
Patrick Meidl's avatar
Patrick Meidl committed
47
use warnings;
Patrick Meidl's avatar
Patrick Meidl committed
48
no warnings qw(uninitialized);
49

Patrick Meidl's avatar
Patrick Meidl committed
50 51 52 53 54
use Bio::EnsEMBL::Storable;
use Bio::Annotation::DBLink;

use Bio::EnsEMBL::Utils::Argument qw(rearrange);
use Bio::EnsEMBL::Utils::Exception qw(deprecate);
55

Patrick Meidl's avatar
Patrick Meidl committed
56
our @ISA = qw(Bio::EnsEMBL::Storable Bio::Annotation::DBLink);
57

Graham McVicker's avatar
PODs  
Graham McVicker committed
58 59 60
=head2 new

  Args [...] : list of named parameters 
Patrick Meidl's avatar
Patrick Meidl committed
61 62 63 64 65 66 67 68 69 70 71
  Example    : my $dbentry = new Bio::EnsEMBL::DBEntry(
                    -adaptor => $adaptor,
                    -primary_id => $pid,
                    -version => $version,
                    -dbname  => $dbname,
                    -release => $release,
                    -display_id => $did,
                    -description => $description,
                    -priority => $priority,
                    -db_display_name => $db_display_name,
                    -info_type => $info_type,
Glenn Proctor's avatar
Glenn Proctor committed
72
                    -info_text => $info_text,
73 74
                    -type => $type,
                    -secondary_db_name => $secondary_db_name,
75
                    -secondary_db_table => $secondary_db_table
76
		    -linkage_annotation => $object_xref_text);
Graham McVicker's avatar
PODs  
Graham McVicker committed
77 78 79 80
  Description: Creates a new DBEntry object
  Returntype : Bio::EnsEMBL::DBEntry
  Exceptions : none
  Caller     : Bio::EnsEMBL::DBEntryAdaptor
81
  Status     : At Risk
82
               Due to 'PRIORITY',
83 84
              'INFO_TYPE', 'INFO_TEXT', ''DB_DISPLAY_NAME', 'TYPE',
              'SECONDARY_DB_NAME', 'SECONDARY_DB_TABLE'
Patrick Meidl's avatar
Patrick Meidl committed
85 86
               being under development - if you don't use any of these the
               method can be considered Stable
Graham McVicker's avatar
PODs  
Graham McVicker committed
87 88 89

=cut

90 91
sub new {
  my ($class, @args) = @_;
92
  
93 94
  my $self = bless {},$class;

Arne Stabenau's avatar
Arne Stabenau committed
95
  my ( $adaptor, $dbID, $primary_id, $version,
96
       $dbname, $release, $display_id, $description,
97
       $priority,
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',
102
		 'PRIORITY',
103
		 'DB_DISPLAY_NAME', 'INFO_TYPE', 'INFO_TEXT', 'TYPE',
104
                 'SECONDARY_DB_NAME', 'SECONDARY_DB_TABLE', 'LINKAGE_ANNOTATION', 'ANALYSIS'], @args );
105

Monika Komorowska's avatar
Monika Komorowska committed
106
  $self->adaptor($adaptor);
107 108
  $self->{'dbID'}    = $dbID;

109
  if( defined $primary_id ) { $self->primary_id( $primary_id ) }
Arne Stabenau's avatar
Arne Stabenau committed
110
  if( defined $version ) { $self->version( $version ) } else
111
    { $self->version( 0 ); }
112 113
  if( defined $dbname ) { $self->dbname( $dbname ) }
  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) }
Glenn Proctor's avatar
Glenn Proctor committed
117
  if( defined $db_display_name) { $self->db_display_name($db_display_name) }
118 119
  if( defined $info_type) { $self->info_type($info_type) }
  if( defined $info_text) { $self->info_text($info_text) }
Glenn Proctor's avatar
Glenn Proctor committed
120
  if( defined $type) { $self->type($type) }
121 122
  if( defined $secondary_db_name) { $self->secondary_db_name($secondary_db_name) }
  if( defined $secondary_db_table) { $self->secondary_db_table($secondary_db_table) }
123

124
  $self->linkage_annotation($link_annotation) if defined $link_annotation;
125
  $self->analysis($analysis) if defined $analysis;
126

127 128 129 130 131

  return $self;
}


Arne Stabenau's avatar
Arne Stabenau committed
132 133
=head2 primary_id

Patrick Meidl's avatar
Patrick Meidl committed
134
  Arg [1]    : (optional) String $arg - value to set
Arne Stabenau's avatar
Arne Stabenau committed
135
  Example    : none
Patrick Meidl's avatar
Patrick Meidl committed
136 137 138
  Description: Getter/setter for attribute 'primary_id'.
               This is the object's primary id in the external database.
  Returntype : String
Arne Stabenau's avatar
Arne Stabenau committed
139 140
  Exceptions : none
  Caller     : general
141
  Status     : Stable
Arne Stabenau's avatar
Arne Stabenau committed
142 143 144

=cut

145 146 147
sub primary_id {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
148
    $self->{primary_id} = $arg;
149
  } 
150
  return $self->{primary_id};
151 152
}

153

Arne Stabenau's avatar
Arne Stabenau committed
154
=head2 display_id
155

Patrick Meidl's avatar
Patrick Meidl committed
156
  Arg [1]    : (optional) String $arg - value to set
Arne Stabenau's avatar
Arne Stabenau committed
157
  Example    : none
Patrick Meidl's avatar
Patrick Meidl committed
158 159 160 161
  Description: Getter/setter for attribute 'display_id'.
               The object's preferred display name. This can be the same
               as primary_id or ensembl-specific.
  Returntype : String
Arne Stabenau's avatar
Arne Stabenau committed
162 163
  Exceptions : none
  Caller     : general
164
  Status     : Stable
165 166 167 168 169 170

=cut

sub display_id{
   my ( $self, $arg ) = @_;
   if( defined $arg ) {
171
       $self->{display_id} = $arg;
172
   } 
173
   return $self->{display_id};
174 175 176
}


Patrick Meidl's avatar
Patrick Meidl committed
177
=head2 optional_id
Graham McVicker's avatar
PODs  
Graham McVicker committed
178

Patrick Meidl's avatar
Patrick Meidl committed
179
  Args       : none
Arne Stabenau's avatar
Arne Stabenau committed
180
  Example    : none
Patrick Meidl's avatar
Patrick Meidl committed
181 182 183 184 185
  Description: Additional getter for attribute 'display_id'.
               The object's preferred display name.
               Only include for BioPerl interface compliance, please use
               $self->display_id().
  Returntype : String
Arne Stabenau's avatar
Arne Stabenau committed
186 187
  Exceptions : none
  Caller     : general
188
  Status     : Stable
Arne Stabenau's avatar
Arne Stabenau committed
189 190 191

=cut

Patrick Meidl's avatar
Patrick Meidl committed
192 193 194
sub optional_id {
  my $self = shift;
  return $self->display_id;
195 196 197
}


Patrick Meidl's avatar
Patrick Meidl committed
198
=head2 dbname
Graham McVicker's avatar
PODs  
Graham McVicker committed
199

Patrick Meidl's avatar
Patrick Meidl committed
200
  Arg [1]    : (optional) String $arg - value to set
Arne Stabenau's avatar
Arne Stabenau committed
201
  Example    : none
Patrick Meidl's avatar
Patrick Meidl committed
202 203 204
  Description: Getter/setter for attribute 'dbname'.
               The name of the external database.
  Returntype : String
Arne Stabenau's avatar
Arne Stabenau committed
205 206
  Exceptions : none
  Caller     : general
207
  Status     : Stable
Arne Stabenau's avatar
Arne Stabenau committed
208 209 210

=cut

Patrick Meidl's avatar
Patrick Meidl committed
211 212 213 214 215 216
sub dbname {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
    $self->{dbname} = $arg;
  } 
  return $self->{dbname};
217 218
}

Arne Stabenau's avatar
Arne Stabenau committed
219

Patrick Meidl's avatar
Patrick Meidl committed
220
=head2 database
Arne Stabenau's avatar
Arne Stabenau committed
221 222 223

  Args       : none
  Example    : none
Patrick Meidl's avatar
Patrick Meidl committed
224 225 226 227 228
  Description: Additional getter for attribute 'dbname'.
               The name of the external database.
               Only include for BioPerl interface compliance, please use
               $self->dbname().
  Returntype : String
Arne Stabenau's avatar
Arne Stabenau committed
229 230
  Exceptions : none
  Caller     : general
231
  Status     : Stable
Arne Stabenau's avatar
Arne Stabenau committed
232 233 234

=cut

Patrick Meidl's avatar
Patrick Meidl committed
235
sub database {
236
  my $self = shift;
Patrick Meidl's avatar
Patrick Meidl committed
237
  return $self->dbname();
238 239 240
}


Arne Stabenau's avatar
Arne Stabenau committed
241 242
=head2 release

Patrick Meidl's avatar
Patrick Meidl committed
243
  Arg [1]    : (optional) String $arg - value to set
Arne Stabenau's avatar
Arne Stabenau committed
244
  Example    : none
Patrick Meidl's avatar
Patrick Meidl committed
245 246 247
  Description: Getter/setter for attribute 'release'.
               The external database release name.
  Returntype : String
Arne Stabenau's avatar
Arne Stabenau committed
248 249
  Exceptions : none
  Caller     : general
250
  Status     : Stable
Arne Stabenau's avatar
Arne Stabenau committed
251 252 253

=cut

254 255 256
sub release {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
257
    $self->{release} = $arg;
258
  } 
259
  return $self->{release};
260 261 262
}


Arne Stabenau's avatar
Arne Stabenau committed
263 264
=head2 version

Patrick Meidl's avatar
Patrick Meidl committed
265
  Arg [1]    : (optional) String $arg - value to set
Arne Stabenau's avatar
Arne Stabenau committed
266
  Example    : none
Patrick Meidl's avatar
Patrick Meidl committed
267 268 269
  Description: Getter/setter for attribute 'version'.
               The object's version in the external database.
  Returntype : String
Arne Stabenau's avatar
Arne Stabenau committed
270 271
  Exceptions : none
  Caller     : general
272
  Status     : Stable
Arne Stabenau's avatar
Arne Stabenau committed
273 274 275

=cut

276 277 278
sub version {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
279
    $self->{version} = $arg;
280
  } 
281
  return $self->{version};
282 283 284
}


Arne Stabenau's avatar
Arne Stabenau committed
285 286
=head2 description

Patrick Meidl's avatar
Patrick Meidl committed
287
  Arg [1]    : (optional) String $arg - value to set
Arne Stabenau's avatar
Arne Stabenau committed
288
  Example    : none
Patrick Meidl's avatar
Patrick Meidl committed
289
  Description: Getter/setter for attribute 'description'.
290
               The object's description, from the xref table
Patrick Meidl's avatar
Patrick Meidl committed
291
  Returntype : String
Arne Stabenau's avatar
Arne Stabenau committed
292 293
  Exceptions : none
  Caller     : general
294
  Status     : Stable
Arne Stabenau's avatar
Arne Stabenau committed
295 296 297

=cut

298 299
sub description {
  my ( $self, $arg ) = @_;
300 301 302

  if ( defined($arg) ) { $self->{'description'} = $arg }

303
  return $self->{description};
304 305
}

306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
=head2 analysis

  Arg [1]    : Bio::EnsEMBL::Analysis $analysis
  Example    : none
  Description: get/set for attribute analysis
  Returntype : Bio::EnsEMBL::Analysis
  Exceptions : none
  Caller     : general
  Status     : Stable

=cut

sub analysis {
   my $self = shift;
  $self->{analysis} = shift if( @_ );
  return $self->{analysis};
}
323

Patrick Meidl's avatar
Patrick Meidl committed
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
=head2 comment

  Args       : none
  Example    : none
  Description: Additional getter for attribute 'description'.
               The object's description.
               Only include for BioPerl interface compliance, please use
               $self->description().
  Returntype : String
  Exceptions : none
  Caller     : general
  Status     : Stable

=cut

sub comment {
  my $self = shift;
  return $self->description();
}


345 346 347 348
=head2 priority

  Arg [1]    : int $priority
  Example    : none
349 350
  Priority   : Getter/setter for attribute 'priority'.
               The external database priority.
Patrick Meidl's avatar
Patrick Meidl committed
351
  Returntype : String
352 353
  Exceptions : none
  Caller     : general
354 355
  Status     : At Risk
             : due to it being under development
356 357 358 359 360 361 362 363 364 365 366

=cut

sub priority {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
    $self->{priority} = $arg;
  } 
  return $self->{priority};
}

Glenn Proctor's avatar
Glenn Proctor committed
367 368 369 370 371

=head2 db_display_name

  Arg [1]    : String $db_display_name
  Example    : none
Patrick Meidl's avatar
Patrick Meidl committed
372 373 374 375
  Description: Getter/setter for attribute 'db_display_name'.
               The preferred display name for the external database. Has
               "Projected " prepended if info_type='PROJECTION'.
  Returntype : String
Glenn Proctor's avatar
Glenn Proctor committed
376 377 378 379 380 381 382 383 384
  Exceptions : none
  Caller     : general

=cut

sub db_display_name {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
    $self->{db_display_name} = $arg;
385 386 387
  }

  my $name;
388
  if ($self->{info_type} && $self->{info_type} eq "PROJECTION") {
389 390 391 392 393 394 395 396 397 398 399 400 401
    $name = "Projected " . $self->{db_display_name};
  } else {
    $name =  $self->{db_display_name};
  }

  return $name;
}


=head2 info_type

  Arg [1]    : String $info_type
  Example    : none
Patrick Meidl's avatar
Patrick Meidl committed
402
  Description: Getter/setter for attribute 'info_type'.
403 404 405 406 407
               Defines the method by which the linked object was
               connected to this xref. Available types are:
               'CHECKSUM', 'COORDINATE_OVERLAP', 'DEPENDENT',
               'DIRECT', 'INFERRED_PAIR', 'MISC', 'NONE', 'PROBE',
               'PROJECTION', 'SEQUENCE_MATCH' AND 'UNMAPPED'.
Patrick Meidl's avatar
Patrick Meidl committed
408
  Returntype : String
409 410 411 412 413 414 415 416 417
  Exceptions : none
  Caller     : general

=cut

sub info_type {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
    $self->{info_type} = $arg;
418
  }
419
  return $self->{info_type};
Glenn Proctor's avatar
Glenn Proctor committed
420
 }
421 422 423 424 425 426


=head2 info_text

  Arg [1]    : String $info_text
  Example    : none
Patrick Meidl's avatar
Patrick Meidl committed
427
  Description: Getter/setter for attribute 'info_text'.
428 429
               Additional information recorded during the xref
               association. Intended to be used as metadata.
Patrick Meidl's avatar
Patrick Meidl committed
430
  Returntype : String
431 432 433 434 435 436 437 438 439
  Exceptions : none
  Caller     : general

=cut

sub info_text {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
    $self->{info_text} = $arg;
Glenn Proctor's avatar
Glenn Proctor committed
440
  } 
441
  return $self->{info_text};
Glenn Proctor's avatar
Glenn Proctor committed
442 443
}

444 445 446 447 448
=head2 linkage_annotation

  Arg [1]    : String $object_xref_text
  Example    : none
  Description: Getter/setter for attribute 'linkage_annotation'.
449
               The object xref 'linkage annotation'.
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464
  Returntype : String
  Exceptions : none
  Caller     : general

=cut

sub linkage_annotation {
  my ( $self, $arg ) = @_;

  $self->{linkage_annotation} = $arg if defined $arg;
  
  return $self->{linkage_annotation};
}


Glenn Proctor's avatar
Glenn Proctor committed
465 466 467 468 469
=head2 type

  Arg [1]    : String $type
  Example    : none
  Description: Getter/setter for attribute 'type'.
470
               The external database type.
Glenn Proctor's avatar
Glenn Proctor committed
471 472 473 474 475 476 477 478 479 480 481 482 483 484
  Returntype : String
  Exceptions : none
  Caller     : general

=cut

sub type {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
    $self->{type} = $arg;
  }
  return $self->{type};
}

485 486 487 488
=head2 secondary_db_name

  Arg [1]    : String $secondary_db_name
  Description: Getter/setter for attribute 'secondary_db_name'.
489
               The external database 'secondary' database name.
Kieron Taylor's avatar
Kieron Taylor committed
490
  Returntype : String
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508
  Exceptions : none
  Caller     : general

=cut

sub secondary_db_name {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
    $self->{secondary_db_name} = $arg;
  }
  return $self->{secondary_db_name};
}


=head2 secondary_db_table

  Arg [1]    : String $secondary_db_table
  Description: Getter/setter for attribute 'secondary_db_table'.
509
               The external database 'secondary' database table.
Kieron Taylor's avatar
Kieron Taylor committed
510
  Returns    : String
511 512 513 514 515 516 517 518 519 520 521 522 523
  Exceptions : none
  Caller     : general

=cut

sub secondary_db_table {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
    $self->{secondary_db_table} = $arg;
  }
  return $self->{secondary_db_table};
}

524

Arne Stabenau's avatar
Arne Stabenau committed
525 526
=head2 add_synonym

Patrick Meidl's avatar
Patrick Meidl committed
527 528
  Arg [1]    : String $arg - synonym to add
  Description: Add a synonym for the external object.
Arne Stabenau's avatar
Arne Stabenau committed
529 530 531
  Returntype : none
  Exceptions : none
  Caller     : general
532
  Status     : Stable
Arne Stabenau's avatar
Arne Stabenau committed
533 534 535

=cut

536 537 538
sub add_synonym {
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
539
    push( @{$self->{synonyms}}, $arg );
540 541 542
  }
}

Arne Stabenau's avatar
Arne Stabenau committed
543

Graham McVicker's avatar
Graham McVicker committed
544
=head2 get_all_synonyms
Arne Stabenau's avatar
Arne Stabenau committed
545

546
  Args      : none
Patrick Meidl's avatar
Patrick Meidl committed
547 548
  Example    : my @synonyms = @{ $db_entry->get_all_synonyms };
  Description: Get a list of synonyms known for this object.
549 550
               Synonyms are lazy-loaded if required.
  Returntype : listref of strings. May be empty.
Arne Stabenau's avatar
Arne Stabenau committed
551 552
  Exceptions : none
  Caller     : general
553
  Status     : Stable
Arne Stabenau's avatar
Arne Stabenau committed
554 555 556

=cut

Graham McVicker's avatar
Graham McVicker committed
557
sub get_all_synonyms {
558

559
  my $self = shift;
560 561

  # lazy-load synonyms if required
Monika Komorowska's avatar
Monika Komorowska committed
562 563
  if (!$self->{synonyms} && $self->adaptor()) {
    $self->{synonyms} = $self->adaptor()->fetch_all_synonyms($self->dbID());
564 565
  }

566
  return $self->{synonyms};
567 568
}

Arne Stabenau's avatar
Arne Stabenau committed
569

570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587
=head2 get_all_dependents

  Args[1]    : (optional) Bio::EnsEMBL::Gene, Transcript or Translation object
  Example    : my @dependents = @{ $db_entry->get_all_dependents };
  Description: Get a list of DBEntrys that are depenednet on the DBEntry.
               if an ensembl gene transcript or translation is given then only
               the ones on that object will be given
  Returntype : listref of DBEntrys. May be empty.
  Exceptions : none
  Caller     : general
  Status     : UnStable

=cut

sub get_all_dependents {
  my $self = shift;
  my $ensembl_object = shift;

Monika Komorowska's avatar
Monika Komorowska committed
588
  return  $self->adaptor()->get_all_dependents($self->dbID(), $ensembl_object);
589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608
}

=head2 get_all_masters

  Args[1]    : (optional) Bio::EnsEMBL::Gene, Transcript or Translation object
  Example    : my @masters = @{ $db_entry->get_all_masters };
  Description: Get a list of DBEntrys that are the masters of the DBEntry.
               if an ensembl gene transcript or translation is given then only
               the ones on that object will be given.
  Returntype : listref of DBEntrys. May be empty.
  Exceptions : none
  Caller     : general
  Status     : UnStable

=cut

sub get_all_masters {
  my $self = shift;
  my $ensembl_object = shift;

Monika Komorowska's avatar
Monika Komorowska committed
609
  return  $self->adaptor()->get_all_masters($self->dbID(), $ensembl_object);
610 611 612
}


Arne Stabenau's avatar
Arne Stabenau committed
613 614 615
=head2 flush_synonyms

  Args       : none
Patrick Meidl's avatar
Patrick Meidl committed
616
  Description: Remove all synonyms from this object.
Arne Stabenau's avatar
Arne Stabenau committed
617 618 619
  Returntype : none
  Exceptions : none
  Caller     : general
620
  Status     : Stable
Arne Stabenau's avatar
Arne Stabenau committed
621 622 623

=cut

624 625
sub flush_synonyms {
  my $self = shift;
626
  $self->{synonyms} = [];
627 628
}

Arne Stabenau's avatar
Arne Stabenau committed
629

630 631
=head2 status

Patrick Meidl's avatar
Patrick Meidl committed
632 633
  Arg [1]    : (optional) String $arg - value to set
  Description: Getter/setter for attribute 'status'.
634
               The external database status.
Patrick Meidl's avatar
Patrick Meidl committed
635
  Returntype : String
Arne Stabenau's avatar
Arne Stabenau committed
636 637
  Exceptions : none
  Caller     : general
638
  Status     : Stable
639 640 641 642

=cut

sub status{
Patrick Meidl's avatar
Patrick Meidl committed
643 644 645 646 647
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
     $self->{status} = $arg;
  } 
  return $self->{status};
648 649
}

650 651 652 653
=head2 ensembl_object_type

  Arg [1]    : (optional) String $arg - value to set
  Description: Getter/setter for attribute ensembl_object_type.
654 655 656
               The object xref ensembl object type, one of 'Gene',
               'Marker', 'Operon', 'OperonTranscript', 'RawContig',
               'Transcript' or 'Translation'.
657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675
  Returntype : String
  Exceptions : none
  Caller     : general
  Status     : Stable

=cut

sub ensembl_object_type{
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
     $self->{ensembl_object_type} = $arg;
  } 
  return $self->{ensembl_object_type};
}

=head2 ensembl_id

  Arg [1]    : (optional) String $arg - value to set
  Description: Getter/setter for attribute ensembl_id.
676 677 678 679
               The ensembl_id is the internal identifier of the object
               linked via object_xref. This should be used in
               conjunction with ensembl_object_type to identify the
               correct object type.
680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696
  Returntype : String
  Exceptions : none
  Caller     : general
  Status     : Stable

=cut

sub ensembl_id{
  my ( $self, $arg ) = @_;
  if( defined $arg ) {
     $self->{ensembl_id} = $arg;
  } 
  return $self->{ensembl_id};
}



Graham McVicker's avatar
Graham McVicker committed
697 698 699
=head1 DEPRECATED METHODS

=cut
Graham McVicker's avatar
Graham McVicker committed
700 701 702

=head2 get_synonyms

Kieron Taylor's avatar
Kieron Taylor committed
703
  DEPRECATED use get_all_synonyms instead
Graham McVicker's avatar
Graham McVicker committed
704 705 706 707 708 709

=cut

sub get_synonyms {
  my $self = shift;

710
  deprecate("get_synonyms has been renamed get_all_synonyms.");
Graham McVicker's avatar
Graham McVicker committed
711 712 713
  return $self->get_all_synonyms;
}

714
1;
Patrick Meidl's avatar
Patrick Meidl committed
715