« EnsEMBL/IdMapping/InternalIdMapper/EnsemblTranscriptGeneric.pm
↑ Summary
EnsEMBL/DBSQL/OntologyTermAdaptor.pm »
| 1 | =head1 LICENSE | ||
| 2 | |||
| 3 | See the NOTICE file distributed with this work for additional information | ||
| 4 | regarding copyright ownership. | ||
| 5 | |||
| 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 | ||
| 9 | |||
| 10 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 11 | |||
| 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. | ||
| 17 | |||
| 18 | =cut | ||
| 19 | |||
| 20 | |||
| 21 | =head1 CONTACT | ||
| 22 | |||
| 23 | Please email comments or questions to the public Ensembl | ||
| 24 | developers list at <http://lists.ensembl.org/mailman/listinfo/dev>. | ||
| 25 | |||
| 26 | Questions may also be sent to the Ensembl help desk at | ||
| 27 | <http://www.ensembl.org/Help/Contact>. | ||
| 28 | |||
| 29 | =cut | ||
| 30 | |||
| 31 | =head1 NAME | ||
| 32 | |||
| 33 | Bio::EnsEMBL::SeqRegionSynonym - | ||
| 34 | Object representing an alternatice name. | ||
| 35 | |||
| 36 | =head1 SYNOPSIS | ||
| 37 | |||
| 38 | =head1 DESCRIPTION | ||
| 39 | |||
| 40 | This object holds information about alternative name to | ||
| 41 | Ensembl seq regions. | ||
| 42 | |||
| 43 | =head1 METHODS | ||
| 44 | |||
| 45 | =cut | ||
| 46 | |||
| 47 | package Bio::EnsEMBL::SeqRegionSynonym; | ||
| 48 | $Bio::EnsEMBL::SeqRegionSynonym::VERSION = '114.0.0_50'; # TRIAL | ||
| 49 | $Bio::EnsEMBL::SeqRegionSynonym::VERSION = '114.0.050'; | ||
| 50 | use strict; | ||
| 51 | use warnings; | ||
| 52 | no warnings qw(uninitialized); | ||
| 53 | |||
| 54 | use Bio::EnsEMBL::Storable; | ||
| 55 | use Bio::Annotation::DBLink; | ||
| 56 | |||
| 57 | use Bio::EnsEMBL::Utils::Argument qw(rearrange); | ||
| 58 | |||
| 59 | our @ISA = qw(Bio::EnsEMBL::Storable); | ||
| 60 | |||
| 61 | =head2 new | ||
| 62 | |||
| 63 | Args [...] : list of named parameters | ||
| 64 | Example : my $srs = new Bio::EnsEMBL::SeqRegionSynonym( | ||
| 65 | -adaptor => $adaptor, | ||
| 66 | -synonym => $alt_name, | ||
| 67 | -external_db_id => 1234 | ||
| 68 | -seq_region_id => 12); | ||
| 69 | Description: Creates a new SeqRegionSynonym object | ||
| 70 | Returntype : Bio::EnsEMBL::SeqRegionSynonym | ||
| 71 | Exceptions : none | ||
| 72 | Caller : Bio::EnsEMBL::SeqRegionSynonymAdaptor | ||
| 73 | Status : At Risk | ||
| 74 | =cut | ||
| 75 | |||
| 76 | sub new { | ||
| 77 | my ($class, @args) = @_; | ||
| 78 | |||
| 79 | my $self = bless {},$class; | ||
| 80 | |||
| 81 | my ( $adaptor, $synonym, $ex_db, $seq_region_id, $dbid, $dbname, $db_display_name) = | ||
| 82 | rearrange ( ['ADAPTOR','SYNONYM','EXTERNAL_DB_ID','SEQ_REGION_ID','DBID', 'DBNAME', 'DB_DISPLAY_NAME'], @args ); | ||
| 83 | |||
| 84 | $self->adaptor($adaptor); | ||
| 85 | |||
| 86 | if( defined $ex_db ) { $self->external_db_id( $ex_db ) } ; | ||
| 87 | if( defined $seq_region_id ) { $self->seq_region_id( $seq_region_id ) } ; | ||
| 88 | if (defined $dbid) { $self->{'dbID'} = $dbid} ; | ||
| 89 | if (defined $dbname) { $self->{'dbname'} = $dbname }; | ||
| 90 | if (defined $db_display_name) { $self->{'db_display_name'} = $db_display_name }; | ||
| 91 | |||
| 92 | if( defined $synonym ) { | ||
| 93 | $self->name( $synonym ) ; | ||
| 94 | } else { | ||
| 95 | warn "No alternative name given\n"; | ||
| 96 | return undef; | ||
| 97 | } | ||
| 98 | |||
| 99 | return $self; | ||
| 100 | } | ||
| 101 | |||
| 102 | sub name{ | ||
| 103 | my $self = shift; | ||
| 104 | $self->{'name'} = shift if(@_); | ||
| 105 | return $self->{'name'}; | ||
| 106 | } | ||
| 107 | |||
| 108 | sub external_db_id{ | ||
| 109 | my $self = shift; | ||
| 110 | $self->{'ex_db'} = shift if(@_); | ||
| 111 | return $self->{'ex_db'}; | ||
| 112 | } | ||
| 113 | |||
| 114 | sub seq_region_id{ | ||
| 115 | my $self = shift; | ||
| 116 | $self->{'seq_region_id'} = shift if(@_); | ||
| 117 | return $self->{'seq_region_id'}; | ||
| 118 | } | ||
| 119 | |||
| 120 | sub dbname { | ||
| 121 | my $self = shift; | ||
| 122 | $self->{'dbname'} = shift if(@_); | ||
| 123 | return $self->{'dbname'}; | ||
| 124 | } | ||
| 125 | |||
| 126 | sub db_display_name { | ||
| 127 | my $self = shift; | ||
| 128 | $self->{'db_display_name'} = shift if(@_); | ||
| 129 | return $self->{'db_display_name'}; | ||
| 130 | } | ||
| 131 | |||
| 132 | sub summary_as_hash { | ||
| 133 | my $self = shift; | ||
| 134 | my %summary; | ||
| 135 | $summary{name} = $self->name; | ||
| 136 | $summary{dbname} = $self->dbname; | ||
| 137 | |||
| 138 | return \%summary; | ||
| 139 | } | ||
| 140 | |||
| 141 | 1; |