| 1 | # | ||
| 2 | # BioPerl module for Bio::SearchIO::EventHandlerI | ||
| 3 | # | ||
| 4 | # Please direct questions and support issues to <bioperl-l@bioperl.org> | ||
| 5 | # | ||
| 6 | # Cared for by Jason Stajich <jason@bioperl.org> | ||
| 7 | # | ||
| 8 | # Copyright Jason Stajich | ||
| 9 | # | ||
| 10 | # You may distribute this module under the same terms as perl itself | ||
| 11 | |||
| 12 | # POD documentation - main docs before the code | ||
| 13 | |||
| 14 | =head1 NAME | ||
| 15 | |||
| 16 | Bio::SearchIO::EventHandlerI - An abstract Event Handler for Search Result parsing | ||
| 17 | |||
| 18 | =head1 SYNOPSIS | ||
| 19 | |||
| 20 | # do not use this object directly it is an interface | ||
| 21 | # See Bio::SearchIO::SearchResultEventBuilder for an implementation | ||
| 22 | |||
| 23 | use Bio::SearchIO::SearchResultEventBuilder; | ||
| 24 | my $handler = Bio::SearchIO::SearchResultEventBuilder->new(); | ||
| 25 | |||
| 26 | =head1 DESCRIPTION | ||
| 27 | |||
| 28 | This interface describes the basic methods needed to handle Events | ||
| 29 | thrown from parsing a Search Result such as FASTA, BLAST, or HMMer. | ||
| 30 | |||
| 31 | =head1 FEEDBACK | ||
| 32 | |||
| 33 | =head2 Mailing Lists | ||
| 34 | |||
| 35 | User feedback is an integral part of the evolution of this and other | ||
| 36 | Bioperl modules. Send your comments and suggestions preferably to | ||
| 37 | the Bioperl mailing list. Your participation is much appreciated. | ||
| 38 | |||
| 39 | bioperl-l@bioperl.org - General discussion | ||
| 40 | http://bioperl.org/wiki/Mailing_lists - About the mailing lists | ||
| 41 | |||
| 42 | =head2 Support | ||
| 43 | |||
| 44 | Please direct usage questions or support issues to the mailing list: | ||
| 45 | |||
| 46 | I<bioperl-l@bioperl.org> | ||
| 47 | |||
| 48 | rather than to the module maintainer directly. Many experienced and | ||
| 49 | reponsive experts will be able look at the problem and quickly | ||
| 50 | address it. Please include a thorough description of the problem | ||
| 51 | with code and data examples if at all possible. | ||
| 52 | |||
| 53 | =head2 Reporting Bugs | ||
| 54 | |||
| 55 | Report bugs to the Bioperl bug tracking system to help us keep track | ||
| 56 | of the bugs and their resolution. Bug reports can be submitted via the | ||
| 57 | web: | ||
| 58 | |||
| 59 | https://github.com/bioperl/bioperl-live/issues | ||
| 60 | |||
| 61 | =head1 AUTHOR - Jason Stajich | ||
| 62 | |||
| 63 | Email jason-at-bioperl.org | ||
| 64 | |||
| 65 | =head1 APPENDIX | ||
| 66 | |||
| 67 | The rest of the documentation details each of the object methods. | ||
| 68 | Internal methods are usually preceded with a _ | ||
| 69 | |||
| 70 | =cut | ||
| 71 | |||
| 72 | |||
| 73 | # Let the code begin... | ||
| 74 | |||
| 75 | |||
| 76 | package Bio::SearchIO::EventHandlerI; | ||
| 77 | 52 | $Bio::SearchIO::EventHandlerI::VERSION = '1.7.8'; | |
| 78 | 52 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 79 | 52 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 80 | |||
| 81 | |||
| 82 | 52 | ▶ | use base qw(Bio::Event::EventHandlerI); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 83 | |||
| 84 | =head2 start_result | ||
| 85 | |||
| 86 | Title : start_result | ||
| 87 | Usage : $handler->start_result($data) | ||
| 88 | Function: Begins a result event cycle | ||
| 89 | Returns : none | ||
| 90 | Args : Type of Result | ||
| 91 | |||
| 92 | =cut | ||
| 93 | |||
| 94 | 0 | ▶ | sub start_result { |
|
Subroutine
start_result: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 95 | 0 | my ($self) = @_; | |
| 96 | 0 | $self->throw_not_implemented(); | |
| 97 | } | ||
| 98 | |||
| 99 | =head2 end_result | ||
| 100 | |||
| 101 | Title : end_result | ||
| 102 | Usage : $handler->end_result($data) | ||
| 103 | Function: Ends a result event cycle | ||
| 104 | Returns : Bio::Search::Result::ResultI object | ||
| 105 | Args : none | ||
| 106 | |||
| 107 | |||
| 108 | =cut | ||
| 109 | |||
| 110 | 0 | ▶ | sub end_result{ |
|
Subroutine
end_result: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 111 | 0 | my ($self,@args) = @_; | |
| 112 | 0 | $self->throw_not_implemented(); | |
| 113 | } | ||
| 114 | |||
| 115 | =head2 start_hsp | ||
| 116 | |||
| 117 | Title : start_hsp | ||
| 118 | Usage : $handler->start_hsp($data) | ||
| 119 | Function: Start a HSP event cycle | ||
| 120 | Returns : none | ||
| 121 | Args : type of element | ||
| 122 | associated hashref | ||
| 123 | |||
| 124 | =cut | ||
| 125 | |||
| 126 | 0 | ▶ | sub start_hsp{ |
|
Subroutine
start_hsp: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 127 | 0 | my ($self,@args) = @_; | |
| 128 | 0 | $self->throw_not_implemented(); | |
| 129 | } | ||
| 130 | |||
| 131 | =head2 end_hsp | ||
| 132 | |||
| 133 | Title : end_hsp | ||
| 134 | Usage : $handler->end_hsp() | ||
| 135 | Function: Ends a HSP event cycle | ||
| 136 | Returns : Bio::Search::HSP::HSPI object | ||
| 137 | Args : type of event and associated hashref | ||
| 138 | |||
| 139 | =cut | ||
| 140 | |||
| 141 | 0 | ▶ | sub end_hsp{ |
|
Subroutine
end_hsp: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 142 | 0 | my ($self,@args) = @_; | |
| 143 | 0 | $self->throw_not_implemented(); | |
| 144 | } | ||
| 145 | |||
| 146 | =head2 start_hit | ||
| 147 | |||
| 148 | Title : start_hit | ||
| 149 | Usage : $handler->start_hit() | ||
| 150 | Function: Starts a Hit event cycle | ||
| 151 | Returns : none | ||
| 152 | Args : type of event and associated hashref | ||
| 153 | |||
| 154 | |||
| 155 | =cut | ||
| 156 | |||
| 157 | 0 | ▶ | sub start_hit { |
|
Subroutine
start_hit: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 158 | 0 | my ($self,@args) = @_; | |
| 159 | 0 | $self->throw_not_implemented | |
| 160 | } | ||
| 161 | |||
| 162 | =head2 end_hit | ||
| 163 | |||
| 164 | Title : end_hit | ||
| 165 | Usage : $handler->end_hit() | ||
| 166 | Function: Ends a Hit event cycle | ||
| 167 | Returns : Bio::Search::Hit::HitI object | ||
| 168 | Args : type of event and associated hashref | ||
| 169 | |||
| 170 | |||
| 171 | =cut | ||
| 172 | |||
| 173 | 0 | ▶ | sub end_hit { |
|
Subroutine
end_hit: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 174 | 0 | my ($self,@args) = @_; | |
| 175 | 0 | $self->throw_not_implemented(); | |
| 176 | } | ||
| 177 | |||
| 178 | =head2 start_iteration | ||
| 179 | |||
| 180 | Title : start_iteration | ||
| 181 | Usage : $handler->start_iteration() | ||
| 182 | Function: Starts an Iteration event cycle | ||
| 183 | Returns : none | ||
| 184 | Args : type of event and associated hashref | ||
| 185 | |||
| 186 | |||
| 187 | =cut | ||
| 188 | |||
| 189 | 0 | ▶ | sub start_iteration { |
|
Subroutine
start_iteration: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 190 | 0 | my ($self,@args) = @_; | |
| 191 | 0 | $self->throw_not_implemented | |
| 192 | } | ||
| 193 | |||
| 194 | =head2 end_iteration | ||
| 195 | |||
| 196 | Title : end_iteration | ||
| 197 | Usage : $handler->end_iteration() | ||
| 198 | Function: Ends an Iterationevent cycle | ||
| 199 | Returns : Bio::Search::Iteration::IterationI object | ||
| 200 | Args : type of event and associated hashref | ||
| 201 | |||
| 202 | |||
| 203 | =cut | ||
| 204 | |||
| 205 | 0 | ▶ | sub end_iteration { |
|
Subroutine
end_iteration: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 206 | 0 | my ($self,@args) = @_; | |
| 207 | 0 | $self->throw_not_implemented(); | |
| 208 | } | ||
| 209 | |||
| 210 | =head2 register_factory | ||
| 211 | |||
| 212 | Title : register_factory | ||
| 213 | Usage : $handler->register_factory('TYPE',$factory); | ||
| 214 | Function: Register a specific factory for a object type class | ||
| 215 | Returns : none | ||
| 216 | Args : string representing the class and | ||
| 217 | Bio::Factory::ObjectFactoryI | ||
| 218 | |||
| 219 | See L<Bio::Factory::ObjectFactoryI> for more information | ||
| 220 | |||
| 221 | =cut | ||
| 222 | |||
| 223 | 0 | ▶ | sub register_factory{ |
|
Subroutine
register_factory: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 224 | 0 | my ($self,@args) = @_; | |
| 225 | 0 | $self->throw_not_implemented(); | |
| 226 | } | ||
| 227 | |||
| 228 | |||
| 229 | =head2 factory | ||
| 230 | |||
| 231 | Title : factory | ||
| 232 | Usage : my $f = $handler->factory('TYPE'); | ||
| 233 | Function: Retrieves the associated factory for requested 'TYPE' | ||
| 234 | Returns : a Bio::Factory::ObjectFactoryI | ||
| 235 | Throws : Bio::Root::BadParameter if none registered for the supplied type | ||
| 236 | Args : name of factory class to retrieve | ||
| 237 | |||
| 238 | See L<Bio::Factory::ObjectFactoryI> for more information | ||
| 239 | |||
| 240 | =cut | ||
| 241 | |||
| 242 | 0 | ▶ | sub factory{ |
|
Subroutine
factory: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 243 | 0 | my ($self,@args) = @_; | |
| 244 | 0 | $self->throw_not_implemented(); | |
| 245 | } | ||
| 246 | |||
| 247 | |||
| 248 | =head2 Bio::Event::EventHandlerI methods | ||
| 249 | |||
| 250 | =cut | ||
| 251 | |||
| 252 | =head2 will_handle | ||
| 253 | |||
| 254 | Title : will_handle | ||
| 255 | Usage : if( $handler->will_handle($event_type) ) { ... } | ||
| 256 | Function: Tests if this event builder knows how to process a specific event | ||
| 257 | Returns : boolean | ||
| 258 | Args : event type name | ||
| 259 | |||
| 260 | |||
| 261 | =cut | ||
| 262 | |||
| 263 | =head2 SAX methods | ||
| 264 | |||
| 265 | See L<Bio::Event::EventHandlerI> for the additional SAX methods. | ||
| 266 | |||
| 267 | =cut | ||
| 268 | |||
| 269 | |||
| 270 | 52 | 1; | |