ensembl-hive  2.7.0
Unit.pm
Go to the documentation of this file.
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
42 
43 =head1 METHODS
44 
45 =cut
46 
47 
48 package Bio::EnsEMBL::Mapper::Unit;
49 
50 use strict;
51 
52 sub new {
53  my ( $proto, $id, $start, $end ) = @_;
54 
55  my $class = ref($proto) || $proto;
56 
57  return
58  bless( { 'id' => $id, 'start' => $start, 'end' => $end }, $class );
59 }
60 
61 =head2 id
62 
63  Arg 1 int|char $id
64  the id of the object (e.g. seq_region_name) which is mapped
65  Function accessor method
66  Returntype int|char
67  Exceptions none
69  Status Stable
70 
71 =cut
72 
73 sub id {
74  my ( $self, $value ) = @_;
75 
76  if ( defined($value) ) {
77  $self->{'id'} = $value;
78  }
79 
80  return $self->{'id'};
81 }
82 
83 =head2 start
84 
85  Arg 1 int $start
86  the start coordinate of the mapped
87  region which this object represents
88  Function accessor method
89  Returntype int
90  Exceptions none
92  Status Stable
93 
94 =cut
95 
96 sub start {
97  my ( $self, $value ) = @_;
98 
99  if ( defined($value) ) {
100  $self->{'start'} = $value;
101  }
102 
103  return $self->{'start'};
104 }
105 
106 =head2 end
107 
108  Arg 1 int $end
109  the end coordinate of the mapped
110  region which this object represents
111  Function accessor method
112  Returntype int
113  Exceptions none
115  Status Stable
116 
117 =cut
118 
119 sub end {
120  my ( $self, $value ) = @_;
121 
122  if ( defined($value) ) {
123  $self->{'end'} = $value;
124  }
125 
126  return $self->{'end'};
127 }
128 
129 1;
Bio::EnsEMBL::Mapper::Unit
Definition: Unit.pm:15
map
public map()
Bio::EnsEMBL::Mapper::Pair
Definition: Pair.pm:15