| 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::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 | package Bio::EnsEMBL::Mapper::Pair; | ||
| 48 | $Bio::EnsEMBL::Mapper::Pair::VERSION = '114.0.0'; | ||
| 49 | use strict; | ||
| 50 | |||
| 51 | sub new { | ||
| 52 | my ( $proto, $from, $to, $ori ) = @_; | ||
| 53 | |||
| 54 | my $class = ref($proto) || $proto; | ||
| 55 | |||
| 56 | return | ||
| 57 | bless( { 'from' => $from, 'to' => $to, 'ori' => $ori }, $class ); | ||
| 58 | } | ||
| 59 | |||
| 60 | =head2 to | ||
| 61 | |||
| 62 | Arg 1 Bio::EnsEMBL::Mapper::Unit $seqobj | ||
| 63 | from and to represent the two regions | ||
| 64 | which are mapped to each other | ||
| 65 | Function accessor method | ||
| 66 | Returntype Bio::EnsEMBL::Mapper::Unit | ||
| 67 | Exceptions none | ||
| 68 | Caller Bio::EnsEMBL::Mapper::Pair | ||
| 69 | Status : Stable | ||
| 70 | |||
| 71 | =cut | ||
| 72 | |||
| 73 | sub to { | ||
| 74 | my ( $self, $value ) = @_; | ||
| 75 | |||
| 76 | if ( defined($value) ) { | ||
| 77 | $self->{'to'} = $value; | ||
| 78 | } | ||
| 79 | |||
| 80 | return $self->{'to'}; | ||
| 81 | } | ||
| 82 | |||
| 83 | =head2 from | ||
| 84 | |||
| 85 | Arg 1 Bio::EnsEMBL::Mapper::Unit $seqobj | ||
| 86 | from and to represent the two regions | ||
| 87 | which are mapped to each other | ||
| 88 | Function accessor method | ||
| 89 | Returntype Bio::EnsEMBL::Mapper::Unit | ||
| 90 | Exceptions none | ||
| 91 | Caller Bio::EnsEMBL::Mapper::Pair | ||
| 92 | Status : Stable | ||
| 93 | |||
| 94 | =cut | ||
| 95 | sub from { | ||
| 96 | my ( $self, $value ) = @_; | ||
| 97 | |||
| 98 | if ( defined($value) ) { | ||
| 99 | $self->{'from'} = $value; | ||
| 100 | } | ||
| 101 | |||
| 102 | return $self->{'from'}; | ||
| 103 | } | ||
| 104 | |||
| 105 | =head2 ori | ||
| 106 | |||
| 107 | Arg 1 Bio::EnsEMBL::Mapper::Unit $ori | ||
| 108 | Function accessor method | ||
| 109 | relative orientation of the the | ||
| 110 | two mapped regions | ||
| 111 | Returntype Bio::EnsEMBL::Mapper::Unit | ||
| 112 | Exceptions none | ||
| 113 | Caller Bio::EnsEMBL::Mapper::Pair | ||
| 114 | Status : Stable | ||
| 115 | |||
| 116 | =cut | ||
| 117 | |||
| 118 | sub ori { | ||
| 119 | my ( $self, $value ) = @_; | ||
| 120 | |||
| 121 | if ( defined($value) ) { | ||
| 122 | $self->{'ori'} = $value; | ||
| 123 | } | ||
| 124 | |||
| 125 | return $self->{'ori'}; | ||
| 126 | } | ||
| 127 | |||
| 128 | 1; |