Archive Ensembl HomeArchive Ensembl Home
SeqRegionSynonym.pm
Go to the documentation of this file.
00001 =head1 LICENSE
00002 
00003   Copyright (c) 1999-2012 The European Bioinformatics Institute and
00004   Genome Research Limited.  All rights reserved.
00005 
00006   This software is distributed under a modified Apache license.
00007   For license details, please see
00008 
00009     http://www.ensembl.org/info/about/code_licence.html
00010 
00011 =head1 CONTACT
00012 
00013   Please email comments or questions to the public Ensembl
00014   developers list at <dev@ensembl.org>.
00015 
00016   Questions may also be sent to the Ensembl help desk at
00017   <helpdesk@ensembl.org>.
00018 
00019 =cut
00020 
00021 =head1 NAME
00022 
00023 Bio::EnsEMBL::SeqRegionSynonym -
00024 Object representing an alternatice name.
00025 
00026 =head1 SYNOPSIS
00027 
00028 =head1 DESCRIPTION
00029 
00030 This object holds information about alternative name to
00031 Ensembl seq regions.
00032 
00033 =head1 METHODS
00034 
00035 =cut
00036 
00037 package Bio::EnsEMBL::SeqRegionSynonym;
00038 
00039 use strict;
00040 use warnings;
00041 no warnings qw(uninitialized);
00042 
00043 use Bio::EnsEMBL::Storable;
00044 use Bio::Annotation::DBLink;
00045 
00046 use Bio::EnsEMBL::Utils::Argument qw(rearrange);
00047 use Bio::EnsEMBL::Utils::Exception qw(deprecate);
00048 
00049 our @ISA = qw(Bio::EnsEMBL::Storable);
00050 
00051 =head2 new
00052 
00053   Args [...] : list of named parameters 
00054   Example    : my $srs = new Bio::EnsEMBL::SeqRegionSynonym(
00055                     -adaptor => $adaptor,
00056                     -synonym => $alt_name,
00057                     -external_db_id => 1234
00058                     -seq_region_id  => 12);
00059   Description: Creates a new SeqRegionSynonym object
00060   Returntype : Bio::EnsEMBL::SeqRegionSynonym
00061   Exceptions : none
00062   Caller     : Bio::EnsEMBL::SeqRegionSynonymAdaptor
00063   Status     : At Risk
00064 =cut
00065 
00066 sub new {
00067   my ($class, @args) = @_;
00068   
00069   my $self = bless {},$class;
00070 
00071   my ( $adaptor, $synonym, $ex_db, $seq_region_id, $dbid) =
00072     rearrange ( ['ADAPTOR','SYNONYM','EXTERNAL_DB_ID','SEQ_REGION_ID','DBID'], @args );
00073 
00074   $self->adaptor($adaptor);
00075 
00076   if( defined $ex_db ) { $self->external_db_id( $ex_db ) }
00077   if( defined $seq_region_id ) { $self->seq_region_id( $seq_region_id ) }
00078   if (defined $dbid) { $self->{'dbID'} = $dbid}
00079 
00080   if( defined $synonym ) { 
00081     $self->name( $synonym ) ;
00082   } else {
00083     warn "No alternative name given\n";
00084     return undef;
00085   }
00086 
00087   return $self;
00088 }
00089 
00090 sub name{
00091  my $self = shift;
00092   $self->{'name'} = shift if(@_);
00093   return $self->{'name'};
00094 }
00095 
00096 sub external_db_id{
00097  my $self = shift;
00098   $self->{'ex_db'} = shift if(@_);
00099   return $self->{'ex_db'};
00100 }
00101 
00102 sub seq_region_id{
00103   my $self = shift;
00104   $self->{'seq_region_id'} = shift if(@_);
00105   return $self->{'seq_region_id'};
00106 }
00107 
00108 1;