tag fourth (and hopefully last) alpha
[bioperl-live.git] / branch-1-6 / Bio / Location / CoordinatePolicyI.pm
blob5d4ef3a6b8698ad4342426c7ffa324e81d56426a
1 # $Id$
3 # BioPerl module for Bio::Location::CoordinatePolicyI
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Hilmar Lapp <hlapp@gmx.net>
7 # and Jason Stajich <jason@bioperl.org>
9 # Copyright Hilmar Lapp, Jason Stajich
11 # 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::Location::CoordinatePolicyI - Abstract interface for objects implementing
17 a certain policy of computing integer-valued coordinates of a Location
19 =head1 SYNOPSIS
21 # get a location, e.g., from a SeqFeature
22 $location = $feature->location();
23 # examine its coordinate computation policy
24 print "Location of feature ", $feature->primary_tag(), " employs a ",
25 ref($location->coordinate_policy()),
26 " instance for coordinate computation\n";
27 # change the policy, e.g. because the user chose to do so
28 $location->coordinate_policy(Bio::Location::NarrowestCoordPolicy->new());
30 =head1 DESCRIPTION
32 Objects implementing this interface are used by Bio::LocationI
33 implementing objects to determine integer-valued coordinates when
34 asked for it. While this may seem trivial for simple locations, there
35 are different ways to do it for fuzzy or compound (split)
36 locations. Classes implementing this interface implement a certain
37 policy, like 'always widest range', 'always smallest range', 'mean for
38 BETWEEN locations', etc. By installing a different policy object in a
39 Location object, the behaviour of coordinate computation can be changed
40 on-the-fly, and with a single line of code client-side.
42 =head1 FEEDBACK
44 User feedback is an integral part of the evolution of this and other
45 Bioperl modules. Send your comments and suggestions preferably to one
46 of the Bioperl mailing lists. Your participation is much appreciated.
48 bioperl-l@bioperl.org - General discussion
49 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
51 =head2 Support
53 Please direct usage questions or support issues to the mailing list:
55 I<bioperl-l@bioperl.org>
57 rather than to the module maintainer directly. Many experienced and
58 reponsive experts will be able look at the problem and quickly
59 address it. Please include a thorough description of the problem
60 with code and data examples if at all possible.
62 =head2 Reporting Bugs
64 Report bugs to the Bioperl bug tracking system to help us keep track
65 the bugs and their resolution. Bug reports can be submitted via the
66 web:
68 http://bugzilla.open-bio.org/
70 =head1 AUTHOR - Hilmar Lapp, Jason Stajich
72 Email hlapp@gmx.net, jason@bioperl.org
74 =head1 APPENDIX
76 The rest of the documentation details each of the object
77 methods. Internal methods are usually preceded with a _
79 =cut
81 # Let the code begin...
84 package Bio::Location::CoordinatePolicyI;
85 use strict;
87 use base qw(Bio::Root::RootI);
89 =head2 start
91 Title : start
92 Usage : $start = $policy->start($location);
93 Function: Get the integer-valued start coordinate of the given location as
94 computed by this computation policy.
95 Returns : A positive integer number.
96 Args : A Bio::LocationI implementing object.
98 =cut
100 sub start {
101 my ($self) = @_;
102 $self->throw_not_implemented();
105 =head2 end
107 Title : end
108 Usage : $end = $policy->end($location);
109 Function: Get the integer-valued end coordinate of the given location as
110 computed by this computation policy.
111 Returns : A positive integer number.
112 Args : A Bio::LocationI implementing object.
114 =cut
116 sub end {
117 my ($self) = @_;
118 $self->throw_not_implemented();