| 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::Mapper::Unit - One side of a map pair | ||
| 34 | |||
| 35 | =head1 SYNOPSIS | ||
| 36 | |||
| 37 | =head1 DESCRIPTION | ||
| 38 | |||
| 39 | Two regions mapped between different coordinate systems are each | ||
| 40 | represented by a Bio::EnsEMBL::Mapper::Unit and joined together as a | ||
| 41 | Bio::EnsEMBL::Mapper::Pair. | ||
| 42 | |||
| 43 | =head1 METHODS | ||
| 44 | |||
| 45 | =cut | ||
| 46 | |||
| 47 | |||
| 48 | package Bio::EnsEMBL::Mapper::Unit; | ||
| 49 | $Bio::EnsEMBL::Mapper::Unit::VERSION = '114.0.0_50'; # TRIAL | ||
| 50 | $Bio::EnsEMBL::Mapper::Unit::VERSION = '114.0.050'; | ||
| 51 | use strict; | ||
| 52 | |||
| 53 | sub new { | ||
| 54 | my ( $proto, $id, $start, $end ) = @_; | ||
| 55 | |||
| 56 | my $class = ref($proto) || $proto; | ||
| 57 | |||
| 58 | return | ||
| 59 | bless( { 'id' => $id, 'start' => $start, 'end' => $end }, $class ); | ||
| 60 | } | ||
| 61 | |||
| 62 | =head2 id | ||
| 63 | |||
| 64 | Arg 1 int|char $id | ||
| 65 | the id of the object (e.g. seq_region_name) which is mapped | ||
| 66 | Function accessor method | ||
| 67 | Returntype int|char | ||
| 68 | Exceptions none | ||
| 69 | Caller Bio::EnsEMBL::Mapper::Unit | ||
| 70 | Status Stable | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | sub id { | ||
| 75 | my ( $self, $value ) = @_; | ||
| 76 | |||
| 77 | if ( defined($value) ) { | ||
| 78 | $self->{'id'} = $value; | ||
| 79 | } | ||
| 80 | |||
| 81 | return $self->{'id'}; | ||
| 82 | } | ||
| 83 | |||
| 84 | =head2 start | ||
| 85 | |||
| 86 | Arg 1 int $start | ||
| 87 | the start coordinate of the mapped | ||
| 88 | region which this object represents | ||
| 89 | Function accessor method | ||
| 90 | Returntype int | ||
| 91 | Exceptions none | ||
| 92 | Caller Bio::EnsEMBL::Mapper::Unit | ||
| 93 | Status Stable | ||
| 94 | |||
| 95 | =cut | ||
| 96 | |||
| 97 | sub start { | ||
| 98 | my ( $self, $value ) = @_; | ||
| 99 | |||
| 100 | if ( defined($value) ) { | ||
| 101 | $self->{'start'} = $value; | ||
| 102 | } | ||
| 103 | |||
| 104 | return $self->{'start'}; | ||
| 105 | } | ||
| 106 | |||
| 107 | =head2 end | ||
| 108 | |||
| 109 | Arg 1 int $end | ||
| 110 | the end coordinate of the mapped | ||
| 111 | region which this object represents | ||
| 112 | Function accessor method | ||
| 113 | Returntype int | ||
| 114 | Exceptions none | ||
| 115 | Caller Bio::EnsEMBL::Mapper::Unit | ||
| 116 | Status Stable | ||
| 117 | |||
| 118 | =cut | ||
| 119 | |||
| 120 | sub end { | ||
| 121 | my ( $self, $value ) = @_; | ||
| 122 | |||
| 123 | if ( defined($value) ) { | ||
| 124 | $self->{'end'} = $value; | ||
| 125 | } | ||
| 126 | |||
| 127 | return $self->{'end'}; | ||
| 128 | } | ||
| 129 | |||
| 130 | 1; |