TODO failing test per bug #3204
[bioperl-live.git] / Bio / Coordinate / MapperI.pm
blob0fb091115837fc6c5204b146834a4592cbb50533
2 # bioperl module for Bio::Coordinate::MapperI
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Heikki Lehvaslaiho <heikki-at-bioperl-dot-org>
8 # Copyright Heikki Lehvaslaiho
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
14 =head1 NAME
16 Bio::Coordinate::MapperI - Interface describing coordinate mappers
18 =head1 SYNOPSIS
20 # not to be used directly
22 =head1 DESCRIPTION
24 MapperI defines methods for classes capable for mapping locations
25 between coordinate systems.
27 =head1 FEEDBACK
29 =head2 Mailing Lists
31 User feedback is an integral part of the evolution of this and other
32 Bioperl modules. Send your comments and suggestions preferably to the
33 Bioperl mailing lists Your participation is much appreciated.
35 bioperl-l@bioperl.org - General discussion
36 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
38 =head2 Support
40 Please direct usage questions or support issues to the mailing list:
42 I<bioperl-l@bioperl.org>
44 rather than to the module maintainer directly. Many experienced and
45 reponsive experts will be able look at the problem and quickly
46 address it. Please include a thorough description of the problem
47 with code and data examples if at all possible.
49 =head2 Reporting Bugs
51 report bugs to the Bioperl bug tracking system to help us keep track
52 the bugs and their resolution. Bug reports can be submitted via the
53 web:
55 https://redmine.open-bio.org/projects/bioperl/
57 =head1 AUTHOR - Heikki Lehvaslaiho
59 Email: heikki-at-bioperl-dot-org
61 =head1 APPENDIX
63 The rest of the documentation details each of the object
64 methods. Internal methods are usually preceded with a _
66 =cut
69 # Let the code begin...
71 package Bio::Coordinate::MapperI;
72 use strict;
74 # Object preamble - inherits from Bio::Root::RootI
76 use base qw(Bio::Root::RootI);
80 =head2 in
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
89 =cut
91 sub in {
92 my ($self,$value) = @_;
94 $self->throw_not_implemented();
99 =head2 out
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
108 =cut
110 sub out {
111 my ($self,$value) = @_;
113 $self->throw_not_implemented();
116 =head2 swap
118 Title : swap
119 Usage : $obj->swap;
120 Function: Swap the direction of mapping: input <-> output)
121 Example :
122 Returns : 1
123 Args :
125 =cut
127 sub swap {
128 my ($self) = @_;
130 $self->throw_not_implemented();
134 =head2 test
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 :
143 =cut
145 sub test {
146 my ($self) = @_;
148 $self->throw_not_implemented();
152 =head2 map
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
162 =cut
164 sub map {
165 my ($self,$value) = @_;
167 $self->throw_not_implemented();
171 =head2 return_match
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)
181 =cut
183 sub return_match {
184 my ($self,$value) = @_;
185 if( defined $value) {
186 $value ? ( $self->{'_return_match'} = 1 ) :
187 ( $self->{'_return_match'} = 0 );
189 return $self->{'_return_match'} || 0 ;