Mercurial > repos > mahtabm > ensembl
comparison variant_effect_predictor/Bio/Location/SplitLocationI.pm @ 0:1f6dce3d34e0
Uploaded
| author | mahtabm |
|---|---|
| date | Thu, 11 Apr 2013 02:01:53 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:1f6dce3d34e0 |
|---|---|
| 1 # $Id: SplitLocationI.pm,v 1.14 2002/12/01 00:05:20 jason Exp $ | |
| 2 # | |
| 3 # BioPerl module for Bio::Location::SplitLocationI | |
| 4 # Cared for by Jason Stajich <jason@bioperl.org> | |
| 5 # | |
| 6 # Copyright Jason Stajich | |
| 7 # | |
| 8 # You may distribute this module under the same terms as perl itself | |
| 9 # POD documentation - main docs before the code | |
| 10 | |
| 11 =head1 NAME | |
| 12 | |
| 13 Bio::SplitLocationI - Abstract interface of a Location on a Sequence | |
| 14 which has multiple locations (start/end points) | |
| 15 | |
| 16 =head1 SYNOPSIS | |
| 17 | |
| 18 # get a SplitLocationI somehow | |
| 19 print $splitlocation->start, "..", $splitlocation->end, "\n"; | |
| 20 my @sublocs = $splitlocation->sub_Location(); | |
| 21 | |
| 22 my $count = 1; | |
| 23 # print the start/end points of the sub locations | |
| 24 foreach my $location ( sort { $a->start <=> $b->start } | |
| 25 @sublocs ) { | |
| 26 printf "sub feature %d [%d..%d]\n", $location->start,$location->end; | |
| 27 $count++; | |
| 28 } | |
| 29 | |
| 30 =head1 DESCRIPTION | |
| 31 | |
| 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. | |
| 36 | |
| 37 =head1 FEEDBACK | |
| 38 | |
| 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. | |
| 42 | |
| 43 bioperl-l@bioperl.org - General discussion | |
| 44 http://bio.perl.org/MailList.html - About the mailing lists | |
| 45 | |
| 46 =head2 Reporting Bugs | |
| 47 | |
| 48 Report bugs to the Bioperl bug tracking system to help us keep track | |
| 49 the bugs and their resolution. Bug reports can be submitted via email | |
| 50 or the web: | |
| 51 | |
| 52 bioperl-bugs@bio.perl.org | |
| 53 http://bugzilla.bioperl.org/ | |
| 54 | |
| 55 =head1 AUTHOR - Jason Stajich | |
| 56 | |
| 57 Email jason@bioperl.org | |
| 58 | |
| 59 =head1 APPENDIX | |
| 60 | |
| 61 The rest of the documentation details each of the object | |
| 62 methods. Internal methods are usually preceded with a _ | |
| 63 | |
| 64 =cut | |
| 65 | |
| 66 # Let the code begin... | |
| 67 | |
| 68 | |
| 69 package Bio::Location::SplitLocationI; | |
| 70 use vars qw(@ISA); | |
| 71 use strict; | |
| 72 | |
| 73 use Bio::LocationI; | |
| 74 use Carp; | |
| 75 | |
| 76 @ISA = qw(Bio::LocationI); | |
| 77 | |
| 78 | |
| 79 =head2 sub_Location | |
| 80 | |
| 81 Title : sub_Location | |
| 82 Usage : @locations = $feat->sub_Location(); | |
| 83 Function: Returns an array of LocationI objects | |
| 84 Returns : An array | |
| 85 Args : none | |
| 86 | |
| 87 =cut | |
| 88 | |
| 89 sub sub_Location { | |
| 90 my ($self,@args) = @_; | |
| 91 $self->throw_not_implemented(); | |
| 92 } | |
| 93 | |
| 94 =head2 splittype | |
| 95 | |
| 96 Title : splittype | |
| 97 Usage : $splittype = $fuzzy->splittype(); | |
| 98 Function: get/set the split splittype | |
| 99 Returns : the splittype of split feature (join, order) | |
| 100 Args : splittype to set | |
| 101 | |
| 102 =cut | |
| 103 | |
| 104 sub splittype { | |
| 105 my($self) = @_; | |
| 106 $self->throw_not_implemented(); | |
| 107 } | |
| 108 | |
| 109 | |
| 110 =head2 is_single_sequence | |
| 111 | |
| 112 Title : is_single_sequence | |
| 113 Usage : if($splitloc->is_single_sequence()) { | |
| 114 print "Location object $splitloc is split ". | |
| 115 "but only across a single sequence\n"; | |
| 116 } | |
| 117 Function: Determine whether this location is split across a single or | |
| 118 multiple sequences. | |
| 119 Returns : TRUE if all sublocations lie on the same sequence as the root | |
| 120 location (feature), and FALSE otherwise. | |
| 121 Args : none | |
| 122 | |
| 123 =cut | |
| 124 | |
| 125 sub is_single_sequence { | |
| 126 my ($self) = @_; | |
| 127 $self->throw_not_implemented(); | |
| 128 } | |
| 129 | |
| 130 =head1 Bio::LocationI methods | |
| 131 | |
| 132 Bio::LocationI inherited methods follow | |
| 133 | |
| 134 =head2 min_start | |
| 135 | |
| 136 Title : min_start | |
| 137 Usage : my $minstart = $location->min_start(); | |
| 138 Function: Get minimum starting location of feature startpoint | |
| 139 Returns : integer or undef if no maximum starting point. | |
| 140 Args : none | |
| 141 | |
| 142 =cut | |
| 143 | |
| 144 =head2 max_start | |
| 145 | |
| 146 Title : max_start | |
| 147 Usage : my $maxstart = $location->max_start(); | |
| 148 Function: Get maximum starting location of feature startpoint | |
| 149 Returns : integer or undef if no maximum starting point. | |
| 150 Args : none | |
| 151 | |
| 152 =cut | |
| 153 | |
| 154 =head2 start_pos_type | |
| 155 | |
| 156 Title : start_pos_type | |
| 157 Usage : my $start_pos_type = $location->start_pos_type(); | |
| 158 Function: Get start position type (ie <,>, ^) | |
| 159 Returns : type of position coded as text | |
| 160 ('BEFORE', 'AFTER', 'EXACT','WITHIN', 'BETWEEN') | |
| 161 Args : none | |
| 162 | |
| 163 =cut | |
| 164 | |
| 165 =head2 min_end | |
| 166 | |
| 167 Title : min_end | |
| 168 Usage : my $minend = $location->min_end(); | |
| 169 Function: Get minimum ending location of feature endpoint | |
| 170 Returns : integer or undef if no minimum ending point. | |
| 171 Args : none | |
| 172 | |
| 173 =cut | |
| 174 | |
| 175 =head2 max_end | |
| 176 | |
| 177 Title : max_end | |
| 178 Usage : my $maxend = $location->max_end(); | |
| 179 Function: Get maximum ending location of feature endpoint | |
| 180 Returns : integer or undef if no maximum ending point. | |
| 181 Args : none | |
| 182 | |
| 183 =cut | |
| 184 | |
| 185 =head2 end_pos_type | |
| 186 | |
| 187 Title : end_pos_type | |
| 188 Usage : my $end_pos_type = $location->end_pos_type(); | |
| 189 Function: Get end position type (ie <,>, ^) | |
| 190 Returns : type of position coded as text | |
| 191 ('BEFORE', 'AFTER', 'EXACT','WITHIN', 'BETWEEN') | |
| 192 Args : none | |
| 193 | |
| 194 =cut | |
| 195 | |
| 196 =head2 seq_id | |
| 197 | |
| 198 Title : seq_id | |
| 199 Usage : my $seqid = $location->seq_id(); | |
| 200 Function: Get/Set seq_id that location refers to | |
| 201 Returns : seq_id | |
| 202 Args : [optional] seq_id value to set | |
| 203 | |
| 204 =cut | |
| 205 | |
| 206 =head2 coordinate_policy | |
| 207 | |
| 208 Title : coordinate_policy | |
| 209 Usage : $policy = $location->coordinate_policy(); | |
| 210 $location->coordinate_policy($mypolicy); # set may not be possible | |
| 211 Function: Get the coordinate computing policy employed by this object. | |
| 212 | |
| 213 See Bio::Location::CoordinatePolicyI for documentation about | |
| 214 the policy object and its use. | |
| 215 | |
| 216 The interface *does not* require implementing classes to accept | |
| 217 setting of a different policy. The implementation provided here | |
| 218 does, however, allow to do so. | |
| 219 | |
| 220 Implementors of this interface are expected to initialize every | |
| 221 new instance with a CoordinatePolicyI object. The implementation | |
| 222 provided here will return a default policy object if none has | |
| 223 been set yet. To change this default policy object call this | |
| 224 method as a class method with an appropriate argument. Note that | |
| 225 in this case only subsequently created Location objects will be | |
| 226 affected. | |
| 227 | |
| 228 Returns : A Bio::Location::CoordinatePolicyI implementing object. | |
| 229 Args : On set, a Bio::Location::CoordinatePolicyI implementing object. | |
| 230 | |
| 231 =cut | |
| 232 | |
| 233 =head2 to_FTstring | |
| 234 | |
| 235 Title : to_FTstring | |
| 236 Usage : my $locstr = $location->to_FTstring() | |
| 237 Function: returns the FeatureTable string of this location | |
| 238 Returns : string | |
| 239 Args : none | |
| 240 | |
| 241 =cut | |
| 242 | |
| 243 1; | |
| 244 |
