merge upstream
[bioperl-live.git] / Bio / Location / SplitLocationI.pm
blob19303923e510aef5f6e6eb5b41c1175b81eae403
2 # BioPerl module for Bio::Location::SplitLocationI
3 # Please direct questions and support issues to <bioperl-l@bioperl.org>
5 # Cared for by Jason Stajich <jason@bioperl.org>
7 # Copyright Jason Stajich
9 # You may distribute this module under the same terms as perl itself
10 # POD documentation - main docs before the code
12 =head1 NAME
14 Bio::Location::SplitLocationI - Abstract interface of a Location on a Sequence
15 which has multiple locations (start/end points)
17 =head1 SYNOPSIS
19 # get a SplitLocationI somehow
20 print $splitlocation->start, "..", $splitlocation->end, "\n";
21 my @sublocs = $splitlocation->sub_Location();
23 my $count = 1;
24 # print the start/end points of the sub locations
25 foreach my $location ( sort { $a->start <=> $b->start } @sublocs ) {
26 printf "sub feature %d [%d..%d]\n", $location->start,$location->end;
27 $count++;
30 =head1 DESCRIPTION
32 This interface encapsulates the necessary methods for representing the
33 location of a sequence feature that has more that just a single
34 start/end pair. Some examples of this are the annotated exons in a
35 gene or the annotated CDS in a sequence file.
37 =head1 FEEDBACK
39 User feedback is an integral part of the evolution of this and other
40 Bioperl modules. Send your comments and suggestions preferably to one
41 of the Bioperl mailing lists. Your participation is much appreciated.
43 bioperl-l@bioperl.org - General discussion
44 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
46 =head2 Support
48 Please direct usage questions or support issues to the mailing list:
50 I<bioperl-l@bioperl.org>
52 rather than to the module maintainer directly. Many experienced and
53 reponsive experts will be able look at the problem and quickly
54 address it. Please include a thorough description of the problem
55 with code and data examples if at all possible.
57 =head2 Reporting Bugs
59 Report bugs to the Bioperl bug tracking system to help us keep track
60 the bugs and their resolution. Bug reports can be submitted via the
61 web:
63 https://github.com/bioperl/bioperl-live/issues
65 =head1 AUTHOR - Jason Stajich
67 Email jason-at-bioperl-dot-org
69 =head1 APPENDIX
71 The rest of the documentation details each of the object
72 methods. Internal methods are usually preceded with a _
74 =cut
76 # Let the code begin...
79 package Bio::Location::SplitLocationI;
80 use strict;
82 use Carp;
84 use base qw(Bio::LocationI);
87 =head2 sub_Location
89 Title : sub_Location
90 Usage : @locations = $feat->sub_Location();
91 Function: Returns an array of LocationI objects
92 Returns : An array
93 Args : none
95 =cut
97 sub sub_Location {
98 my ($self,@args) = @_;
99 $self->throw_not_implemented();
102 =head2 splittype
104 Title : splittype
105 Usage : $splittype = $fuzzy->splittype();
106 Function: get/set the split splittype
107 Returns : the splittype of split feature (join, order)
108 Args : splittype to set
110 =cut
112 sub splittype {
113 my($self) = @_;
114 $self->throw_not_implemented();
118 =head2 is_single_sequence
120 Title : is_single_sequence
121 Usage : if($splitloc->is_single_sequence()) {
122 print "Location object $splitloc is split ".
123 "but only across a single sequence\n";
125 Function: Determine whether this location is split across a single or
126 multiple sequences.
127 Returns : TRUE if all sublocations lie on the same sequence as the root
128 location (feature), and FALSE otherwise.
129 Args : none
131 =cut
133 sub is_single_sequence {
134 my ($self) = @_;
135 $self->throw_not_implemented();
138 =head1 Bio::LocationI methods
140 Bio::LocationI inherited methods follow
142 =head2 min_start
144 Title : min_start
145 Usage : my $minstart = $location->min_start();
146 Function: Get minimum starting location of feature startpoint
147 Returns : integer or undef if no maximum starting point.
148 Args : none
150 =cut
152 =head2 max_start
154 Title : max_start
155 Usage : my $maxstart = $location->max_start();
156 Function: Get maximum starting location of feature startpoint
157 Returns : integer or undef if no maximum starting point.
158 Args : none
160 =cut
162 =head2 start_pos_type
164 Title : start_pos_type
165 Usage : my $start_pos_type = $location->start_pos_type();
166 Function: Get start position type (ie <,>, ^)
167 Returns : type of position coded as text
168 ('BEFORE', 'AFTER', 'EXACT','WITHIN', 'BETWEEN')
169 Args : none
171 =cut
173 =head2 min_end
175 Title : min_end
176 Usage : my $minend = $location->min_end();
177 Function: Get minimum ending location of feature endpoint
178 Returns : integer or undef if no minimum ending point.
179 Args : none
181 =cut
183 =head2 max_end
185 Title : max_end
186 Usage : my $maxend = $location->max_end();
187 Function: Get maximum ending location of feature endpoint
188 Returns : integer or undef if no maximum ending point.
189 Args : none
191 =cut
193 =head2 end_pos_type
195 Title : end_pos_type
196 Usage : my $end_pos_type = $location->end_pos_type();
197 Function: Get end position type (ie <,>, ^)
198 Returns : type of position coded as text
199 ('BEFORE', 'AFTER', 'EXACT','WITHIN', 'BETWEEN')
200 Args : none
202 =cut
204 =head2 seq_id
206 Title : seq_id
207 Usage : my $seqid = $location->seq_id();
208 Function: Get/Set seq_id that location refers to
209 Returns : seq_id
210 Args : [optional] seq_id value to set
212 =cut
214 =head2 coordinate_policy
216 Title : coordinate_policy
217 Usage : $policy = $location->coordinate_policy();
218 $location->coordinate_policy($mypolicy); # set may not be possible
219 Function: Get the coordinate computing policy employed by this object.
221 See Bio::Location::CoordinatePolicyI for documentation about
222 the policy object and its use.
224 The interface *does not* require implementing classes to accept
225 setting of a different policy. The implementation provided here
226 does, however, allow to do so.
228 Implementors of this interface are expected to initialize every
229 new instance with a CoordinatePolicyI object. The implementation
230 provided here will return a default policy object if none has
231 been set yet. To change this default policy object call this
232 method as a class method with an appropriate argument. Note that
233 in this case only subsequently created Location objects will be
234 affected.
236 Returns : A Bio::Location::CoordinatePolicyI implementing object.
237 Args : On set, a Bio::Location::CoordinatePolicyI implementing object.
239 =cut
241 =head2 to_FTstring
243 Title : to_FTstring
244 Usage : my $locstr = $location->to_FTstring()
245 Function: returns the FeatureTable string of this location
246 Returns : string
247 Args : none
249 =cut