line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# BioPerl module for Bio::Map::RelativeI |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Please direct questions and support issues to |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# Cared for by Sendu Bala |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright Sendu Bala |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# You may distribute this module under the same terms as perl itself |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# POD documentation - main docs before the code |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Bio::Map::RelativeI - Interface for describing what a Position's coordiantes are |
17
|
|
|
|
|
|
|
relative to. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# do not use this module directly |
22
|
|
|
|
|
|
|
# See Bio::Map::Relative for an example of |
23
|
|
|
|
|
|
|
# implementation. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
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. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 FEEDBACK |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 Mailing Lists |
36
|
|
|
|
|
|
|
|
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. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
bioperl-l@bioperl.org - General discussion |
42
|
|
|
|
|
|
|
http://bioperl.org/wiki/Mailing_lists - About the mailing lists |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 Support |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Please direct usage questions or support issues to the mailing list: |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
I |
49
|
|
|
|
|
|
|
|
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. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 Reporting Bugs |
56
|
|
|
|
|
|
|
|
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: |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
https://github.com/bioperl/bioperl-live/issues |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 AUTHOR - Sendu Bala |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Email bix@sendu.me.uk |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 APPENDIX |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
The rest of the documentation details each of the object methods. |
70
|
|
|
|
|
|
|
Internal methods are usually preceded with a _ |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# Let the code begin... |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
package Bio::Map::RelativeI; |
77
|
9
|
|
|
9
|
|
43
|
use strict; |
|
9
|
|
|
|
|
10
|
|
|
9
|
|
|
|
|
239
|
|
78
|
|
|
|
|
|
|
|
79
|
9
|
|
|
9
|
|
28
|
use base qw(Bio::Root::RootI); |
|
9
|
|
|
|
|
10
|
|
|
9
|
|
|
|
|
1507
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 absolute_conversion |
82
|
|
|
|
|
|
|
|
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 |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=cut |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub absolute_conversion { |
93
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
94
|
0
|
|
|
|
|
|
$self->throw_not_implemented(); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 type |
98
|
|
|
|
|
|
|
|
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; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Note that type is set by the last method that was set, or during |
106
|
|
|
|
|
|
|
new(). |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Returns : the string 'map', 'element' or 'position', or undef |
109
|
|
|
|
|
|
|
Args : none |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub type { |
114
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
115
|
0
|
|
|
|
|
|
$self->throw_not_implemented(); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head2 map |
119
|
|
|
|
|
|
|
|
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. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=cut |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub map { |
132
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
133
|
0
|
|
|
|
|
|
$self->throw_not_implemented(); |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head2 element |
137
|
|
|
|
|
|
|
|
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 |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=cut |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
sub element { |
151
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
152
|
0
|
|
|
|
|
|
$self->throw_not_implemented(); |
153
|
|
|
|
|
|
|
} |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head2 position |
156
|
|
|
|
|
|
|
|
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 |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=cut |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub position { |
170
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
171
|
0
|
|
|
|
|
|
$self->throw_not_implemented(); |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=head2 description |
175
|
|
|
|
|
|
|
|
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 |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=cut |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
sub description { |
187
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
188
|
0
|
|
|
|
|
|
$self->throw_not_implemented(); |
189
|
|
|
|
|
|
|
} |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
1; |