Bio::SearchIO
SearchResultEventBuilder
Summary
Bio::SearchIO::SearchResultEventBuilder - Event Handler for SearchIO events.
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
# Do not use this object directly, this object is part of the SearchIO
# event based parsing system.
Description
This object handles Search Events generated by the SearchIO classes
and build appropriate Bio::Search::* objects from them.
Methods
Methods description
Title : new
Usage : my $obj = new Bio::SearchIO::SearchResultEventBuilder();
Function: Builds a new Bio::SearchIO::SearchResultEventBuilder object
Returns : Bio::SearchIO::SearchResultEventBuilder
Args : |
Title : will_handle
Usage : if( $handler->will_handle($event_type) ) { ... }
Function: Tests if this event builder knows how to process a specific event
Returns : boolean
Args : event type name |
Title : start_result
Usage : $handler->start_result($resulttype)
Function: Begins a result event cycle
Returns : none
Args : Type of Report |
Title : end_result
Usage : my @results = $parser->end_result
Function: Finishes a result handler cycle Returns : A Bio::Search::Result::ResultI
Args : none |
Title : start_hsp
Usage : $handler->start_hsp($name,$data)
Function: Begins processing a HSP event
Returns : none
Args : type of element
associated data (hashref) |
Title : end_hsp
Usage : $handler->end_hsp()
Function: Finish processing a HSP event
Returns : none
Args : type of event and associated hashref |
Title : start_hit
Usage : $handler->start_hit()
Function: Starts a Hit event cycle
Returns : none
Args : type of event and associated hashref |
Title : end_hit
Usage : $handler->end_hit()
Function: Ends a Hit event cycle
Returns : Bio::Search::Hit::HitI object
Args : type of event and associated hashref |
Methods code
sub new
{ my($class,@args) = @_;
my $self = $class->SUPER::new(@args);
return $self; } |
sub will_handle
{ my ($self,$type) = @_;
return ( $type eq 'hsp' || $type eq 'hit' || $type eq 'result' ); } |
sub start_result
{ my ($self,$type) = @_;
$self->{'_resulttype'} = $type;
$self->{'_subjects'} = [];
return;} |
sub end_result
{ my ($self,$type,$data) = @_;
my $result = new Bio::Search::Result::GenericResult
('-database_name' => $data->{'dbname'},
'-database_letters' => $data->{'dblets'},
'-database_entries' => $data->{'dbsize'},
'-query_name' => $data->{'queryname'},
'-query_length' => $data->{'querylen'},
'-query_accession' => $data->{'queryacc'},
'-query_description' => $data->{'querydesc'},
'-algorithm' => $type,
'-algorithm_version' => $data->{'programver'},
'-parameters' => $data->{'param'},
'-statistics' => $data->{'stat'},
'-hits' => $self->{'_hits'});
$self->{'_hits'} = [];
return $result;} |
sub start_hsp
{ my ($self,@args) = @_;
return;} |
sub end_hsp
{ my ($self,$type,$data) = @_;
if( defined $data->{'queryframe'} && (( $data->{'queryframe'} < 0 &&
$data->{'querystart'} < $data->{'queryend'} ) ||
$data->{'queryframe'} > 0 &&
( $data->{'querystart'} > $data->{'queryend'} ) )
)
{
($data->{'querystart'},
$data->{'queryend'}) = ($data->{'queryend'}, $data->{'querystart'});
}
if( defined $data->{'hitframe'} && ((defined $data->{'hitframe'} && $data->{'hitframe'} < 0 &&
$data->{'hitstart'} < $data->{'hitend'} ) ||
defined $data->{'hitframe'} && $data->{'hitframe'} > 0 &&
( $data->{'hitstart'} > $data->{'hitend'} ) )
)
{
($data->{'hitstart'},
$data->{'hitend'}) = ($data->{'hitend'},
$data->{'hitstart'});
}
$data->{'queryframe'} ||= 0;
$data->{'hitframe'} ||= 0;
$data->{'querylen'} ||= length $data->{'queryseq'};
$data->{'hitlen'} ||= length $data->{'hitseq'};
$data->{'hsplen'} ||= length $data->{'homolseq'};
my $hsp = new Bio::Search::HSP::GenericHSP
(
'-algorithm' => $type,
'-score' => $data->{'score'} || $data->{'swscore'},
'-bits' => $data->{'bits'},
'-identical' => $data->{'identical'},
'-hsp_length' => $data->{'hsplen'},
'-conserved' => $data->{'conserved'},
'-hsp_gaps' => $data->{'gaps'},
'-hit_gaps' => $data->{'hitgaps'},
'-query_gaps' => $data->{'querygaps'},
'-evalue' => $data->{'evalue'},
'-pvalue' => $data->{'pvalue'},
'-query_start' => $data->{'querystart'},
'-query_end' => $data->{'queryend'},
'-hit_start' => $data->{'hitstart'},
'-hit_end' => $data->{'hitend'},
'-query_seq' => $data->{'queryseq'},
'-hit_seq' => $data->{'hitseq'},
'-homology_seq' => $data->{'homolseq'},
'-query_length' => $data->{'querylen'},
'-hit_length' => $data->{'hitlen'},
'-query_name' => $data->{'queryname'},
'-hit_name' => $data->{'hitname'},
'-query_frame' => $data->{'queryframe'},
'-hit_frame' => $data->{'hitframe'},
);
push @{$self->{'_hsps'}}, $hsp;
return $hsp;} |
sub start_hit
{ my ($self,$type) = @_;
$self->{'_hsps'} = [];
return;} |
sub end_hit
{ my ($self,$type,$data) = @_;
my $hit = new Bio::Search::Hit::GenericHit
( '-algorithm' => $type,
'-name' => $data->{'hitname'},
'-length' => $data->{'hitlen'},
'-accession' => $data->{'hitacc'},
'-description' => $data->{'hitdesc'},
'-significance'=> $data->{'hitsignif'},
'-score' => $data->{'hitscore'},
'-hsps' => $self->{'_hsps'});
push @{$self->{'_hits'}}, $hit;
$self->{'_hsps'} = [];
return $hit;} |
General documentation
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list. Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/MailList.shtml - About the mailing lists
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via
email or the web:
bioperl-bugs@bioperl.org
http://bioperl.org/bioperl-bugs/
| AUTHOR - Jason Stajich | Top |
Additional contributors names and emails here
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _