line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# BioPerl module for Bio::Location::CoordinatePolicyI |
3
|
|
|
|
|
|
|
# Please direct questions and support issues to |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# Cared for by Hilmar Lapp |
6
|
|
|
|
|
|
|
# and Jason Stajich |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# Copyright Hilmar Lapp, Jason Stajich |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# You may distribute this module under the same terms as perl itself |
11
|
|
|
|
|
|
|
# POD documentation - main docs before the code |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Bio::Location::CoordinatePolicyI - Abstract interface for objects implementing |
16
|
|
|
|
|
|
|
a certain policy of computing integer-valued coordinates of a Location |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# get a location, e.g., from a SeqFeature |
21
|
|
|
|
|
|
|
$location = $feature->location(); |
22
|
|
|
|
|
|
|
# examine its coordinate computation policy |
23
|
|
|
|
|
|
|
print "Location of feature ", $feature->primary_tag(), " employs a ", |
24
|
|
|
|
|
|
|
ref($location->coordinate_policy()), |
25
|
|
|
|
|
|
|
" instance for coordinate computation\n"; |
26
|
|
|
|
|
|
|
# change the policy, e.g. because the user chose to do so |
27
|
|
|
|
|
|
|
$location->coordinate_policy(Bio::Location::NarrowestCoordPolicy->new()); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 DESCRIPTION |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Objects implementing this interface are used by Bio::LocationI |
32
|
|
|
|
|
|
|
implementing objects to determine integer-valued coordinates when |
33
|
|
|
|
|
|
|
asked for it. While this may seem trivial for simple locations, there |
34
|
|
|
|
|
|
|
are different ways to do it for fuzzy or compound (split) |
35
|
|
|
|
|
|
|
locations. Classes implementing this interface implement a certain |
36
|
|
|
|
|
|
|
policy, like 'always widest range', 'always smallest range', 'mean for |
37
|
|
|
|
|
|
|
BETWEEN locations', etc. By installing a different policy object in a |
38
|
|
|
|
|
|
|
Location object, the behaviour of coordinate computation can be changed |
39
|
|
|
|
|
|
|
on-the-fly, and with a single line of code client-side. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 FEEDBACK |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
User feedback is an integral part of the evolution of this and other |
44
|
|
|
|
|
|
|
Bioperl modules. Send your comments and suggestions preferably to one |
45
|
|
|
|
|
|
|
of the Bioperl mailing lists. Your participation is much appreciated. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
bioperl-l@bioperl.org - General discussion |
48
|
|
|
|
|
|
|
http://bioperl.org/wiki/Mailing_lists - About the mailing lists |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 Support |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Please direct usage questions or support issues to the mailing list: |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
I |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
rather than to the module maintainer directly. Many experienced and |
57
|
|
|
|
|
|
|
reponsive experts will be able look at the problem and quickly |
58
|
|
|
|
|
|
|
address it. Please include a thorough description of the problem |
59
|
|
|
|
|
|
|
with code and data examples if at all possible. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 Reporting Bugs |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Report bugs to the Bioperl bug tracking system to help us keep track |
64
|
|
|
|
|
|
|
the bugs and their resolution. Bug reports can be submitted via the |
65
|
|
|
|
|
|
|
web: |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
https://github.com/bioperl/bioperl-live/issues |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 AUTHOR - Hilmar Lapp, Jason Stajich |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Email hlapp@gmx.net, jason@bioperl.org |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 APPENDIX |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
The rest of the documentation details each of the object |
76
|
|
|
|
|
|
|
methods. Internal methods are usually preceded with a _ |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# Let the code begin... |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
package Bio::Location::CoordinatePolicyI; |
84
|
192
|
|
|
192
|
|
949
|
use strict; |
|
192
|
|
|
|
|
221
|
|
|
192
|
|
|
|
|
5025
|
|
85
|
|
|
|
|
|
|
|
86
|
192
|
|
|
192
|
|
749
|
use base qw(Bio::Root::RootI); |
|
192
|
|
|
|
|
195
|
|
|
192
|
|
|
|
|
19832
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 start |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Title : start |
91
|
|
|
|
|
|
|
Usage : $start = $policy->start($location); |
92
|
|
|
|
|
|
|
Function: Get the integer-valued start coordinate of the given location as |
93
|
|
|
|
|
|
|
computed by this computation policy. |
94
|
|
|
|
|
|
|
Returns : A positive integer number. |
95
|
|
|
|
|
|
|
Args : A Bio::LocationI implementing object. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub start { |
100
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
101
|
0
|
|
|
|
|
|
$self->throw_not_implemented(); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 end |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Title : end |
107
|
|
|
|
|
|
|
Usage : $end = $policy->end($location); |
108
|
|
|
|
|
|
|
Function: Get the integer-valued end coordinate of the given location as |
109
|
|
|
|
|
|
|
computed by this computation policy. |
110
|
|
|
|
|
|
|
Returns : A positive integer number. |
111
|
|
|
|
|
|
|
Args : A Bio::LocationI implementing object. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub end { |
116
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
117
|
0
|
|
|
|
|
|
$self->throw_not_implemented(); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
1; |