tag fourth (and hopefully last) alpha
[bioperl-live.git] / branch-1-6 / Bio / Map / RelativeI.pm
blob779d640ee270a752cd282219bc014f3c4d85c575
1 # $Id$
3 # BioPerl module for Bio::Map::RelativeI
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Sendu Bala <bix@sendu.me.uk>
9 # Copyright Sendu Bala
11 # You may distribute this module under the same terms as perl itself
13 # POD documentation - main docs before the code
15 =head1 NAME
17 Bio::Map::RelativeI - Interface for describing what a Position's coordiantes are
18 relative to.
20 =head1 SYNOPSIS
22 # do not use this module directly
23 # See Bio::Map::Relative for an example of
24 # implementation.
26 =head1 DESCRIPTION
28 A Relative object is used to describe what the co-ordinates (numerical(),
29 start(), end()) of a Position are relative to. By default they are
30 implicitly assumed to be relative to the start of the map the Position is on.
31 But setting the relative() of a Position to one of these objects lets us
32 define otherwise.
34 =head1 FEEDBACK
36 =head2 Mailing Lists
38 User feedback is an integral part of the evolution of this and other
39 Bioperl modules. Send your comments and suggestions preferably to
40 the Bioperl mailing list. Your participation is much appreciated.
42 bioperl-l@bioperl.org - General discussion
43 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
45 =head2 Support
47 Please direct usage questions or support issues to the mailing list:
49 I<bioperl-l@bioperl.org>
51 rather than to the module maintainer directly. Many experienced and
52 reponsive experts will be able look at the problem and quickly
53 address it. Please include a thorough description of the problem
54 with code and data examples if at all possible.
56 =head2 Reporting Bugs
58 Report bugs to the Bioperl bug tracking system to help us keep track
59 of the bugs and their resolution. Bug reports can be submitted via the
60 web:
62 http://bugzilla.open-bio.org/
64 =head1 AUTHOR - Sendu Bala
66 Email bix@sendu.me.uk
68 =head1 APPENDIX
70 The rest of the documentation details each of the object methods.
71 Internal methods are usually preceded with a _
73 =cut
75 # Let the code begin...
77 package Bio::Map::RelativeI;
78 use strict;
80 use base qw(Bio::Root::RootI);
82 =head2 absolute_conversion
84 Title : absolute_conversion
85 Usage : my $absolute_coord = $relative->absolute_conversion($pos);
86 Function: Convert the start co-ordinate of the supplied position into a number
87 relative to the start of its map.
88 Returns : scalar number
89 Args : Bio::Map::PositionI object
91 =cut
93 sub absolute_conversion {
94 my $self = shift;
95 $self->throw_not_implemented();
98 =head2 type
100 Title : type
101 Usage : my $type = $relative->type();
102 Function: Get the type of thing we are relative to. The types correspond
103 to a method name, so the value of what we are relative to can
104 subsequently be found by $value = $relative->$type;
106 Note that type is set by the last method that was set, or during
107 new().
109 Returns : the string 'map', 'element' or 'position', or undef
110 Args : none
112 =cut
114 sub type {
115 my $self = shift;
116 $self->throw_not_implemented();
119 =head2 map
121 Title : map
122 Usage : my $int = $relative->map();
123 $relative->map($int);
124 Function: Get/set the distance from the start of the map that the Position's
125 co-ordiantes are relative to.
126 Returns : int
127 Args : none to get, OR
128 int to set; a value of 0 means relative to the start of the map.
130 =cut
132 sub map {
133 my $self = shift;
134 $self->throw_not_implemented();
137 =head2 element
139 Title : element
140 Usage : my $element = $relative->element();
141 $relative->element($element);
142 Function: Get/set the map element (Mappable) the Position is relative to. If
143 the Mappable has more than one Position on the Position's map, we
144 will be relative to the Mappable's first Position on the map.
145 Returns : Bio::Map::MappableI
146 Args : none got get, OR
147 Bio::Map::MappableI to set
149 =cut
151 sub element {
152 my $self = shift;
153 $self->throw_not_implemented();
156 =head2 position
158 Title : position
159 Usage : my $position = $relative->position();
160 $relative->position($position);
161 Function: Get/set the Position your Position is relative to. Your Position
162 will be made relative to the start of this supplied Position. It
163 makes no difference what maps the Positions are on.
164 Returns : Bio::Map::PositionI
165 Args : none got get, OR
166 Bio::Map::PositionI to set
168 =cut
170 sub position {
171 my $self = shift;
172 $self->throw_not_implemented();
175 =head2 description
177 Title : description
178 Usage : my $description = $relative->description();
179 $relative->description($description);
180 Function: Get/set a textual description of what this relative describes.
181 Returns : string
182 Args : none to get, OR
183 string to set
185 =cut
187 sub description {
188 my $self = shift;
189 $self->throw_not_implemented();