Archive Ensembl HomeArchive Ensembl Home
Unit.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::Mapper::Unit - One side of a map pair
00024 
00025 =head1 SYNOPSIS
00026 
00027 =head1 DESCRIPTION
00028 
00029 Two regions mapped between different coordinate systems are each
00030 represented by a Bio::EnsEMBL::Mapper::Unit and joined together as a
00031 Bio::EnsEMBL::Mapper::Pair.
00032 
00033 =head1 METHODS
00034 
00035 =cut
00036 
00037 
00038 package Bio::EnsEMBL::Mapper::Unit;
00039 
00040 use strict;
00041 
00042 sub new {
00043   my ( $proto, $id, $start, $end ) = @_;
00044 
00045   my $class = ref($proto) || $proto;
00046 
00047   return
00048     bless( { 'id' => $id, 'start' => $start, 'end' => $end }, $class );
00049 }
00050 
00051 =head2 id
00052 
00053   Arg  1      int|char $id
00054           the id of the object (e.g. seq_region_name) which is mapped
00055   Function    accessor method
00056   Returntype  int|char
00057   Exceptions  none
00058   Caller      Bio::EnsEMBL::Mapper::Unit
00059   Status      Stable
00060 
00061 =cut
00062 
00063 sub id {
00064   my ( $self, $value ) = @_;
00065 
00066   if ( defined($value) ) {
00067     $self->{'id'} = $value;
00068   }
00069 
00070   return $self->{'id'};
00071 }
00072 
00073 =head2 start
00074 
00075   Arg  1      int $start
00076           the start coordinate of the mapped
00077           region which this object represents
00078   Function    accessor method
00079   Returntype  int
00080   Exceptions  none
00081   Caller      Bio::EnsEMBL::Mapper::Unit
00082   Status      Stable
00083 
00084 =cut
00085 
00086 sub start {
00087   my ( $self, $value ) = @_;
00088 
00089   if ( defined($value) ) {
00090     $self->{'start'} = $value;
00091   }
00092 
00093   return $self->{'start'};
00094 }
00095 
00096 =head2 end
00097 
00098   Arg  1      int $end
00099           the end coordinate of the mapped
00100           region which this object represents
00101   Function    accessor method
00102   Returntype  int
00103   Exceptions  none
00104   Caller      Bio::EnsEMBL::Mapper::Unit
00105   Status      Stable
00106 
00107 =cut
00108 
00109 sub end {
00110   my ( $self, $value ) = @_;
00111 
00112   if ( defined($value) ) {
00113     $self->{'end'} = $value;
00114   }
00115 
00116   return $self->{'end'};
00117 }
00118 
00119 1;