comparison variant_effect_predictor/Bio/EnsEMBL/SeqRegionSynonym.pm @ 0:1f6dce3d34e0

Uploaded
author mahtabm
date Thu, 11 Apr 2013 02:01:53 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1f6dce3d34e0
1 =head1 LICENSE
2
3 Copyright (c) 1999-2012 The European Bioinformatics Institute and
4 Genome Research Limited. All rights reserved.
5
6 This software is distributed under a modified Apache license.
7 For license details, please see
8
9 http://www.ensembl.org/info/about/code_licence.html
10
11 =head1 CONTACT
12
13 Please email comments or questions to the public Ensembl
14 developers list at <dev@ensembl.org>.
15
16 Questions may also be sent to the Ensembl help desk at
17 <helpdesk@ensembl.org>.
18
19 =cut
20
21 =head1 NAME
22
23 Bio::EnsEMBL::SeqRegionSynonym -
24 Object representing an alternatice name.
25
26 =head1 SYNOPSIS
27
28 =head1 DESCRIPTION
29
30 This object holds information about alternative name to
31 Ensembl seq regions.
32
33 =head1 METHODS
34
35 =cut
36
37 package Bio::EnsEMBL::SeqRegionSynonym;
38
39 use strict;
40 use warnings;
41 no warnings qw(uninitialized);
42
43 use Bio::EnsEMBL::Storable;
44 use Bio::Annotation::DBLink;
45
46 use Bio::EnsEMBL::Utils::Argument qw(rearrange);
47 use Bio::EnsEMBL::Utils::Exception qw(deprecate);
48
49 our @ISA = qw(Bio::EnsEMBL::Storable);
50
51 =head2 new
52
53 Args [...] : list of named parameters
54 Example : my $srs = new Bio::EnsEMBL::SeqRegionSynonym(
55 -adaptor => $adaptor,
56 -synonym => $alt_name,
57 -external_db_id => 1234
58 -seq_region_id => 12);
59 Description: Creates a new SeqRegionSynonym object
60 Returntype : Bio::EnsEMBL::SeqRegionSynonym
61 Exceptions : none
62 Caller : Bio::EnsEMBL::SeqRegionSynonymAdaptor
63 Status : At Risk
64 =cut
65
66 sub new {
67 my ($class, @args) = @_;
68
69 my $self = bless {},$class;
70
71 my ( $adaptor, $synonym, $ex_db, $seq_region_id, $dbid) =
72 rearrange ( ['ADAPTOR','SYNONYM','EXTERNAL_DB_ID','SEQ_REGION_ID','DBID'], @args );
73
74 $self->adaptor($adaptor);
75
76 if( defined $ex_db ) { $self->external_db_id( $ex_db ) }
77 if( defined $seq_region_id ) { $self->seq_region_id( $seq_region_id ) }
78 if (defined $dbid) { $self->{'dbID'} = $dbid}
79
80 if( defined $synonym ) {
81 $self->name( $synonym ) ;
82 } else {
83 warn "No alternative name given\n";
84 return undef;
85 }
86
87 return $self;
88 }
89
90 sub name{
91 my $self = shift;
92 $self->{'name'} = shift if(@_);
93 return $self->{'name'};
94 }
95
96 sub external_db_id{
97 my $self = shift;
98 $self->{'ex_db'} = shift if(@_);
99 return $self->{'ex_db'};
100 }
101
102 sub seq_region_id{
103 my $self = shift;
104 $self->{'seq_region_id'} = shift if(@_);
105 return $self->{'seq_region_id'};
106 }
107
108 1;