merge upstream
[bioperl-live.git] / Bio / Location / CoordinatePolicyI.pm
blob07a37cdce74dc74bb349ea62e1da5858d9e83d7a
2 # BioPerl module for Bio::Location::CoordinatePolicyI
3 # Please direct questions and support issues to <bioperl-l@bioperl.org>
5 # Cared for by Hilmar Lapp <hlapp@gmx.net>
6 # and Jason Stajich <jason@bioperl.org>
8 # Copyright Hilmar Lapp, Jason Stajich
10 # 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::Location::CoordinatePolicyI - Abstract interface for objects implementing
16 a certain policy of computing integer-valued coordinates of a Location
18 =head1 SYNOPSIS
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());
29 =head1 DESCRIPTION
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.
41 =head1 FEEDBACK
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.
47 bioperl-l@bioperl.org - General discussion
48 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
50 =head2 Support
52 Please direct usage questions or support issues to the mailing list:
54 I<bioperl-l@bioperl.org>
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.
61 =head2 Reporting Bugs
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:
67 https://github.com/bioperl/bioperl-live/issues
69 =head1 AUTHOR - Hilmar Lapp, Jason Stajich
71 Email hlapp@gmx.net, jason@bioperl.org
73 =head1 APPENDIX
75 The rest of the documentation details each of the object
76 methods. Internal methods are usually preceded with a _
78 =cut
80 # Let the code begin...
83 package Bio::Location::CoordinatePolicyI;
84 use strict;
86 use base qw(Bio::Root::RootI);
88 =head2 start
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.
97 =cut
99 sub start {
100 my ($self) = @_;
101 $self->throw_not_implemented();
104 =head2 end
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.
113 =cut
115 sub end {
116 my ($self) = @_;
117 $self->throw_not_implemented();