reimplement various methods in terms of get_dbxrefs, for consistency
[bioperl-live.git] / Bio / Location / FuzzyLocationI.pm
blob7fc6a84ee93a67c679637ed6b2c9d10444335396
1 # $Id$
3 # BioPerl module for Bio::Location::FuzzyLocationI
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Jason Stajich <jason@bioperl.org>
8 # Copyright 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::FuzzyLocationI - Abstract interface of a Location on a Sequence
16 which has unclear start/end location
18 =head1 SYNOPSIS
20 # Get a FuzzyLocationI object somehow
21 print "Fuzzy FT location string is ", $location->to_FTstring();
22 print "location is of the type ", $location->loc_type, "\n";
24 =head1 DESCRIPTION
26 This interface encapsulates the necessary methods for representing a
27 Fuzzy Location, one that does not have clear start and/or end points.
28 This will initially serve to handle features from Genbank/EMBL feature
29 tables that are written as 1^100 meaning between bases 1 and 100 or
30 E<lt>100..300 meaning it starts somewhere before 100. Advanced
31 implementations of this interface may be able to handle the necessary
32 logic of overlaps/intersection/contains/union. It was constructed to
33 handle fuzzy locations that can be represented in Genbank/EMBL.
35 =head1 FEEDBACK
37 User feedback is an integral part of the evolution of this and other
38 Bioperl modules. Send your comments and suggestions preferably to one
39 of the Bioperl mailing lists. 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 the bugs and their resolution. Bug reports can be submitted via the web:
60 http://bugzilla.open-bio.org/
62 =head1 AUTHOR - Jason Stajich
64 Email jason-at-bioperl-dot-org
66 =head1 APPENDIX
68 The rest of the documentation details each of the object
69 methods. Internal methods are usually preceded with a _
71 =cut
73 # Let the code begin...
76 package Bio::Location::FuzzyLocationI;
77 use strict;
79 use base qw(Bio::LocationI);
81 =head1 LocationI methods
83 =head2 location_type
85 Title : loc_type
86 Usage : my $location_type = $location->location_type();
87 Function: Get location type encoded as text
88 Returns : string ('EXACT', 'WITHIN', 'IN-BETWEEN')
89 Args : none
91 =cut
93 sub location_type {
94 my ($self) = @_;
95 $self->throw_not_implemented();
98 =head1 Bio::LocationI methods
100 Bio::LocationI methods follow
102 =head2 min_start
104 Title : min_start
105 Usage : my $minstart = $location->min_start();
106 Function: Get minimum starting location of feature startpoint
107 Returns : integer or undef if no maximum starting point.
108 Args : none
110 =cut
112 =head2 max_start
114 Title : max_start
115 Usage : my $maxstart = $location->max_start();
116 Function: Get maximum starting location of feature startpoint
117 Returns : integer or undef if no maximum starting point.
118 Args : none
120 =cut
122 =head2 start_pos_type
124 Title : start_pos_type
125 Usage : my $start_pos_type = $location->start_pos_type();
126 Function: Get start position type (ie <,>, ^)
127 Returns : type of position coded as text
128 ('BEFORE', 'AFTER', 'EXACT','WITHIN', 'BETWEEN')
129 Args : none
131 =cut
133 =head2 min_end
135 Title : min_end
136 Usage : my $minend = $location->min_end();
137 Function: Get minimum ending location of feature endpoint
138 Returns : integer or undef if no minimum ending point.
139 Args : none
141 =cut
143 =head2 max_end
145 Title : max_end
146 Usage : my $maxend = $location->max_end();
147 Function: Get maximum ending location of feature endpoint
148 Returns : integer or undef if no maximum ending point.
149 Args : none
151 =cut
153 =head2 end_pos_type
155 Title : end_pos_type
156 Usage : my $end_pos_type = $location->end_pos_type();
157 Function: Get end position type (ie <,>, ^)
158 Returns : type of position coded as text
159 ('BEFORE', 'AFTER', 'EXACT','WITHIN', 'BETWEEN')
160 Args : none
162 =cut
164 =head2 seq_id
166 Title : seq_id
167 Usage : my $seqid = $location->seq_id();
168 Function: Get/Set seq_id that location refers to
169 Returns : seq_id
170 Args : [optional] seq_id value to set
172 =cut
174 =head2 coordinate_policy
176 Title : coordinate_policy
177 Usage : $policy = $location->coordinate_policy();
178 $location->coordinate_policy($mypolicy); # set may not be possible
179 Function: Get the coordinate computing policy employed by this object.
181 See Bio::Location::CoordinatePolicyI for documentation about
182 the policy object and its use.
184 The interface *does not* require implementing classes to accept
185 setting of a different policy. The implementation provided here
186 does, however, allow to do so.
188 Implementors of this interface are expected to initialize every
189 new instance with a CoordinatePolicyI object. The implementation
190 provided here will return a default policy object if none has
191 been set yet. To change this default policy object call this
192 method as a class method with an appropriate argument. Note that
193 in this case only subsequently created Location objects will be
194 affected.
196 Returns : A Bio::Location::CoordinatePolicyI implementing object.
197 Args : On set, a Bio::Location::CoordinatePolicyI implementing object.
199 =cut
201 =head2 to_FTstring
203 Title : to_FTstring
204 Usage : my $locstr = $location->to_FTstring()
205 Function: returns the FeatureTable string of this location
206 Returns : string
207 Args : none
209 =cut