[bug 2714]
[bioperl-live.git] / Bio / Map / RelativeI.pm
blob436180f86500dc5b981bb3ace29e769f3bf549b3
1 # $Id$
3 # BioPerl module for Bio::Map::RelativeI
5 # Cared for by Sendu Bala <bix@sendu.me.uk>
7 # Copyright Sendu Bala
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
13 =head1 NAME
15 Bio::Map::RelativeI - Interface for describing what a Position's coordiantes are
16 relative to.
18 =head1 SYNOPSIS
20 # do not use this module directly
21 # See Bio::Map::Relative for an example of
22 # implementation.
24 =head1 DESCRIPTION
26 A Relative object is used to describe what the co-ordinates (numerical(),
27 start(), end()) of a Position are relative to. By default they are
28 implicitly assumed to be relative to the start of the map the Position is on.
29 But setting the relative() of a Position to one of these objects lets us
30 define otherwise.
32 =head1 FEEDBACK
34 =head2 Mailing Lists
36 User feedback is an integral part of the evolution of this and other
37 Bioperl modules. Send your comments and suggestions preferably to
38 the Bioperl mailing list. Your participation is much appreciated.
40 bioperl-l@bioperl.org - General discussion
41 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
43 =head2 Reporting Bugs
45 Report bugs to the Bioperl bug tracking system to help us keep track
46 of the bugs and their resolution. Bug reports can be submitted via the
47 web:
49 http://bugzilla.open-bio.org/
51 =head1 AUTHOR - Sendu Bala
53 Email bix@sendu.me.uk
55 =head1 APPENDIX
57 The rest of the documentation details each of the object methods.
58 Internal methods are usually preceded with a _
60 =cut
62 # Let the code begin...
64 package Bio::Map::RelativeI;
65 use strict;
67 use base qw(Bio::Root::RootI);
69 =head2 absolute_conversion
71 Title : absolute_conversion
72 Usage : my $absolute_coord = $relative->absolute_conversion($pos);
73 Function: Convert the start co-ordinate of the supplied position into a number
74 relative to the start of its map.
75 Returns : scalar number
76 Args : Bio::Map::PositionI object
78 =cut
80 sub absolute_conversion {
81 my $self = shift;
82 $self->throw_not_implemented();
85 =head2 type
87 Title : type
88 Usage : my $type = $relative->type();
89 Function: Get the type of thing we are relative to. The types correspond
90 to a method name, so the value of what we are relative to can
91 subsequently be found by $value = $relative->$type;
93 Note that type is set by the last method that was set, or during
94 new().
96 Returns : the string 'map', 'element' or 'position', or undef
97 Args : none
99 =cut
101 sub type {
102 my $self = shift;
103 $self->throw_not_implemented();
106 =head2 map
108 Title : map
109 Usage : my $int = $relative->map();
110 $relative->map($int);
111 Function: Get/set the distance from the start of the map that the Position's
112 co-ordiantes are relative to.
113 Returns : int
114 Args : none to get, OR
115 int to set; a value of 0 means relative to the start of the map.
117 =cut
119 sub map {
120 my $self = shift;
121 $self->throw_not_implemented();
124 =head2 element
126 Title : element
127 Usage : my $element = $relative->element();
128 $relative->element($element);
129 Function: Get/set the map element (Mappable) the Position is relative to. If
130 the Mappable has more than one Position on the Position's map, we
131 will be relative to the Mappable's first Position on the map.
132 Returns : Bio::Map::MappableI
133 Args : none got get, OR
134 Bio::Map::MappableI to set
136 =cut
138 sub element {
139 my $self = shift;
140 $self->throw_not_implemented();
143 =head2 position
145 Title : position
146 Usage : my $position = $relative->position();
147 $relative->position($position);
148 Function: Get/set the Position your Position is relative to. Your Position
149 will be made relative to the start of this supplied Position. It
150 makes no difference what maps the Positions are on.
151 Returns : Bio::Map::PositionI
152 Args : none got get, OR
153 Bio::Map::PositionI to set
155 =cut
157 sub position {
158 my $self = shift;
159 $self->throw_not_implemented();
162 =head2 description
164 Title : description
165 Usage : my $description = $relative->description();
166 $relative->description($description);
167 Function: Get/set a textual description of what this relative describes.
168 Returns : string
169 Args : none to get, OR
170 string to set
172 =cut
174 sub description {
175 my $self = shift;
176 $self->throw_not_implemented();