| 1 | # | ||
| 2 | # BioPerl module for FAST::Bio::Location::FuzzyLocationI | ||
| 3 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||
| 4 | # | ||
| 5 | # Cared for by Jason Stajich <jason@bioperl.org> | ||
| 6 | # | ||
| 7 | # Copyright Jason Stajich | ||
| 8 | # | ||
| 9 | # You may distribute this module under the same terms as perl itself | ||
| 10 | # POD documentation - main docs before the code | ||
| 11 | |||
| 12 | =head1 NAME | ||
| 13 | |||
| 14 | FAST::Bio::Location::FuzzyLocationI - Abstract interface of a Location on a Sequence | ||
| 15 | which has unclear start/end location | ||
| 16 | |||
| 17 | =head1 SYNOPSIS | ||
| 18 | |||
| 19 | # Get a FuzzyLocationI object somehow | ||
| 20 | print "Fuzzy FT location string is ", $location->to_FTstring(); | ||
| 21 | print "location is of the type ", $location->loc_type, "\n"; | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | This interface encapsulates the necessary methods for representing a | ||
| 26 | Fuzzy Location, one that does not have clear start and/or end points. | ||
| 27 | This will initially serve to handle features from Genbank/EMBL feature | ||
| 28 | tables that are written as 1^100 meaning between bases 1 and 100 or | ||
| 29 | E<lt>100..300 meaning it starts somewhere before 100. Advanced | ||
| 30 | implementations of this interface may be able to handle the necessary | ||
| 31 | logic of overlaps/intersection/contains/union. It was constructed to | ||
| 32 | handle fuzzy locations that can be represented in Genbank/EMBL. | ||
| 33 | |||
| 34 | =head1 FEEDBACK | ||
| 35 | |||
| 36 | User feedback is an integral part of the evolution of this and other | ||
| 37 | Bioperl modules. Send your comments and suggestions preferably to one | ||
| 38 | of the Bioperl mailing lists. Your participation is much appreciated. | ||
| 39 | |||
| 40 | bioperl-l@bioperl.org - General discussion | ||
| 41 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||
| 42 | |||
| 43 | =head2 Support | ||
| 44 | |||
| 45 | Please direct usage questions or support issues to the mailing list: | ||
| 46 | |||
| 47 | I<bioperl-l@bioperl.org> | ||
| 48 | |||
| 49 | rather than to the module maintainer directly. Many experienced and | ||
| 50 | reponsive experts will be able look at the problem and quickly | ||
| 51 | address it. Please include a thorough description of the problem | ||
| 52 | with code and data examples if at all possible. | ||
| 53 | |||
| 54 | =head2 Reporting Bugs | ||
| 55 | |||
| 56 | Report bugs to the Bioperl bug tracking system to help us keep track | ||
| 57 | the bugs and their resolution. Bug reports can be submitted via the web: | ||
| 58 | |||
| 59 | https://redmine.open-bio.org/projects/bioperl/ | ||
| 60 | |||
| 61 | =head1 AUTHOR - Jason Stajich | ||
| 62 | |||
| 63 | Email jason-at-bioperl-dot-org | ||
| 64 | |||
| 65 | =head1 APPENDIX | ||
| 66 | |||
| 67 | The rest of the documentation details each of the object | ||
| 68 | methods. Internal methods are usually preceded with a _ | ||
| 69 | |||
| 70 | =cut | ||
| 71 | |||
| 72 | # Let the code begin... | ||
| 73 | |||
| 74 | |||
| 75 | package FAST::Bio::Location::FuzzyLocationI; | ||
| 76 | use strict; | ||
| 77 | |||
| 78 | use base qw(FAST::Bio::LocationI); | ||
| 79 | |||
| 80 | =head1 LocationI methods | ||
| 81 | |||
| 82 | =head2 location_type | ||
| 83 | |||
| 84 | Title : loc_type | ||
| 85 | Usage : my $location_type = $location->location_type(); | ||
| 86 | Function: Get location type encoded as text | ||
| 87 | Returns : string ('EXACT', 'WITHIN', 'IN-BETWEEN') | ||
| 88 | Args : none | ||
| 89 | |||
| 90 | =cut | ||
| 91 | |||
| 92 | sub location_type { | ||
| 93 | my ($self) = @_; | ||
| 94 | $self->throw_not_implemented(); | ||
| 95 | } | ||
| 96 | |||
| 97 | =head1 FAST::Bio::LocationI methods | ||
| 98 | |||
| 99 | FAST::Bio::LocationI methods follow | ||
| 100 | |||
| 101 | =head2 min_start | ||
| 102 | |||
| 103 | Title : min_start | ||
| 104 | Usage : my $minstart = $location->min_start(); | ||
| 105 | Function: Get minimum starting location of feature startpoint | ||
| 106 | Returns : integer or undef if no maximum starting point. | ||
| 107 | Args : none | ||
| 108 | |||
| 109 | =cut | ||
| 110 | |||
| 111 | =head2 max_start | ||
| 112 | |||
| 113 | Title : max_start | ||
| 114 | Usage : my $maxstart = $location->max_start(); | ||
| 115 | Function: Get maximum starting location of feature startpoint | ||
| 116 | Returns : integer or undef if no maximum starting point. | ||
| 117 | Args : none | ||
| 118 | |||
| 119 | =cut | ||
| 120 | |||
| 121 | =head2 start_pos_type | ||
| 122 | |||
| 123 | Title : start_pos_type | ||
| 124 | Usage : my $start_pos_type = $location->start_pos_type(); | ||
| 125 | Function: Get start position type (ie <,>, ^) | ||
| 126 | Returns : type of position coded as text | ||
| 127 | ('BEFORE', 'AFTER', 'EXACT','WITHIN', 'BETWEEN') | ||
| 128 | Args : none | ||
| 129 | |||
| 130 | =cut | ||
| 131 | |||
| 132 | =head2 min_end | ||
| 133 | |||
| 134 | Title : min_end | ||
| 135 | Usage : my $minend = $location->min_end(); | ||
| 136 | Function: Get minimum ending location of feature endpoint | ||
| 137 | Returns : integer or undef if no minimum ending point. | ||
| 138 | Args : none | ||
| 139 | |||
| 140 | =cut | ||
| 141 | |||
| 142 | =head2 max_end | ||
| 143 | |||
| 144 | Title : max_end | ||
| 145 | Usage : my $maxend = $location->max_end(); | ||
| 146 | Function: Get maximum ending location of feature endpoint | ||
| 147 | Returns : integer or undef if no maximum ending point. | ||
| 148 | Args : none | ||
| 149 | |||
| 150 | =cut | ||
| 151 | |||
| 152 | =head2 end_pos_type | ||
| 153 | |||
| 154 | Title : end_pos_type | ||
| 155 | Usage : my $end_pos_type = $location->end_pos_type(); | ||
| 156 | Function: Get end position type (ie <,>, ^) | ||
| 157 | Returns : type of position coded as text | ||
| 158 | ('BEFORE', 'AFTER', 'EXACT','WITHIN', 'BETWEEN') | ||
| 159 | Args : none | ||
| 160 | |||
| 161 | =cut | ||
| 162 | |||
| 163 | =head2 seq_id | ||
| 164 | |||
| 165 | Title : seq_id | ||
| 166 | Usage : my $seqid = $location->seq_id(); | ||
| 167 | Function: Get/Set seq_id that location refers to | ||
| 168 | Returns : seq_id | ||
| 169 | Args : [optional] seq_id value to set | ||
| 170 | |||
| 171 | =cut | ||
| 172 | |||
| 173 | =head2 coordinate_policy | ||
| 174 | |||
| 175 | Title : coordinate_policy | ||
| 176 | Usage : $policy = $location->coordinate_policy(); | ||
| 177 | $location->coordinate_policy($mypolicy); # set may not be possible | ||
| 178 | Function: Get the coordinate computing policy employed by this object. | ||
| 179 | |||
| 180 | See FAST::Bio::Location::CoordinatePolicyI for documentation about | ||
| 181 | the policy object and its use. | ||
| 182 | |||
| 183 | The interface *does not* require implementing classes to accept | ||
| 184 | setting of a different policy. The implementation provided here | ||
| 185 | does, however, allow to do so. | ||
| 186 | |||
| 187 | Implementors of this interface are expected to initialize every | ||
| 188 | new instance with a CoordinatePolicyI object. The implementation | ||
| 189 | provided here will return a default policy object if none has | ||
| 190 | been set yet. To change this default policy object call this | ||
| 191 | method as a class method with an appropriate argument. Note that | ||
| 192 | in this case only subsequently created Location objects will be | ||
| 193 | affected. | ||
| 194 | |||
| 195 | Returns : A FAST::Bio::Location::CoordinatePolicyI implementing object. | ||
| 196 | Args : On set, a FAST::Bio::Location::CoordinatePolicyI implementing object. | ||
| 197 | |||
| 198 | =cut | ||
| 199 | |||
| 200 | =head2 to_FTstring | ||
| 201 | |||
| 202 | Title : to_FTstring | ||
| 203 | Usage : my $locstr = $location->to_FTstring() | ||
| 204 | Function: returns the FeatureTable string of this location | ||
| 205 | Returns : string | ||
| 206 | Args : none | ||
| 207 | |||
| 208 | =cut | ||
| 209 | |||
| 210 | 1; |