Bio::DB::TFBS namespace has been moved to its own distribution named after itself
[bioperl-live.git] / Bio / Map / RelativeI.pm
blob33bd9c8ee802e83abe981719ec0130453d16d315
2 # BioPerl module for Bio::Map::RelativeI
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Sendu Bala <bix@sendu.me.uk>
8 # Copyright Sendu Bala
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::Map::RelativeI - Interface for describing what a Position's coordiantes are
17 relative to.
19 =head1 SYNOPSIS
21 # do not use this module directly
22 # See Bio::Map::Relative for an example of
23 # implementation.
25 =head1 DESCRIPTION
27 A Relative object is used to describe what the co-ordinates (numerical(),
28 start(), end()) of a Position are relative to. By default they are
29 implicitly assumed to be relative to the start of the map the Position is on.
30 But setting the relative() of a Position to one of these objects lets us
31 define otherwise.
33 =head1 FEEDBACK
35 =head2 Mailing Lists
37 User feedback is an integral part of the evolution of this and other
38 Bioperl modules. Send your comments and suggestions preferably to
39 the Bioperl mailing list. Your participation is much appreciated.
41 bioperl-l@bioperl.org - General discussion
42 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
44 =head2 Support
46 Please direct usage questions or support issues to the mailing list:
48 I<bioperl-l@bioperl.org>
50 rather than to the module maintainer directly. Many experienced and
51 reponsive experts will be able look at the problem and quickly
52 address it. Please include a thorough description of the problem
53 with code and data examples if at all possible.
55 =head2 Reporting Bugs
57 Report bugs to the Bioperl bug tracking system to help us keep track
58 of the bugs and their resolution. Bug reports can be submitted via the
59 web:
61 https://github.com/bioperl/bioperl-live/issues
63 =head1 AUTHOR - Sendu Bala
65 Email bix@sendu.me.uk
67 =head1 APPENDIX
69 The rest of the documentation details each of the object methods.
70 Internal methods are usually preceded with a _
72 =cut
74 # Let the code begin...
76 package Bio::Map::RelativeI;
77 use strict;
79 use base qw(Bio::Root::RootI);
81 =head2 absolute_conversion
83 Title : absolute_conversion
84 Usage : my $absolute_coord = $relative->absolute_conversion($pos);
85 Function: Convert the start co-ordinate of the supplied position into a number
86 relative to the start of its map.
87 Returns : scalar number
88 Args : Bio::Map::PositionI object
90 =cut
92 sub absolute_conversion {
93 my $self = shift;
94 $self->throw_not_implemented();
97 =head2 type
99 Title : type
100 Usage : my $type = $relative->type();
101 Function: Get the type of thing we are relative to. The types correspond
102 to a method name, so the value of what we are relative to can
103 subsequently be found by $value = $relative->$type;
105 Note that type is set by the last method that was set, or during
106 new().
108 Returns : the string 'map', 'element' or 'position', or undef
109 Args : none
111 =cut
113 sub type {
114 my $self = shift;
115 $self->throw_not_implemented();
118 =head2 map
120 Title : map
121 Usage : my $int = $relative->map();
122 $relative->map($int);
123 Function: Get/set the distance from the start of the map that the Position's
124 co-ordiantes are relative to.
125 Returns : int
126 Args : none to get, OR
127 int to set; a value of 0 means relative to the start of the map.
129 =cut
131 sub map {
132 my $self = shift;
133 $self->throw_not_implemented();
136 =head2 element
138 Title : element
139 Usage : my $element = $relative->element();
140 $relative->element($element);
141 Function: Get/set the map element (Mappable) the Position is relative to. If
142 the Mappable has more than one Position on the Position's map, we
143 will be relative to the Mappable's first Position on the map.
144 Returns : Bio::Map::MappableI
145 Args : none got get, OR
146 Bio::Map::MappableI to set
148 =cut
150 sub element {
151 my $self = shift;
152 $self->throw_not_implemented();
155 =head2 position
157 Title : position
158 Usage : my $position = $relative->position();
159 $relative->position($position);
160 Function: Get/set the Position your Position is relative to. Your Position
161 will be made relative to the start of this supplied Position. It
162 makes no difference what maps the Positions are on.
163 Returns : Bio::Map::PositionI
164 Args : none got get, OR
165 Bio::Map::PositionI to set
167 =cut
169 sub position {
170 my $self = shift;
171 $self->throw_not_implemented();
174 =head2 description
176 Title : description
177 Usage : my $description = $relative->description();
178 $relative->description($description);
179 Function: Get/set a textual description of what this relative describes.
180 Returns : string
181 Args : none to get, OR
182 string to set
184 =cut
186 sub description {
187 my $self = shift;
188 $self->throw_not_implemented();