| Filename | /Users/ap13/perl5/lib/perl5/Bio/Location/CoordinatePolicyI.pm |
| Statements | Executed 5 statements in 124µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 16µs | 28µs | Bio::Location::CoordinatePolicyI::BEGIN@84 |
| 1 | 1 | 1 | 8µs | 68µs | Bio::Location::CoordinatePolicyI::BEGIN@86 |
| 0 | 0 | 0 | 0s | 0s | Bio::Location::CoordinatePolicyI::end |
| 0 | 0 | 0 | 0s | 0s | Bio::Location::CoordinatePolicyI::start |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | # | ||||
| 2 | # BioPerl module for Bio::Location::CoordinatePolicyI | ||||
| 3 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||||
| 4 | # | ||||
| 5 | # Cared for by Hilmar Lapp <hlapp@gmx.net> | ||||
| 6 | # and Jason Stajich <jason@bioperl.org> | ||||
| 7 | # | ||||
| 8 | # Copyright Hilmar Lapp, Jason Stajich | ||||
| 9 | # | ||||
| 10 | # You may distribute this module under the same terms as perl itself | ||||
| 11 | # POD documentation - main docs before the code | ||||
| 12 | |||||
| 13 | =head1 NAME | ||||
| 14 | |||||
| 15 | Bio::Location::CoordinatePolicyI - Abstract interface for objects implementing | ||||
| 16 | a certain policy of computing integer-valued coordinates of a Location | ||||
| 17 | |||||
| 18 | =head1 SYNOPSIS | ||||
| 19 | |||||
| 20 | # get a location, e.g., from a SeqFeature | ||||
| 21 | $location = $feature->location(); | ||||
| 22 | # examine its coordinate computation policy | ||||
| 23 | print "Location of feature ", $feature->primary_tag(), " employs a ", | ||||
| 24 | ref($location->coordinate_policy()), | ||||
| 25 | " instance for coordinate computation\n"; | ||||
| 26 | # change the policy, e.g. because the user chose to do so | ||||
| 27 | $location->coordinate_policy(Bio::Location::NarrowestCoordPolicy->new()); | ||||
| 28 | |||||
| 29 | =head1 DESCRIPTION | ||||
| 30 | |||||
| 31 | Objects implementing this interface are used by Bio::LocationI | ||||
| 32 | implementing objects to determine integer-valued coordinates when | ||||
| 33 | asked for it. While this may seem trivial for simple locations, there | ||||
| 34 | are different ways to do it for fuzzy or compound (split) | ||||
| 35 | locations. Classes implementing this interface implement a certain | ||||
| 36 | policy, like 'always widest range', 'always smallest range', 'mean for | ||||
| 37 | BETWEEN locations', etc. By installing a different policy object in a | ||||
| 38 | Location object, the behaviour of coordinate computation can be changed | ||||
| 39 | on-the-fly, and with a single line of code client-side. | ||||
| 40 | |||||
| 41 | =head1 FEEDBACK | ||||
| 42 | |||||
| 43 | User feedback is an integral part of the evolution of this and other | ||||
| 44 | Bioperl modules. Send your comments and suggestions preferably to one | ||||
| 45 | of the Bioperl mailing lists. Your participation is much appreciated. | ||||
| 46 | |||||
| 47 | bioperl-l@bioperl.org - General discussion | ||||
| 48 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||||
| 49 | |||||
| 50 | =head2 Support | ||||
| 51 | |||||
| 52 | Please direct usage questions or support issues to the mailing list: | ||||
| 53 | |||||
| 54 | I<bioperl-l@bioperl.org> | ||||
| 55 | |||||
| 56 | rather than to the module maintainer directly. Many experienced and | ||||
| 57 | reponsive experts will be able look at the problem and quickly | ||||
| 58 | address it. Please include a thorough description of the problem | ||||
| 59 | with code and data examples if at all possible. | ||||
| 60 | |||||
| 61 | =head2 Reporting Bugs | ||||
| 62 | |||||
| 63 | Report bugs to the Bioperl bug tracking system to help us keep track | ||||
| 64 | the bugs and their resolution. Bug reports can be submitted via the | ||||
| 65 | web: | ||||
| 66 | |||||
| 67 | https://github.com/bioperl/bioperl-live/issues | ||||
| 68 | |||||
| 69 | =head1 AUTHOR - Hilmar Lapp, Jason Stajich | ||||
| 70 | |||||
| 71 | Email hlapp@gmx.net, jason@bioperl.org | ||||
| 72 | |||||
| 73 | =head1 APPENDIX | ||||
| 74 | |||||
| 75 | The rest of the documentation details each of the object | ||||
| 76 | methods. Internal methods are usually preceded with a _ | ||||
| 77 | |||||
| 78 | =cut | ||||
| 79 | |||||
| 80 | # Let the code begin... | ||||
| 81 | |||||
| 82 | |||||
| 83 | package Bio::Location::CoordinatePolicyI; | ||||
| 84 | 2 | 32µs | 2 | 41µs | # spent 28µs (16+13) within Bio::Location::CoordinatePolicyI::BEGIN@84 which was called:
# once (16µs+13µs) by base::import at line 84 # spent 28µs making 1 call to Bio::Location::CoordinatePolicyI::BEGIN@84
# spent 13µs making 1 call to strict::import |
| 85 | |||||
| 86 | 2 | 90µs | 2 | 68µs | # spent 68µs (8+60) within Bio::Location::CoordinatePolicyI::BEGIN@86 which was called:
# once (8µs+60µs) by base::import at line 86 # spent 68µs making 1 call to Bio::Location::CoordinatePolicyI::BEGIN@86
# spent 60µs making 1 call to base::import, recursion: max depth 2, sum of overlapping time 60µs |
| 87 | |||||
| 88 | =head2 start | ||||
| 89 | |||||
| 90 | Title : start | ||||
| 91 | Usage : $start = $policy->start($location); | ||||
| 92 | Function: Get the integer-valued start coordinate of the given location as | ||||
| 93 | computed by this computation policy. | ||||
| 94 | Returns : A positive integer number. | ||||
| 95 | Args : A Bio::LocationI implementing object. | ||||
| 96 | |||||
| 97 | =cut | ||||
| 98 | |||||
| 99 | sub start { | ||||
| 100 | my ($self) = @_; | ||||
| 101 | $self->throw_not_implemented(); | ||||
| 102 | } | ||||
| 103 | |||||
| 104 | =head2 end | ||||
| 105 | |||||
| 106 | Title : end | ||||
| 107 | Usage : $end = $policy->end($location); | ||||
| 108 | Function: Get the integer-valued end coordinate of the given location as | ||||
| 109 | computed by this computation policy. | ||||
| 110 | Returns : A positive integer number. | ||||
| 111 | Args : A Bio::LocationI implementing object. | ||||
| 112 | |||||
| 113 | =cut | ||||
| 114 | |||||
| 115 | sub end { | ||||
| 116 | my ($self) = @_; | ||||
| 117 | $self->throw_not_implemented(); | ||||
| 118 | } | ||||
| 119 | |||||
| 120 | 1 | 2µs | 1; |