0
|
1 # $Id: MapperI.pm,v 1.5 2002/11/08 09:28:24 heikki Exp $
|
|
2 #
|
|
3 # bioperl module for Bio::Coordinate::MapperI
|
|
4 #
|
|
5 # Cared for by Heikki Lehvaslaiho <heikki@ebi.ac.uk>
|
|
6 #
|
|
7 # Copyright Heikki Lehvaslaiho
|
|
8 #
|
|
9 # You may distribute this module under the same terms as perl itself
|
|
10
|
|
11 # POD documentation - main docs before the code
|
|
12
|
|
13 =head1 NAME
|
|
14
|
|
15 Bio::Coordinate::MapperI - Interface describing coordinate mappers
|
|
16
|
|
17 =head1 SYNOPSIS
|
|
18
|
|
19 # not to be used directly
|
|
20
|
|
21 =head1 DESCRIPTION
|
|
22
|
|
23 MapperI defines methods for classes capable for mapping locations
|
|
24 between coordinate systems.
|
|
25
|
|
26 =head1 FEEDBACK
|
|
27
|
|
28 =head2 Mailing Lists
|
|
29
|
|
30 User feedback is an integral part of the evolution of this and other
|
|
31 Bioperl modules. Send your comments and suggestions preferably to the
|
|
32 Bioperl mailing lists Your participation is much appreciated.
|
|
33
|
|
34 bioperl-l@bioperl.org - General discussion
|
|
35 http://bio.perl.org/MailList.html - About the mailing lists
|
|
36
|
|
37 =head2 Reporting Bugs
|
|
38
|
|
39 report bugs to the Bioperl bug tracking system to help us keep track
|
|
40 the bugs and their resolution. Bug reports can be submitted via
|
|
41 email or the web:
|
|
42
|
|
43 bioperl-bugs@bio.perl.org
|
|
44 http://bugzilla.bioperl.org/
|
|
45
|
|
46 =head1 AUTHOR - Heikki Lehvaslaiho
|
|
47
|
|
48 Email: heikki@ebi.ac.uk
|
|
49 Address:
|
|
50
|
|
51 EMBL Outstation, European Bioinformatics Institute
|
|
52 Wellcome Trust Genome Campus, Hinxton
|
|
53 Cambs. CB10 1SD, United Kingdom
|
|
54
|
|
55 =head1 CONTRIBUTORS
|
|
56
|
|
57 Additional contributors names and emails here
|
|
58
|
|
59 =head1 APPENDIX
|
|
60
|
|
61 The rest of the documentation details each of the object
|
|
62 methods. Internal methods are usually preceded with a _
|
|
63
|
|
64 =cut
|
|
65
|
|
66
|
|
67 # Let the code begin...
|
|
68
|
|
69 package Bio::Coordinate::MapperI;
|
|
70 use vars qw(@ISA );
|
|
71 use strict;
|
|
72
|
|
73 # Object preamble - inherits from Bio::Root::RootI
|
|
74 use Bio::Root::RootI;
|
|
75
|
|
76 @ISA = qw(Bio::Root::RootI);
|
|
77
|
|
78
|
|
79
|
|
80 =head2 in
|
|
81
|
|
82 Title : in
|
|
83 Usage : $obj->in('peptide');
|
|
84 Function: Set and read the input coordinate system.
|
|
85 Example :
|
|
86 Returns : value of input system
|
|
87 Args : new value (optional), Bio::LocationI
|
|
88
|
|
89 =cut
|
|
90
|
|
91 sub in {
|
|
92 my ($self,$value) = @_;
|
|
93
|
|
94 $self->throw_not_implemented();
|
|
95
|
|
96 }
|
|
97
|
|
98
|
|
99 =head2 out
|
|
100
|
|
101 Title : out
|
|
102 Usage : $obj->out('peptide');
|
|
103 Function: Set and read the output coordinate system.
|
|
104 Example :
|
|
105 Returns : value of output system
|
|
106 Args : new value (optional), Bio::LocationI
|
|
107
|
|
108 =cut
|
|
109
|
|
110 sub out {
|
|
111 my ($self,$value) = @_;
|
|
112
|
|
113 $self->throw_not_implemented();
|
|
114 }
|
|
115
|
|
116 =head2 swap
|
|
117
|
|
118 Title : swap
|
|
119 Usage : $obj->swap;
|
|
120 Function: Swap the direction of mapping: input <-> output)
|
|
121 Example :
|
|
122 Returns : 1
|
|
123 Args :
|
|
124
|
|
125 =cut
|
|
126
|
|
127 sub swap {
|
|
128 my ($self) = @_;
|
|
129
|
|
130 $self->throw_not_implemented();
|
|
131
|
|
132 }
|
|
133
|
|
134 =head2 test
|
|
135
|
|
136 Title : test
|
|
137 Usage : $obj->test;
|
|
138 Function: test that both components are of same length
|
|
139 Example :
|
|
140 Returns : ( 1 | undef )
|
|
141 Args :
|
|
142
|
|
143 =cut
|
|
144
|
|
145 sub test {
|
|
146 my ($self) = @_;
|
|
147
|
|
148 $self->throw_not_implemented();
|
|
149 }
|
|
150
|
|
151
|
|
152 =head2 map
|
|
153
|
|
154 Title : map
|
|
155 Usage : $newpos = $obj->map($loc);
|
|
156 Function: Map the location from the input coordinate system
|
|
157 to a new value in the output coordinate system.
|
|
158 Example :
|
|
159 Returns : new value in the output coordiante system
|
|
160 Args : Bio::LocationI
|
|
161
|
|
162 =cut
|
|
163
|
|
164 sub map {
|
|
165 my ($self,$value) = @_;
|
|
166
|
|
167 $self->throw_not_implemented();
|
|
168
|
|
169 }
|
|
170
|
|
171 =head2 return_match
|
|
172
|
|
173 Title : return_match
|
|
174 Usage : $obj->return_match(1);
|
|
175 Function: A flag to turn on the simplified mode of
|
|
176 returning only one joined Match object or undef
|
|
177 Example :
|
|
178 Returns : boolean
|
|
179 Args : boolean (optional)
|
|
180
|
|
181 =cut
|
|
182
|
|
183 sub return_match {
|
|
184 my ($self,$value) = @_;
|
|
185 if( defined $value) {
|
|
186 $value ? ( $self->{'_return_match'} = 1 ) :
|
|
187 ( $self->{'_return_match'} = 0 );
|
|
188 }
|
|
189 return $self->{'_return_match'} || 0 ;
|
|
190 }
|
|
191
|
|
192 1;
|
|
193
|